Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nercury/gl_generator_profiling_struct-rs
ProfilingStructGenerator for gl_generator
https://github.com/nercury/gl_generator_profiling_struct-rs
Last synced: 2 months ago
JSON representation
ProfilingStructGenerator for gl_generator
- Host: GitHub
- URL: https://github.com/nercury/gl_generator_profiling_struct-rs
- Owner: Nercury
- License: apache-2.0
- Created: 2018-08-18T19:27:30.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-06-20T11:07:47.000Z (over 2 years ago)
- Last Synced: 2024-11-16T21:16:48.288Z (2 months ago)
- Language: Rust
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
## Profiling struct generator
Yet another generator for `gl_generator`, very similar to `DebugStructGenerator`, but with these changes/additions:
- It does not log all calls. It only logs a call that caused an error.
- The corresponding explanation is included with the error code.
- Contains a profiler that tracks the number of GL calls and errors.### Using the profiler
The generated `gl` module gains 3 additional methods:
- `profiler_reset()` - resets the profiler;
- `profiler_call_count() -> usize` - returns the number of calls since the last reset (or application start);
- `profiler_err_count() -> usize` - returns the number of errors since the last reset (or application start);Example usage:
```rust
gl::profiler_reset();// the code
println!("Number of GL calls: {}", gl::profiler_call_count());
println!("Number of GL errors: {}", gl::profiler_err_count());
```## License
Licensed under either of
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)at your option.
### Contribution
Unless you explicitly state otherwise, any contribution intentionally
submitted for inclusion in the work by you, as defined in the Apache-2.0
license, shall be dual licensed as above, without any additional terms or
conditions.