https://github.com/cbeck88/empoxy
A port of libepoxy to emscripten
https://github.com/cbeck88/empoxy
Last synced: 2 months ago
JSON representation
A port of libepoxy to emscripten
- Host: GitHub
- URL: https://github.com/cbeck88/empoxy
- Owner: cbeck88
- License: other
- Created: 2016-01-02T19:02:19.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-09T00:41:02.000Z (over 9 years ago)
- Last Synced: 2025-03-29T01:11:48.180Z (3 months ago)
- Language: Makefile
- Homepage:
- Size: 313 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# Empoxy
[](http://travis-ci.org/cbeck88/empoxy)
[](./COPYING)Empoxy is a port of the [epoxy library](https://github.com/yaronct/libepoxy) to [emscripten](https://github.com/kripken/emscripten).
Epoxy is a modern and widely used library for OpenGL function pointer management. Epoxy
provides a "combined" header for various different opengl versions, and resolves
function name aliases between the different versions for you. It also requires
no explicit initialization (function pointers are initialized as you use them), and has
minimal overhead / startup time.Besides this, the implementation is much cleaner and simpler -- epoxy's dispatch
code is generated by a small (1000 lines) python script which reads the official
GL spec published by Khronos as a series of XML files. From this it outputs
appropriate C code, and this C code, mated with ~1000 lines of hand-written C,
is the total of the implementation. This means the library is not too hard to
understand and maintain, and as new versions of GL are released it is easy to
keep it up to date.In order to provide emscripten support for Epoxy, we modified the python script
so that the batch code always requests function pointers from emscripten's
OpenGL compat layer, rather than from dynamically linked libs. This means that
we provide exactly the same header file for you to compile with.# Notes
- Empoxy has been configured to pretend that you have an OpenGL ES version 2.0 context.
(Even though glGetString... will report WebGL.)
- We only provide the `` header right now. We could potentially provide `` but egl support is not that great in Emscripten atm.
Similarly some of the compatibility code for `glBegin`, `glEnd` and various `wgl` functions were not ported.
- The intended use is to port your working GL ES2 program which uses epoxy
to transparently use WebGL instead.
Empoxy defers entirely to emscripten's built-in opengl compatibility layer --
if you need full ES2 support, you need to pass to appropriate switch to emscripten,
and emscripten will give you errors as usual if it's not configured correctly.