Skip to content

Commit

Permalink
OpenGL Bindings (#16)
Browse files Browse the repository at this point in the history
* Added opengl.c3l for opengl bindings

* Update README.md formatting

* Added bindings for all previous OpenGL versions (1.0 - 4.6)

* Added bindings for all previous OpenGL versions (1.0 - 4.6)

* Delete libraries/opengl.c3l/LICENSE

* Update README.md
  • Loading branch information
ellipse12 authored Aug 18, 2024
1 parent 0ffa417 commit d308efa
Show file tree
Hide file tree
Showing 22 changed files with 34,767 additions and 0 deletions.
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

0 comments on commit d308efa

Please sign in to comment.