{"id":25828816,"url":"https://github.com/unrust/uni-gl","last_synced_at":"2025-06-17T22:36:28.554Z","repository":{"id":57671104,"uuid":"138703320","full_name":"unrust/uni-gl","owner":"unrust","description":"Unrust native/wasm compatibility layer for openGL API","archived":false,"fork":false,"pushed_at":"2023-01-13T22:29:44.000Z","size":54,"stargazers_count":17,"open_issues_count":1,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-31T11:28:51.178Z","etag":null,"topics":["opengl","wasm"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unrust.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-26T07:48:51.000Z","updated_at":"2025-01-13T11:18:21.000Z","dependencies_parsed_at":"2023-02-09T17:31:19.255Z","dependency_job_id":null,"html_url":"https://github.com/unrust/uni-gl","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/unrust/uni-gl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unrust%2Funi-gl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unrust%2Funi-gl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unrust%2Funi-gl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unrust%2Funi-gl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unrust","download_url":"https://codeload.github.com/unrust/uni-gl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unrust%2Funi-gl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260451589,"owners_count":23011309,"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","wasm"],"created_at":"2025-02-28T18:24:18.617Z","updated_at":"2025-06-17T22:36:23.543Z","avatar_url":"https://github.com/unrust.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# unrust / uni-gl\n\n[![Build Status](https://travis-ci.org/unrust/uni-gl.svg?branch=master)](https://travis-ci.org/unrust/uni-gl)\n[![Documentation](https://docs.rs/uni-gl/badge.svg)](https://docs.rs/uni-gl)\n[![crates.io](https://meritbadge.herokuapp.com/uni-gl)](https://crates.io/crates/uni-gl)\n\nThis library is a part of [Unrust](https://github.com/unrust/unrust), a pure rust native/wasm game engine.\nThis library provides a native/wasm compatibility layer for following components :\n* OpenGL API\n\nWhen used in conjonction with uni-app, on native target, it provides an OpenGL 3.2+ or OpenGLES 2.0+ Core Profile context.\nOn web target, it provides a WebGL 2.0 context where available, else a WebGL 1.0 context.\n\n## Usage\n\n```toml\n[dependencies]\nuni-app=\"0.3.*\"\nuni-gl=\"0.3.*\"\n```\n\n```rust\nextern crate uni_app;\nextern crate uni_gl;\n\nfn main() {\n    // create the game window (native) or canvas (web)\n    let app = uni_app::App::new(uni_app::AppConfig {\n        size: (800, 600),\n        title: \"my game\".to_owned(),\n        vsync: true,\n        show_cursor: true,\n        headless: false,\n        resizable: true,\n        fullscreen: false,\n        intercept_close_request: false,\n    });\n    // retrieve the opengl context\n    let gl = uni_gl::WebGLRenderingContext::new(app.canvas());\n    // start game loop\n    app.run(move |_app: \u0026mut uni_app::App| {\n        // do some openGL stuff\n        gl.clear_color(0.0, 0.0, 1.0, 1.0);\n        gl.clear(uni_gl::BufferBit::Color);\n    });\n}\n```\n\n## Build\n\n### As web app (wasm32-unknown-unknown)\n\nInstall wasm32 target :\n```\nrustup target install wasm32-unknown-unknown\n```\nInstall [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/)\nand [npm](https://www.npmjs.com/get-npm)\n\nCompile the demo with\n```\nwasm-pack build examples\n```\nThis creates a wasm package in examples/pkg\n\nRun the demo with\n```\ncd www\nnpm install\nnpm run start\n```\n\nOpen your browser at http://localhost:8080/\n\n### As desktop app (native-opengl)\n\n```\ncargo run --example basic --release\n```\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any\nadditional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funrust%2Funi-gl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funrust%2Funi-gl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funrust%2Funi-gl/lists"}