Skip to content

deno-windowing/gluten

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deno Gluten

Tags Doc License Sponsor

OpenGL bindings & WebGL API implementation for Deno.

Note: WebGL API is WIP.

Usage

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

All the functions map 1:1 with the C OpenGL API.

Extensions are present in /api/ext/*.

Before using the API, make sure to create OpenGL context and load function pointers using load function exported, which accepts a getProcAddress callback (DWM handles both).

// GLES2 3.2 API
import * as gl from "https://deno.land/x/gluten@0.1.8/api/gles23.2.ts";

// Initialize function pointers
gl.load(yourGetProcAddress);

// ... Initialize context (for example using DWM)

// Use APIs from `gl` i.e. gl.DrawElements(...)

For using WebGL, mod.ts exports WebGLCanvas which handles both window and context creation.

Check ./examples for some usage examples.

Since this module depends on unstable FFI API, you need to pass --unstable-ffi.

deno run -A --unstable-ffi <file>

Extensions:

  • Babylon (Use ext/babylon.ts for an easy to use wrapper)

Maintainers

License

Apache-2.0 licensed.

Copyright 2024 © The Deno Windowing Team