Skip to content

Commit 80db66d

Browse files
authored
chore: update readme
1 parent ba0d7ab commit 80db66d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,32 @@
77

88
OpenGL bindings & WebGL API implementation for Deno.
99

10+
Note: WebGL API is WIP.
11+
1012
## Usage
1113

1214
Import native OpenGL from `/api/gl[es|es2]{version}.ts`.
1315

16+
All the functions map 1:1 with the C OpenGL API.
17+
1418
Extensions are present in `/api/ext/*`.
1519

1620
Before using the API, make sure to create OpenGL context and load function
1721
pointers using `load` function exported, which accepts a `getProcAddress`
1822
callback ([DWM](https://github.com/deno-windowing/dwm) handles both).
1923

24+
```ts
25+
// GLES2 3.2 API
26+
import * as gl from "https://deno.land/x/[email protected]/api/gles23.2.ts";
27+
28+
// Initialize function pointers
29+
gl.load(yourGetProcAddress);
30+
31+
// ... Initialize context (for example using DWM)
32+
33+
// Use APIs from `gl` i.e. gl.DrawElements(...)
34+
```
35+
2036
For using WebGL, `mod.ts` exports `WebGLCanvas` which handles both window and
2137
context creation.
2238

0 commit comments

Comments
 (0)