{"id":13682608,"url":"https://github.com/bwasty/learn-opengl-rs","last_synced_at":"2025-04-12T22:26:02.610Z","repository":{"id":37677296,"uuid":"93337189","full_name":"bwasty/learn-opengl-rs","owner":"bwasty","description":"Rust port of JoeyDeVries/LearnOpenGL","archived":false,"fork":false,"pushed_at":"2021-12-22T00:33:37.000Z","size":53492,"stargazers_count":993,"open_issues_count":5,"forks_count":70,"subscribers_count":33,"default_branch":"master","last_synced_at":"2025-03-28T01:06:01.605Z","etag":null,"topics":["opengl","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bwasty.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":"2017-06-04T19:41:11.000Z","updated_at":"2025-03-25T19:04:25.000Z","dependencies_parsed_at":"2022-07-08T07:42:46.972Z","dependency_job_id":null,"html_url":"https://github.com/bwasty/learn-opengl-rs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwasty%2Flearn-opengl-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwasty%2Flearn-opengl-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwasty%2Flearn-opengl-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwasty%2Flearn-opengl-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bwasty","download_url":"https://codeload.github.com/bwasty/learn-opengl-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247107817,"owners_count":20884793,"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":["opengl","rust"],"created_at":"2024-08-02T13:01:49.588Z","updated_at":"2025-04-04T02:05:13.943Z","avatar_url":"https://github.com/bwasty.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# learn-opengl-rs [![Build Status](https://travis-ci.org/bwasty/learn-opengl-rs.svg?branch=master)](https://travis-ci.org/bwasty/learn-opengl-rs)\nRust port of https://github.com/JoeyDeVries/LearnOpenGL\n\nYou should be able to follow the tutorials at https://learnopengl.com/ with this - the code structure has been kept similar to the original C++ wherever possible.\n\u003e This also means it's not necessarily the most idiomatic Rust code. For example, some standard naming convention lints are disabled and all OpenGL calls are \"raw\" and wrapped in `unsafe` blocks.\n\nRun individual tutorials like this:\n`cargo run 1_3_2` (for `/src/_1_getting_started/_3_2_shaders_interpolation.rs`).\n\nFor reduced compilation times, you may only compile the code for a certain chapter by adding `--no-default-features --features chapter-1` for example.\n\u003cp align=\"center\"\u003e\n\u003ca href=\"src/_1_getting_started/_2_1_hello_triangle.rs\"\u003e\u003cimg width=\"250\" alt=\"1_3_2\" title=\"1_3_2 Hello Triangle\" src=\"https://user-images.githubusercontent.com/1647415/27755053-d5cd0f5a-5ded-11e7-99b4-abd4e3bb8638.png\"\u003e\u003c/a\u003e\n\u003ca href=\"src/_2_lighting/_6_multiple_lights.rs\"\u003e\u003cimg width=\"250\" alt=\"2_6\" title=\"2_6 Multiple Lights\" src=\"https://user-images.githubusercontent.com/1647415/27755102-fd217078-5ded-11e7-96f6-efdeb9ffdcac.png\"\u003e\u003c/a\u003e\n\u003ca href=\"src/_3_model_loading/_1_model_loading.rs\"\u003e\u003cimg width=\"250\" alt=\"3_1\" title=\"3_1 Model Loading\"src=\"https://user-images.githubusercontent.com/1647415/27755660-52df4104-5df1-11e7-800c-45a514bf3130.png\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"src/_4_advanced_opengl/_6_2_cubemaps_environment_mapping.rs\"\u003e\u003cimg width=\"250\" alt=\"4_6_2\" title=\"4_6_2 Framebuffers\"src=\"https://user-images.githubusercontent.com/1647415/27843160-306a96aa-6111-11e7-8b89-15820f39cff0.png\"\u003e\u003c/a\u003e\n\u003ca href=\"src/_4_advanced_opengl/_9_1_geometry_shader_houses.rs\"\u003e\u003cimg width=\"250\" alt=\"4_9_1\" title=\"4_9_1 Geometry Shader\"src=\"https://user-images.githubusercontent.com/1647415/28338597-c1fa9ed2-6c09-11e7-9e25-3e70e6fbacd9.png\"\u003e\u003c/a\u003e\n\u003ca href=\"src/_4_advanced_opengl/_10_3_asteroids_instanced.rs\"\u003e\u003cimg width=\"250\" alt=\"4_10_3\" title=\"4_10_3 Instancing\"src=\"https://user-images.githubusercontent.com/1647415/28338123-3748ea6a-6c08-11e7-9c50-93f333a15083.png\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Chapters\n### [1. Getting started](src/_1_getting_started)\n**Notes**\n- You can mostly ignore the setup instructions at [Getting-started/Creating-a-window](https://learnopengl.com/#!Getting-started/Creating-a-window). Just create a new project with `cargo` and copy the dependency section from [Cargo.toml](Cargo.toml). Only `glfw-rs` might need some more setup, see [here](https://github.com/PistonDevelopers/glfw-rs#using-glfw-rs) for details. You can also use [glutin](https://github.com/tomaka/glutin) (a pure Rust alternative to GLFW), but the API is a bit different, so following the tutorials might not be as straight-forward.\n- You might be tempted to use [glium](https://github.com/glium/glium) instead of raw OpenGL. I'd recommend against that, at least in the beginning, to get a good understanding of how OpenGL really works. Also, glium is not actively maintained at the moment.\n- If you experience black screens or weird rendering artifacts, check out the [`glCheckError!`](https://github.com/bwasty/learn-opengl-rs/blob/89aed9919a2347e49965820830a6aecfdda18cf3/src/_7_in_practice/_1_debugging.rs#L28-L53) macro from chapter 7.\n- exercises have been mostly omitted. You can look up the solutions in the original C++ source.\n\n### [2. Lighting](src/_2_lighting)\n### [3. Model loading](src/_3_model_loading)\n**Notes**\n- For simplicity [`tobj`](https://github.com/Twinklebear/tobj) is used instead of `assimp` (simpler interface, pure Rust and later tutorials only load OBJ files anyway). For alternatives see [here](http://arewegameyet.com/categories/3dformatloader.html) and [here](https://crates.io/search?q=assimp).\n- The `image` crate is quite slow in debug mode - loading the nanosuit textures takes so much time that it can be faster to use release mode (including compile time).\n### [4. Advanced OpenGL](src/_4_advanced_opengl)\n**Status:** complete\n### [5. Advanced Lighting](src/_5_advanced_lighting)\n**Status:** partially done (4/9).\n### [6. PBR](src/_6_pbr)\n**Status:** partially done (1/2).\n### [7. In Practice](src/_7_in_practice)\n**Status:** `Debugging` complete (the other two are not in the repo)\n\n----\n### A note about the code organization\nOriginally each tutorial was a separate executable (using `src/bin` and `cargo run --bin \u003cname\u003e`. This didn't play very well with the `RLS` and `clippy` (-\u003e [rust-lang-nursery/rls#132](https://github.com/rust-lang-nursery/rls/issues/132)). Now all are integrated into the main binary, which leads to long compile times. As a workaround there are now feature flags for each chapter.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwasty%2Flearn-opengl-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbwasty%2Flearn-opengl-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwasty%2Flearn-opengl-rs/lists"}