| |
| |
| |
| |
| |
| |
|
|
| #pragma once |
|
|
| #include <emscripten/html5.h> |
|
|
| #include <stdint.h> |
| #include <pthread.h> |
|
|
| #ifdef __cplusplus |
| extern "C" { |
| #endif |
|
|
| typedef uintptr_t EMSCRIPTEN_WEBGL_CONTEXT_HANDLE; |
|
|
| typedef int EMSCRIPTEN_WEBGL_CONTEXT_PROXY_MODE; |
| #define EMSCRIPTEN_WEBGL_CONTEXT_PROXY_DISALLOW 0 |
| #define EMSCRIPTEN_WEBGL_CONTEXT_PROXY_FALLBACK 1 |
| #define EMSCRIPTEN_WEBGL_CONTEXT_PROXY_ALWAYS 2 |
|
|
| typedef int EM_WEBGL_POWER_PREFERENCE; |
| #define EM_WEBGL_POWER_PREFERENCE_DEFAULT 0 |
| #define EM_WEBGL_POWER_PREFERENCE_LOW_POWER 1 |
| #define EM_WEBGL_POWER_PREFERENCE_HIGH_PERFORMANCE 2 |
|
|
| typedef struct EmscriptenWebGLContextAttributes { |
| bool alpha; |
| bool depth; |
| bool stencil; |
| bool antialias; |
| bool premultipliedAlpha; |
| bool preserveDrawingBuffer; |
| EM_WEBGL_POWER_PREFERENCE powerPreference; |
| bool failIfMajorPerformanceCaveat; |
|
|
| int majorVersion; |
| int minorVersion; |
|
|
| bool enableExtensionsByDefault; |
| bool explicitSwapControl; |
| EMSCRIPTEN_WEBGL_CONTEXT_PROXY_MODE proxyContextToMainThread; |
| bool renderViaOffscreenBackBuffer; |
| } EmscriptenWebGLContextAttributes; |
|
|
| void emscripten_webgl_init_context_attributes(EmscriptenWebGLContextAttributes * _Nonnull attributes); |
|
|
| EMSCRIPTEN_WEBGL_CONTEXT_HANDLE emscripten_webgl_create_context(const char * _Nonnull target, const EmscriptenWebGLContextAttributes * _Nonnull attributes); |
|
|
| EMSCRIPTEN_RESULT emscripten_webgl_make_context_current(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context); |
|
|
| EMSCRIPTEN_WEBGL_CONTEXT_HANDLE emscripten_webgl_get_current_context(void); |
|
|
| EMSCRIPTEN_RESULT emscripten_webgl_get_drawing_buffer_size(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context, int * _Nonnull width, int * _Nonnull height); |
|
|
| EMSCRIPTEN_RESULT emscripten_webgl_get_context_attributes(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context, EmscriptenWebGLContextAttributes * _Nonnull outAttributes); |
|
|
| EMSCRIPTEN_RESULT emscripten_webgl_destroy_context(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context); |
|
|
| bool emscripten_webgl_enable_extension(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context, const char * _Nonnull extension); |
|
|
| bool emscripten_webgl_enable_ANGLE_instanced_arrays(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context); |
|
|
| bool emscripten_webgl_enable_OES_vertex_array_object(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context); |
|
|
| bool emscripten_webgl_enable_WEBGL_draw_buffers(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context); |
|
|
| bool emscripten_webgl_enable_WEBGL_draw_instanced_base_vertex_base_instance(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context); |
|
|
| bool emscripten_webgl_enable_WEBGL_multi_draw(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context); |
|
|
| bool emscripten_webgl_enable_WEBGL_multi_draw_instanced_base_vertex_base_instance(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context); |
|
|
| bool emscripten_webgl_enable_EXT_polygon_offset_clamp(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context); |
|
|
| bool emscripten_webgl_enable_EXT_clip_control(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context); |
|
|
| bool emscripten_webgl_enable_WEBGL_polygon_mode(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context); |
|
|
| typedef bool (*em_webgl_context_callback)(int eventType, const void *reserved, void *userData); |
| EMSCRIPTEN_RESULT emscripten_set_webglcontextlost_callback_on_thread(const char * _Nonnull target, void *userData, bool useCapture, em_webgl_context_callback callback, pthread_t targetThread); |
| EMSCRIPTEN_RESULT emscripten_set_webglcontextrestored_callback_on_thread(const char * _Nonnull target, void *userData, bool useCapture, em_webgl_context_callback callback, pthread_t targetThread); |
|
|
| bool emscripten_is_webgl_context_lost(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context); |
|
|
| EMSCRIPTEN_RESULT emscripten_webgl_commit_frame(void); |
|
|
| bool emscripten_supports_offscreencanvas(void); |
|
|
| |
| |
| |
| void *emscripten_webgl1_get_proc_address(const char * _Nonnull name); |
|
|
| |
| |
| |
| void *emscripten_webgl2_get_proc_address(const char * _Nonnull name); |
|
|
| |
| void *emscripten_webgl_get_proc_address(const char * _Nonnull name); |
|
|
| #define emscripten_set_webglcontextlost_callback(target, userData, useCapture, callback) emscripten_set_webglcontextlost_callback_on_thread( (target), (userData), (useCapture), (callback), EM_CALLBACK_THREAD_CONTEXT_CALLING_THREAD) |
| #define emscripten_set_webglcontextrestored_callback(target, userData, useCapture, callback) emscripten_set_webglcontextrestored_callback_on_thread( (target), (userData), (useCapture), (callback), EM_CALLBACK_THREAD_CONTEXT_CALLING_THREAD) |
|
|
| #define GLint int |
| #define GLenum int |
| #define GLint64 long long int |
|
|
| #define EMSCRIPTEN_WEBGL_PARAM_TYPE int |
| #define EMSCRIPTEN_WEBGL_PARAM_TYPE_INT 0 |
| #define EMSCRIPTEN_WEBGL_PARAM_TYPE_FLOAT 1 |
|
|
| |
| |
| |
| char *emscripten_webgl_get_supported_extensions(void); |
|
|
| |
| |
| |
| double emscripten_webgl_get_shader_parameter_d(GLint shader, GLenum param); |
|
|
| |
| |
| char *emscripten_webgl_get_shader_info_log_utf8(GLint shader); |
|
|
| |
| |
| char *emscripten_webgl_get_shader_source_utf8(GLint shader); |
|
|
| |
| |
| |
| double emscripten_webgl_get_program_parameter_d(GLint program, GLenum param); |
|
|
| |
| |
| char *emscripten_webgl_get_program_info_log_utf8(GLint program); |
|
|
| |
| |
| |
| double emscripten_webgl_get_vertex_attrib_d(int index, GLenum param); |
|
|
| |
| |
| |
| GLint emscripten_webgl_get_vertex_attrib_o(int index, GLenum param); |
|
|
| |
| |
| |
| |
| |
| |
| int emscripten_webgl_get_vertex_attrib_v(int index, GLenum param, void * _Nonnull dst, int dstLength, EMSCRIPTEN_WEBGL_PARAM_TYPE dstType); |
|
|
| |
| |
| |
| double emscripten_webgl_get_uniform_d(GLint program, int location); |
|
|
| |
| |
| |
| |
| |
| |
| int emscripten_webgl_get_uniform_v(GLint program, int location, void * _Nonnull dst, int dstLength, EMSCRIPTEN_WEBGL_PARAM_TYPE dstType); |
|
|
| |
| |
| |
| |
| |
| |
| int emscripten_webgl_get_parameter_v(GLenum param, void * _Nonnull dst, int dstLength, EMSCRIPTEN_WEBGL_PARAM_TYPE dstType); |
|
|
| |
| |
| |
| double emscripten_webgl_get_parameter_d(GLenum param); |
|
|
| |
| |
| |
| GLint emscripten_webgl_get_parameter_o(GLenum param); |
|
|
| |
| |
| |
| |
| char *emscripten_webgl_get_parameter_utf8(GLenum param); |
|
|
| |
| |
| |
| void emscripten_webgl_get_parameter_i64v(GLenum param, GLint64 * _Nonnull dst); |
|
|
| #undef GLint |
| #undef GLenum |
| #undef GLint64 |
|
|
| #ifdef __cplusplus |
| } |
| #endif |
|
|