File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 7
7
8
8
OpenGL bindings & WebGL API implementation for Deno.
9
9
10
+ Note: WebGL API is WIP.
11
+
10
12
## Usage
11
13
12
14
Import native OpenGL from ` /api/gl[es|es2]{version}.ts ` .
13
15
16
+ All the functions map 1:1 with the C OpenGL API.
17
+
14
18
Extensions are present in ` /api/ext/* ` .
15
19
16
20
Before using the API, make sure to create OpenGL context and load function
17
21
pointers using ` load ` function exported, which accepts a ` getProcAddress `
18
22
callback ([ DWM] ( https://github.com/deno-windowing/dwm ) handles both).
19
23
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
+
20
36
For using WebGL, ` mod.ts ` exports ` WebGLCanvas ` which handles both window and
21
37
context creation.
22
38
You can’t perform that action at this time.
0 commit comments