{"id":28393507,"url":"https://github.com/pistondevelopers/gfx_debug_draw","last_synced_at":"2025-12-12T14:50:38.376Z","repository":{"id":27742860,"uuid":"31230698","full_name":"PistonDevelopers/gfx_debug_draw","owner":"PistonDevelopers","description":"Simple debug renderer (lines, text, etc) for gfx","archived":false,"fork":false,"pushed_at":"2023-11-14T20:29:04.000Z","size":144,"stargazers_count":7,"open_issues_count":3,"forks_count":5,"subscribers_count":41,"default_branch":"master","last_synced_at":"2025-06-01T03:39:20.675Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PistonDevelopers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-23T21:26:39.000Z","updated_at":"2023-07-25T13:55:04.000Z","dependencies_parsed_at":"2023-01-14T07:24:01.939Z","dependency_job_id":null,"html_url":"https://github.com/PistonDevelopers/gfx_debug_draw","commit_stats":null,"previous_names":["pistondevelopers/gfx-debug-draw"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PistonDevelopers/gfx_debug_draw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PistonDevelopers%2Fgfx_debug_draw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PistonDevelopers%2Fgfx_debug_draw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PistonDevelopers%2Fgfx_debug_draw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PistonDevelopers%2Fgfx_debug_draw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PistonDevelopers","download_url":"https://codeload.github.com/PistonDevelopers/gfx_debug_draw/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PistonDevelopers%2Fgfx_debug_draw/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259509427,"owners_count":22868834,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-31T16:38:29.365Z","updated_at":"2025-12-12T14:50:33.327Z","avatar_url":"https://github.com/PistonDevelopers.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gfx_debug_draw [![Build Status](https://travis-ci.org/PistonDevelopers/gfx_debug_draw.png?branch=master)](https://travis-ci.org/PistonDevelopers/gfx-debug-draw)\n\nLibrary for batched renderering of lines and text in 3D space, using [gfx-rs](https://github.com/gfx-rs/gfx-rs).\n\n[Documentation](http://www.piston.rs/docs/gfx-debug-draw/gfx_debug_draw/)\n\n## Usage\n\n```rust\n// Initializing...\n\n// Create gfx_text::Renderer to be used by the DebugRenderer\nlet text_renderer = {\n    let factory = piston_window.device.borrow_mut().spawn_factory(); // gfx::Factory\n    gfx_text::new(factory).unwrap() // can optionally configure text renderer here (font, color)\n};\n\nlet mut debug_renderer = DebugRenderer::new(\n    piston_window.device.borrow_mut().spawn_factory(), // gfx::Factory\n    text_renderer,\n\t64, // Initial size of vertex buffers\n).ok().unwrap();\n\n...\n\n// In render loop...\n\n// Draw red line from origin along x-axis\ndebug_renderer.draw_line(\n\t[0.0, 0.0, 0.0], // Start position\n\t[5.0, 0.0, 0.0], // End position\n\t[1.0, 0.0, 0.0, 1.0], // Line color\n);\n\n// Draw an 'X' on the x-axis, at the end of the line drawn above.\ndebug_renderer.draw_text_at_position(\n\t\"X\", // String to draw\n\t[6.0, 0.0, 0.0], // World-space position to draw at\n\t[1.0, 0.0, 0.0, 1.0], // Text color\n);\n\n// Draw salmoney-colored text 10 pixels down and right from the top left corner of the screen\ndebug_renderer.draw_text_on_screen(\n\t\"Hello World!\", // Text to draw\n\t[10, 10], // Pixel coordinates relative to top-left corner of screen\n\t[1.0, 0.4, 0.4, 0.7] // Text color\n);\n\n// Draw a yellow position marker\ndebug_renderer.draw_marker(\n    [1.0, 2.0, 3.0],  // Position\n    0.5, // Size\n    [1.0, 1.0, 0.0, 1.0] // Color\n);\n\n// Render the final batch of all lines and text currently present in the vertex/index buffers\n\ndebug_renderer.render(\n\tstream, // \u0026mut gfx::Stream\n\tcamera_projection, // Current camera projection matrix\n);\n\n```\n\nDraw commands can also be queued up with static methods, which is useful when you want to debug\nsomething in a context where you have no access to the DebugRenderer instance.\n\n```rust\nfn foobar() {\n   ...\n   let x: Vector3\u003cf32\u003e = some_expression;\n   // Visually debug the value of `x` with a red position marker:\n   gfx_debug_draw::draw_marker(x, 1.0, [1.0, 0.0, 0.0, 1.0]);\n   ...\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpistondevelopers%2Fgfx_debug_draw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpistondevelopers%2Fgfx_debug_draw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpistondevelopers%2Fgfx_debug_draw/lists"}