Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenGL Bindings #16

Merged
merged 6 commits into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions libraries/opengl.c3l/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# OpenGL Bindings FAQ

- OpenGL functions are renamed as follows: `glFunctionName` -> `gl::functionName`
- Constant definitions keep the same name but are converted to C3 constants: `#define GL_FALSE 0` -> `const GL_FALSE = 0;`
- Fixed length types are converted to the corresponding C3 types: `uint32_t` -> `int`
- Variable length types are converted to the corresponding standard library compatibility types: `int` -> `CInt`
- If a C typedef corresponds to a unique type that expects a subset of values it keeps the same name and gets converted to C3: `GLenum` -> `GLenum`
- all `const char *` sequences are converted to `ZString`

# Older OpenGL Versions

- All older versions of OpenGL are supported.
- By default the most recent version is used.
- The specific version used can be set as follows:
```C3
module opengl;
const GL_VERSION = 33;
```
- The `GL_VERSION` is just the desired opengl version without the decimal point (so version 1.0 becomes 10, and 4.5 becomes 45)
- Once the version is set only the functions and definitions from that version can be used. The only exception is anything defined in opengl.c3i as global.
Loading
Loading