| Crates.io | globject-rs |
| lib.rs | globject-rs |
| version | 0.3.4 |
| created_at | 2025-08-05 12:06:37.518698+00 |
| updated_at | 2025-08-19 06:02:57.762512+00 |
| description | OpenGL Object Wrapper for Rust |
| homepage | |
| repository | https://github.com/0xAA55/globject-rs |
| max_upload_size | |
| id | 1781887 |
| size | 247,717 |
简体中文 | English
This is a wrapper library for OpenGL objects, encapsulating OpenGL objects as Rust structs using RAII rules. The underlying OpenGL library uses the glcore-rs crate.
Buffer: Buffer objectShader: Shader objectTexture: Texture objectFramebuffer: Framebuffer objectPipeline: VAO objectMesh: Mesh object, which has a vertex buffer, an element buffer (vertex index), an instance buffer, and a rendering command buffer.BufferVecStatic/BufferVecDynamic/trait BufferVec: Encapsulates buffer objects into a generic structure similar to Vec, allowing for easier modification of buffer contents.Material: A material library, distinguishing between conventional (MaterialLegacy) and physically based optics rendering (PBR) (MaterialPbr). Each member can be either a texture (Texture) or a color value (Vec4).Meshset/Pipelineset: A mesh set, each mesh has a corresponding name, material, and shader.bind() method according to RAII rules and return a binding guard that provides various functions supported by the bound object.unbind() or automatically by drop().Pipeline accepts user-provided vertex and instance structs as input, automatically parsing the struct members and associating them with shader attribute inputs (Attrib) by name and type.Shader can export and import compiled shader binaries, supporting both standard rendering (VS -> GS -> FS) and general computation (CS).Texture supports 1D, 2D, 3D, and Cube textures. It supports loading textures directly from ImageBuffer or file paths (JPEG loading is optimized by turbojpeg), and supports asynchronous texture uploading and downloading using PBOs.Framebuffer can read shader outputs from Shader and then bind all its texture names to the shader output names.Mesh comes with its own Command Buffer object, it naturally supports acceleration of glMultiDrawIndirect().GLCore, which manages all OpenGL API function pointers.GLCore, you can create and use various objects in this library.I borrowed the shader from shadertoy to run the unit test. If you are the Author, welcome to contact me about this.
See the unit tests.