Finish adding native bindings for GLES3 methods
This commit is contained in:
@@ -33,11 +33,11 @@ namespace lime {
|
||||
|
||||
std::map<GLObjectType, std::map <GLuint, value> > glObjects;
|
||||
std::map<value, GLuint> glObjectIDs;
|
||||
std::map<value, uintptr_t> glObjectPtrs;
|
||||
std::map<value, void*> glObjectPtrs;
|
||||
std::map<value, GLObjectType> glObjectTypes;
|
||||
|
||||
std::vector<GLuint> gc_gl_id;
|
||||
std::vector<uintptr_t> gc_gl_ptr;
|
||||
std::vector<void*> gc_gl_ptr;
|
||||
std::vector<GLObjectType> gc_gl_type;
|
||||
Mutex gc_gl_mutex;
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace lime {
|
||||
|
||||
} else {
|
||||
|
||||
uintptr_t ptr = glObjectPtrs[object];
|
||||
void* ptr = glObjectPtrs[object];
|
||||
|
||||
gc_gl_ptr.push_back (ptr);
|
||||
|
||||
@@ -147,7 +147,7 @@ namespace lime {
|
||||
}
|
||||
|
||||
size = gc_gl_ptr.size ();
|
||||
uintptr_t ptr;
|
||||
void* ptr;
|
||||
|
||||
for (int i = 0; i < size; i++) {
|
||||
|
||||
@@ -373,10 +373,10 @@ namespace lime {
|
||||
}
|
||||
|
||||
|
||||
int lime_gl_client_wait_sync (double sync, int flags, int timeoutA, int timeoutB) {
|
||||
int lime_gl_client_wait_sync (value sync, int flags, int timeoutA, int timeoutB) {
|
||||
|
||||
GLuint64 timeout = (GLuint64) timeoutA << 32 | timeoutB;
|
||||
return glClientWaitSync ((GLsync)(uintptr_t)sync, flags, timeout);
|
||||
return glClientWaitSync ((GLsync)val_data (sync), flags, timeout);
|
||||
|
||||
}
|
||||
|
||||
@@ -618,9 +618,10 @@ namespace lime {
|
||||
}
|
||||
|
||||
|
||||
void lime_gl_delete_sync (double sync) {
|
||||
void lime_gl_delete_sync (value sync) {
|
||||
|
||||
glDeleteSync ((GLsync)(uintptr_t)sync);
|
||||
if (val_is_null (sync)) return;
|
||||
glDeleteSync ((GLsync)val_data (sync));
|
||||
|
||||
}
|
||||
|
||||
@@ -774,7 +775,9 @@ namespace lime {
|
||||
value lime_gl_fence_sync (int condition, int flags) {
|
||||
|
||||
GLsync result = glFenceSync (condition, flags);
|
||||
return CFFIPointer (result, gc_gl_object);
|
||||
value handle = CFFIPointer (result, gc_gl_object);
|
||||
glObjectPtrs[handle] = result;
|
||||
return handle;
|
||||
|
||||
}
|
||||
|
||||
@@ -1135,7 +1138,7 @@ namespace lime {
|
||||
}
|
||||
|
||||
|
||||
void lime_gl_get_internal_formativ (int target, int internalformat, int pname, int bufSize, double params) {
|
||||
void lime_gl_get_internalformativ (int target, int internalformat, int pname, int bufSize, double params) {
|
||||
|
||||
glGetInternalformativ (target, internalformat, pname, (GLsizei)bufSize, (GLint*)(uintptr_t)params);
|
||||
|
||||
@@ -1707,9 +1710,10 @@ namespace lime {
|
||||
}
|
||||
|
||||
|
||||
bool lime_gl_is_sync (double handle) {
|
||||
bool lime_gl_is_sync (value handle) {
|
||||
|
||||
return glIsSync ((GLsync)(uintptr_t)handle);
|
||||
if (val_is_null (handle)) return false;
|
||||
return glIsSync ((GLsync)val_data (handle));
|
||||
|
||||
}
|
||||
|
||||
@@ -1749,9 +1753,10 @@ namespace lime {
|
||||
}
|
||||
|
||||
|
||||
void lime_gl_map_buffer_range (int target, double offset, int length, int access) {
|
||||
double lime_gl_map_buffer_range (int target, double offset, int length, int access) {
|
||||
|
||||
glMapBufferRange (target, (GLintptr)(uintptr_t)offset, length, access);
|
||||
uintptr_t result = glMapBufferRange (target, (GLintptr)(uintptr_t)offset, length, access);
|
||||
return (double)result;
|
||||
|
||||
}
|
||||
|
||||
@@ -2430,10 +2435,10 @@ namespace lime {
|
||||
}
|
||||
|
||||
|
||||
void lime_gl_wait_sync (double sync, int flags, int timeoutA, int timeoutB) {
|
||||
void lime_gl_wait_sync (value sync, int flags, int timeoutA, int timeoutB) {
|
||||
|
||||
GLuint64 timeout = (GLuint64) timeoutA << 32 | timeoutB;
|
||||
glWaitSync ((GLsync)(uintptr_t)sync, flags, timeout);
|
||||
glWaitSync ((GLsync)val_data (sync), flags, timeout);
|
||||
|
||||
}
|
||||
|
||||
@@ -2594,7 +2599,7 @@ namespace lime {
|
||||
DEFINE_PRIME2v (lime_gl_get_integer64v);
|
||||
DEFINE_PRIME3v (lime_gl_get_integer64i_v);
|
||||
DEFINE_PRIME3v (lime_gl_get_integeri_v);
|
||||
DEFINE_PRIME5v (lime_gl_get_internal_formativ);
|
||||
DEFINE_PRIME5v (lime_gl_get_internalformativ);
|
||||
DEFINE_PRIME2 (lime_gl_get_programi);
|
||||
DEFINE_PRIME3v (lime_gl_get_programiv);
|
||||
DEFINE_PRIME3v (lime_gl_get_program_binary);
|
||||
@@ -2657,7 +2662,7 @@ namespace lime {
|
||||
DEFINE_PRIME1 (lime_gl_is_vertex_array);
|
||||
DEFINE_PRIME1v (lime_gl_line_width);
|
||||
DEFINE_PRIME1v (lime_gl_link_program);
|
||||
DEFINE_PRIME4v (lime_gl_map_buffer_range);
|
||||
DEFINE_PRIME4 (lime_gl_map_buffer_range);
|
||||
DEFINE_PRIME1v (lime_gl_object_deregister);
|
||||
DEFINE_PRIME2 (lime_gl_object_from_id);
|
||||
DEFINE_PRIME3v (lime_gl_object_register);
|
||||
|
||||
@@ -301,6 +301,110 @@ OGL_EXT(glGetTexParameteriv,void,(GLenum target, GLenum pname, GLint * params)
|
||||
OGL_EXT(glIsTexture, GLboolean, ( GLuint texture) );
|
||||
OGL_EXT(glIsEnabled, GLboolean, ( GLuint texture) );
|
||||
|
||||
OGL_EXT(glBeginQuery, void, (GLenum target, GLuint id));
|
||||
OGL_EXT(glBeginTransformFeedback, void, (GLenum primitiveMode));
|
||||
OGL_EXT(glEndTransformFeedback, void, (void));
|
||||
OGL_EXT(glBindBufferBase, void, (GLenum target, GLuint index, GLuint buffer));
|
||||
OGL_EXT(glBindBufferRange, void, (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size));
|
||||
OGL_EXT(glBindVertexArray, void, (GLuint array));
|
||||
OGL_EXT(glBlitFramebuffer, void, (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter));
|
||||
OGL_EXT(glClearBufferiv, void, (GLenum buffer, GLint drawbuffer, const GLint * value));
|
||||
OGL_EXT(glClearBufferuiv, void, (GLenum buffer, GLint drawbuffer, const GLuint * value));
|
||||
OGL_EXT(glClearBufferfv, void, (GLenum buffer, GLint drawbuffer, const GLfloat * value));
|
||||
OGL_EXT(glClearBufferfi, void, (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil));
|
||||
OGL_EXT(glClientWaitSync, GLenum, (GLsync sync, GLbitfield flags, GLuint64 timeout));
|
||||
OGL_EXT(glCompressedTexImage3D, void, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data));
|
||||
OGL_EXT(glCompressedTexSubImage3D, void, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data));
|
||||
OGL_EXT(glCopyTexSubImage3D, void, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height));
|
||||
OGL_EXT(glGenQueries, void, (GLsizei n, GLuint * ids));
|
||||
OGL_EXT(glGenSamplers, void, (GLsizei n, GLuint *samplers));
|
||||
OGL_EXT(glGenTransformFeedbacks, void, (GLsizei n, GLuint *ids));
|
||||
OGL_EXT(glGenVertexArrays, void, (GLsizei n, GLuint *arrays));
|
||||
OGL_EXT(glDeleteTransformFeedbacks, void, (GLsizei n, const GLuint *ids));
|
||||
OGL_EXT(glDrawArraysInstanced, void, (GLenum mode, GLint first, GLsizei count, GLsizei primcount));
|
||||
OGL_EXT(glDrawRangeElements, void, (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices));
|
||||
OGL_EXT(glEndQuery, void, (GLenum target));
|
||||
OGL_EXT(glGetActiveUniformBlockiv, void, (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params));
|
||||
OGL_EXT(glGetActiveUniformsiv, void, (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params));
|
||||
OGL_EXT(glGetBufferPointerv, void, (GLenum target, GLenum pname, GLvoid ** params));
|
||||
OGL_EXT(glGetBufferSubData, void, (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data));
|
||||
OGL_EXT(glGetInteger64v, void, (GLenum pname, GLint64 * params));
|
||||
OGL_EXT(glGetInteger64i_v, void, (GLenum pname, GLuint index, GLint64 * data));
|
||||
OGL_EXT(glGetInternalformativ, void, (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params));
|
||||
OGL_EXT(glGetProgramBinary, void, (GLuint program, GLsizei bufsize, GLsizei *length, GLenum *binaryFormat, void *binary));
|
||||
OGL_EXT(glGetQueryiv, void, (GLenum target, GLenum pname, GLint * params));
|
||||
OGL_EXT(glGetQueryObjectiv, void, (GLuint id, GLenum pname, GLint * params));
|
||||
OGL_EXT(glGetQueryObjectuiv, void, (GLuint id, GLenum pname, GLuint * params));
|
||||
OGL_EXT(glGetSamplerParameterfv, void, (GLuint sampler, GLenum pname, GLfloat * params));
|
||||
OGL_EXT(glGetSamplerParameteriv, void, (GLuint sampler, GLenum pname, GLint * params));
|
||||
OGL_EXT(glGetTransformFeedbackVarying, void, (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, char *name));
|
||||
OGL_EXT(glGetUniformuiv, void, (GLuint program, GLint location, GLuint *params));
|
||||
OGL_EXT(glGetUniformBlockIndex, GLuint, (GLuint program, const GLchar *uniformBlockName));
|
||||
OGL_EXT(glGetVertexAttribIiv, void, (GLuint index, GLenum pname, GLint *params));
|
||||
OGL_EXT(glGetVertexAttribIuiv, void, (GLuint index, GLenum pname, GLuint *params));
|
||||
OGL_EXT(glMapBufferRange, void*, (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access));
|
||||
OGL_EXT(glPauseTransformFeedback, void, ());
|
||||
OGL_EXT(glProgramBinary, void, (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length));
|
||||
OGL_EXT(glProgramParameteri, void, (GLuint program, GLenum pname, GLint value));
|
||||
OGL_EXT(glReadBuffer, void, (GLenum mode));
|
||||
OGL_EXT(glReleaseShaderCompiler, void, (void));
|
||||
OGL_EXT(glRenderbufferStorageMultisample, void, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height));
|
||||
OGL_EXT(glResumeTransformFeedback, void, (void));
|
||||
OGL_EXT(glSamplerParameterf, void, (GLuint sampler, GLenum pname, GLfloat param));
|
||||
OGL_EXT(glSamplerParameteri, void, (GLuint sampler, GLenum pname, GLint param));
|
||||
OGL_EXT(glTexStorage2D, void, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height));
|
||||
OGL_EXT(glTexStorage3D, void, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth));
|
||||
OGL_EXT(glUniform1ui, void, (GLint location, GLuint v0));
|
||||
OGL_EXT(glUniform2ui, void, (GLint location, GLuint v0, GLuint v1));
|
||||
OGL_EXT(glUniform3ui, void, (GLint location, GLuint v0, GLuint v1, GLuint v2));
|
||||
OGL_EXT(glUniform4ui, void, (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3));
|
||||
OGL_EXT(glUniform1uiv, void, (GLint location, GLsizei count, const GLuint *value));
|
||||
OGL_EXT(glUniform2uiv, void, (GLint location, GLsizei count, const GLuint *value));
|
||||
OGL_EXT(glUniform3uiv, void, (GLint location, GLsizei count, const GLuint *value));
|
||||
OGL_EXT(glUniform4uiv, void, (GLint location, GLsizei count, const GLuint *value));
|
||||
OGL_EXT(glUniformBlockBinding, void, (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding));
|
||||
OGL_EXT(glUniformMatrix2x3fv, void, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value));
|
||||
OGL_EXT(glUniformMatrix3x2fv, void, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value));
|
||||
OGL_EXT(glUniformMatrix2x4fv, void, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value));
|
||||
OGL_EXT(glUniformMatrix4x2fv, void, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value));
|
||||
OGL_EXT(glUniformMatrix3x4fv, void, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value));
|
||||
OGL_EXT(glUniformMatrix4x3fv, void, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value));
|
||||
OGL_EXT(glVertexAttribDivisor, void, (GLuint index, GLuint divisor));
|
||||
OGL_EXT(glVertexAttribIPointer, void, (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer));
|
||||
OGL_EXT(glVertexAttribI4i, void, (GLuint index, GLint v0, GLint v1, GLint v2, GLint v3));
|
||||
OGL_EXT(glVertexAttribI4iv, void, (GLuint index, const GLint *v));
|
||||
OGL_EXT(glVertexAttribI4uiv, void, (GLuint index, const GLuint *v));
|
||||
OGL_EXT(glWaitSync, void, (GLsync sync, GLbitfield flags, GLuint64 timeout));
|
||||
OGL_EXT(glDeleteSync, void, (GLsync sync));
|
||||
OGL_EXT(glDeleteQueries, void, (GLsizei n, const GLuint* ids));
|
||||
OGL_EXT(glDeleteSamplers, void, (GLsizei n, const GLuint* ids));
|
||||
OGL_EXT(glDeleteVertexArrays, void, (GLsizei n, const GLuint* ids));
|
||||
OGL_EXT(glIsQuery, GLboolean, (GLuint id));
|
||||
OGL_EXT(glIsSampler, GLboolean, (GLuint id));
|
||||
OGL_EXT(glIsVertexArray, GLboolean, (GLuint id));
|
||||
OGL_EXT(glBindSampler, void, (GLuint unit, GLuint sampler));
|
||||
OGL_EXT(glBindTransformFeedback, void, (GLenum target, GLuint id));
|
||||
OGL_EXT(glCopyBufferSubData, void, (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size));
|
||||
OGL_EXT(glDrawElementsInstanced, void, (GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei primcount));
|
||||
OGL_EXT(glFramebufferTextureLayer, void, (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer));
|
||||
OGL_EXT(glGetActiveUniformBlockName, void, (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName));
|
||||
OGL_EXT(glGetBufferParameteri64v, void, (GLenum target, GLenum value, GLint64 * data));
|
||||
OGL_EXT(glGetIntegeri_v, void, (GLenum target, GLuint index, GLint * data));
|
||||
OGL_EXT(glIsTransformFeedback, GLboolean, (GLuint id));
|
||||
OGL_EXT(glShaderBinary, void, (GLsizei n, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length));
|
||||
OGL_EXT(glTexImage3D, void, (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * data));
|
||||
OGL_EXT(glTexSubImage3D, void, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels));
|
||||
OGL_EXT(glTransformFeedbackVaryings, void, (GLuint program, GLsizei count, const char **varyings, GLenum bufferMode));
|
||||
OGL_EXT(glUnmapBuffer, GLboolean, (GLenum target));
|
||||
OGL_EXT(glVertexAttribI4ui, void, (GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3));
|
||||
OGL_EXT(glIsSync, GLboolean, (GLsync sync));
|
||||
OGL_EXT(glGetStringi, const GLubyte *, (GLenum name, GLuint index));
|
||||
OGL_EXT(glGetFragDataLocation, GLint, ( GLuint program, const char * name));
|
||||
OGL_EXT(glFenceSync, GLsync, (GLenum condition, GLbitfield flags));
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef NATIVE_TOOLKIT_SDL_ANGLE
|
||||
EGL_EXT(eglBindTexImage, EGLBoolean, (EGLDisplay dpy, EGLSurface surface, EGLint buffer));
|
||||
EGL_EXT(eglChooseConfig, EGLBoolean, (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config));
|
||||
|
||||
Reference in New Issue
Block a user