Initial work

This commit is contained in:
Simon Fels 2016-05-26 22:38:57 +02:00 • committed by Simon Fels
commit 3222551702
374 changed files with 40290 additions and 0 deletions

View file

@ -0,0 +1,14 @@
LOCAL_PATH := $(call my-dir)
### host library ##########################################
$(call emugl-begin-host-static-library,libOpenGLESDispatch)
$(call emugl-import,libGLESv2_dec libGLESv1_dec)
# use Translator's egl headers
LOCAL_C_INCLUDES += $(EMUGL_PATH)/host/libs/Translator/include
LOCAL_C_INCLUDES += $(EMUGL_PATH)/shared
LOCAL_SRC_FILES := EGLDispatch.cpp \
GLESv2Dispatch.cpp \
GLESv1Dispatch.cpp
$(call emugl-end-module)

View file

@ -0,0 +1,10 @@
set(SOURCES
EGLDispatch.cpp
GLESv2Dispatch.cpp
GLESv1Dispatch.cpp)
add_library(OpenGLESDispatch ${SOURCES} ${GENERATED_SOURCES})
target_link_libraries(OpenGLESDispatch
emugl_common
GLESv2_dec
GLESv1_dec)

View file

@ -0,0 +1,52 @@
/*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "OpenGLESDispatch/EGLDispatch.h"
#include "emugl/common/shared_library.h"
#include <stdio.h>
#include <stdlib.h>
EGLDispatch s_egl;
#define DEFAULT_EGL_LIB EMUGL_LIBNAME("EGL_translator")
#define RENDER_EGL_LOAD_FIELD(return_type, function_name, signature) \
s_egl. function_name = (function_name ## _t) lib->findSymbol(#function_name);
#define RENDER_EGL_LOAD_OPTIONAL_FIELD(return_type, function_name, signature) \
if (s_egl.eglGetProcAddress) s_egl. function_name = \
(function_name ## _t) s_egl.eglGetProcAddress(#function_name); \
if (!s_egl.function_name || !s_egl.eglGetProcAddress) \
RENDER_EGL_LOAD_FIELD(return_type, function_name, signature)
bool init_egl_dispatch()
{
const char *libName = getenv("ANDROID_EGL_LIB");
if (!libName) libName = DEFAULT_EGL_LIB;
char error[256];
emugl::SharedLibrary *lib = emugl::SharedLibrary::open(libName, error, sizeof(error));
if (!lib) {
printf("Failed to open %s: [%s]\n", libName, error);
return NULL;
}
LIST_RENDER_EGL_FUNCTIONS(RENDER_EGL_LOAD_FIELD)
LIST_RENDER_EGL_EXTENSIONS_FUNCTIONS(RENDER_EGL_LOAD_OPTIONAL_FIELD)
return true;
}

View file

@ -0,0 +1,95 @@
/*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "OpenGLESDispatch/GLESv1Dispatch.h"
#include "OpenGLESDispatch/EGLDispatch.h"
#include <stdio.h>
#include <stdlib.h>
#include "emugl/common/shared_library.h"
extern EGLDispatch s_egl;
static emugl::SharedLibrary *s_gles1_lib = NULL;
// An unimplemented function which prints out an error message.
// To make it consistent with the guest, all GLES1 functions not supported by
// the driver should be redirected to this function.
static void gles1_unimplemented() {
fprintf(stderr, "Called unimplemented GLESv1 API\n");
}
//
// This function is called only once during initialiation before
// any thread has been created - hence it should NOT be thread safe.
//
#define DEFAULT_GLES_CM_LIB EMUGL_LIBNAME("GLES_CM_translator")
bool gles1_dispatch_init(GLESv1Dispatch* dispatch_table) {
const char* libName = getenv("ANDROID_GLESv1_LIB");
if (!libName) {
libName = DEFAULT_GLES_CM_LIB;
}
char error[256];
s_gles1_lib = emugl::SharedLibrary::open(libName, error, sizeof(error));
if (!s_gles1_lib) {
fprintf(stderr, "%s: Could not load %s [%s]\n", __FUNCTION__,
libName, error);
return false;
}
//
// init the GLES dispatch table
//
#define LOOKUP_SYMBOL(return_type,function_name,signature,callargs) \
dispatch_table-> function_name = reinterpret_cast< function_name ## _t >( \
s_gles1_lib->findSymbol(#function_name));
#define LOOKUP_EXT_SYMBOL(return_type,function_name,signature,callargs) \
dispatch_table-> function_name = reinterpret_cast< function_name ## _t >( \
s_egl.eglGetProcAddress(#function_name));
LIST_GLES1_FUNCTIONS(LOOKUP_SYMBOL,LOOKUP_EXT_SYMBOL)
return true;
}
//
// This function is called only during initialization of the decoder before
// any thread has been created - hence it should NOT be thread safe.
//
void *gles1_dispatch_get_proc_func(const char *name, void *userData)
{
void* func = NULL;
if (s_gles1_lib && !func) {
func = (void *)s_gles1_lib->findSymbol(name);
}
if (!func) {
func = (void *)s_egl.eglGetProcAddress(name);
}
// To make it consistent with the guest, redirect any unsupported functions
// to gles1_unimplemented.
if (!func) {
fprintf(stderr, "ERROR: Failed to find symbol for %s\n", name);
func = (void *)gles1_unimplemented;
}
return func;
}

View file

@ -0,0 +1,95 @@
/*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "OpenGLESDispatch/GLESv2Dispatch.h"
#include "OpenGLESDispatch/EGLDispatch.h"
#include <stdio.h>
#include <stdlib.h>
#include "emugl/common/shared_library.h"
extern EGLDispatch s_egl;
static emugl::SharedLibrary *s_gles2_lib = NULL;
#define DEFAULT_GLES_V2_LIB EMUGL_LIBNAME("GLES_V2_translator")
// An unimplemented function which prints out an error message.
// To make it consistent with the guest, all GLES2 functions not supported by
// the driver should be redirected to this function.
static void gles2_unimplemented() {
fprintf(stderr, "Called unimplemented GLESv2 API\n");
}
//
// This function is called only once during initialiation before
// any thread has been created - hence it should NOT be thread safe.
//
bool gles2_dispatch_init(GLESv2Dispatch* dispatch_table)
{
const char *libName = getenv("ANDROID_GLESv2_LIB");
if (!libName) {
libName = DEFAULT_GLES_V2_LIB;
}
char error[256];
s_gles2_lib = emugl::SharedLibrary::open(libName, error, sizeof(error));
if (!s_gles2_lib) {
fprintf(stderr, "%s: Could not load %s [%s]\n", __FUNCTION__,
libName, error);
return false;
}
//
// init the GLES dispatch table
//
#define LOOKUP_SYMBOL(return_type,function_name,signature,callargs) \
dispatch_table-> function_name = reinterpret_cast< function_name ## _t >( \
s_gles2_lib->findSymbol(#function_name));
#define LOOKUP_EXT_SYMBOL(return_type,function_name,signature,callargs) \
dispatch_table-> function_name = reinterpret_cast< function_name ## _t >( \
s_egl.eglGetProcAddress(#function_name));
LIST_GLES2_FUNCTIONS(LOOKUP_SYMBOL,LOOKUP_EXT_SYMBOL)
return true;
}
//
// This function is called only during initialization before
// any thread has been created - hence it should NOT be thread safe.
//
void *gles2_dispatch_get_proc_func(const char *name, void *userData)
{
void* func = NULL;
if (s_gles2_lib && !func) {
func = (void *)s_gles2_lib->findSymbol(name);
}
if (!func) {
func = (void *)s_egl.eglGetProcAddress(name);
}
// To make it consistent with the guest, redirect any unsupported functions
// to gles2_unimplemented.
if (!func) {
func = (void *)gles2_unimplemented;
}
return func;
}

View file

@ -0,0 +1,13 @@
!gles1_extensions
# OpenGL functions which are needed ONLY for implementing GLES 1.1 EXTENSIONS
void glCurrentPaletteMatrixARB(GLint index);
void glMatrixIndexuivARB(GLint size, GLuint * indices);
void glMatrixIndexPointerARB(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
void glWeightPointerARB(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
void glTexGenf(GLenum coord, GLenum pname, GLfloat param );
void glTexGeni(GLenum coord, GLenum pname, GLint param );
void glTexGenfv(GLenum coord, GLenum pname, const GLfloat *params );
void glTexGeniv(GLenum coord, GLenum pname, const GLint *params );
void glGetTexGenfv(GLenum coord, GLenum pname, GLfloat *params );
void glGetTexGeniv(GLenum coord, GLenum pname, GLint *params );

View file

@ -0,0 +1,65 @@
!gles1_only
# OpenGL functions which are needed ONLY for implementing GLES 1.1
void glAlphaFunc(GLenum func, GLclampf ref);
void glBegin( GLenum mode );
void glClientActiveTexture( GLenum texture );
void glClipPlane(GLenum plane, const GLdouble *equation);
void glColor4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
void glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
void glColor4fv( const GLfloat *v );
void glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
void glColor4ubv( const GLubyte *v );
void glColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
void glDisableClientState(GLenum array);
void glEnableClientState(GLenum array);
void glEnd(void);
void glFogf(GLenum pname, GLfloat param);
void glFogfv(GLenum pname, const GLfloat *params);
void glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
void glGetClipPlane(GLenum plane, GLdouble *equation);
void glGetDoublev( GLenum pname, GLdouble *params );
void glGetLightfv(GLenum light, GLenum pname, GLfloat *params);
void glGetMaterialfv(GLenum face, GLenum pname, GLfloat *params);
void glGetPointerv(GLenum pname, GLvoid* *params);
void glGetTexEnvfv(GLenum target, GLenum pname, GLfloat *params);
void glGetTexEnviv(GLenum target, GLenum pname, GLint *params);
void glLightf(GLenum light, GLenum pname, GLfloat param);
void glLightfv(GLenum light, GLenum pname, const GLfloat *params);
void glLightModelf(GLenum pname, GLfloat param);
void glLightModelfv(GLenum pname, const GLfloat *params);
void glLoadIdentity(void);
void glLoadMatrixf(const GLfloat *m);
void glLogicOp(GLenum opcode);
void glMaterialf(GLenum face, GLenum pname, GLfloat param);
void glMaterialfv(GLenum face, GLenum pname, const GLfloat *params);
void glMultiTexCoord2fv( GLenum target, const GLfloat *v );
void glMultiTexCoord2sv( GLenum target, const GLshort *v );
void glMultiTexCoord3fv( GLenum target, const GLfloat *v );
void glMultiTexCoord3sv( GLenum target, const GLshort *v );
void glMultiTexCoord4f( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q );
void glMultiTexCoord4fv( GLenum target, const GLfloat *v );
void glMultiTexCoord4sv( GLenum target, const GLshort *v );
void glMultMatrixf(const GLfloat *m);
void glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz);
void glNormal3fv( const GLfloat *v );
void glNormal3sv( const GLshort *v );
void glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
void glPointParameterf(GLenum param, GLfloat value);
void glPointParameterfv(GLenum param, const GLfloat *values);
void glPointSize(GLfloat size);
void glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
void glScalef(GLfloat x, GLfloat y, GLfloat z);
void glTexEnvf(GLenum target, GLenum pname, GLfloat param);
void glTexEnvfv(GLenum target, GLenum pname, const GLfloat *params);
void glMatrixMode(GLenum mode);
void glNormalPointer(GLenum type, GLsizei stride, const GLvoid *pointer);
void glPopMatrix(void);
void glPushMatrix(void);
void glShadeModel(GLenum mode);
void glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
void glTexEnvi(GLenum target, GLenum pname, GLint param);
void glTexEnviv(GLenum target, GLenum pname, const GLint *params);
void glTranslatef(GLfloat x, GLfloat y, GLfloat z);
void glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);

View file

@ -0,0 +1,6 @@
!gles2_extensions
# GLES 2.0 extensions
void glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
void glReleaseShaderCompiler(void);
void glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);

View file

@ -0,0 +1,80 @@
!gles2_only
# OpenGL functions which are needed ONLY for implementing GLES 2.0
void glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
void glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
void glStencilMaskSeparate(GLenum face, GLuint mask);
GLboolean glIsProgram(GLuint program);
GLboolean glIsShader(GLuint shader);
void glVertexAttrib1f(GLuint indx, GLfloat x);
void glVertexAttrib1fv(GLuint indx, const GLfloat* values);
void glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
void glVertexAttrib2fv(GLuint indx, const GLfloat* values);
void glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
void glVertexAttrib3fv(GLuint indx, const GLfloat* values);
void glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
void glVertexAttrib4fv(GLuint indx, const GLfloat* values);
void glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);
void glDisableVertexAttribArray(GLuint index);
void glEnableVertexAttribArray(GLuint index);
void glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params);
void glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params);
void glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** pointer);
void glUniform1f(GLint location, GLfloat x);
void glUniform1fv(GLint location, GLsizei count, const GLfloat* v);
void glUniform1i(GLint location, GLint x);
void glUniform1iv(GLint location, GLsizei count, const GLint* v);
void glUniform2f(GLint location, GLfloat x, GLfloat y);
void glUniform2fv(GLint location, GLsizei count, const GLfloat* v);
void glUniform2i(GLint location, GLint x, GLint y);
void glUniform2iv(GLint location, GLsizei count, const GLint* v);
void glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z);
void glUniform3fv(GLint location, GLsizei count, const GLfloat* v);
void glUniform3i(GLint location, GLint x, GLint y, GLint z);
void glUniform3iv(GLint location, GLsizei count, const GLint* v);
void glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
void glUniform4fv(GLint location, GLsizei count, const GLfloat* v);
void glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w);
void glUniform4iv(GLint location, GLsizei count, const GLint* v);
void glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
void glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
void glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
void glAttachShader(GLuint program, GLuint shader);
void glBindAttribLocation(GLuint program, GLuint index, const GLchar* name);
void glCompileShader(GLuint shader);
GLuint glCreateProgram(void);
GLuint glCreateShader(GLenum type);
void glDeleteProgram(GLuint program);
void glDeleteShader(GLuint shader);
void glDetachShader(GLuint program, GLuint shader);
void glLinkProgram(GLuint program);
void glUseProgram(GLuint program);
void glValidateProgram(GLuint program);
void glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
void glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
void glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
int glGetAttribLocation(GLuint program, const GLchar* name);
void glGetProgramiv(GLuint program, GLenum pname, GLint* params);
void glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);
void glGetShaderiv(GLuint shader, GLenum pname, GLint* params);
void glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog);
void glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
void glGetUniformfv(GLuint program, GLint location, GLfloat* params);
void glGetUniformiv(GLuint program, GLint location, GLint* params);
int glGetUniformLocation(GLuint program, const GLchar* name);
void glShaderSource(GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length);
# The following are not used by GLDispatch but by GLESv2Dispatch
void glBindFramebuffer(GLenum target, GLuint framebuffer);
void glGenFramebuffers(GLsizei n, GLuint* framebuffers);
void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
GLenum glCheckFramebufferStatus(GLenum target);
void glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers);
GLboolean glIsRenderbuffer(GLuint renderbuffer);
void glBindRenderbuffer(GLenum target, GLuint renderbuffer);
void glDeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers);
void glGenRenderbuffers(GLsizei n, GLuint *renderbuffers);
void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint *params);
void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);

View file

@ -0,0 +1,18 @@
!gles3_only
# GLES 3.x functions required by the translator library.
# Right now, this is only use to get glGetStringi() from the host GL library
# in order to deal with the fact that glGetString(GL_EXTENSIONS) is obsolete
# in OpenGL 3.0, and some drivers don't implement it anymore (i.e. the
# function just returns NULL).
%#include <GLES/gl.h>
%
%// Used to avoid adding GLES3/gl3.h to our headers.
%#ifndef GL_NUM_EXTENSIONS
%#define GL_NUM_EXTENSIONS 0x821D
%#endif
%typedef const GLubyte* GLconstubyteptr;
GLconstubyteptr glGetStringi(GLenum name, GLint index);

View file

@ -0,0 +1,74 @@
!gles_common
# Functions common to both GLES 1.x and 2.0
%#include <GLES/gl.h>
%// Return types must be single words, see GLDispatch.cpp
%typedef const GLubyte* GLconstubyteptr;
void glActiveTexture( GLenum texture );
void glBindBuffer(GLenum target, GLuint buffer);
void glBindTexture(GLenum target, GLuint texture);
void glBlendFunc(GLenum sfactor, GLenum dfactor);
void glBlendEquation( GLenum mode );
void glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
void glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
void glBufferData(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
void glClear(GLbitfield mask);
void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
void glClearDepth(GLclampd depth);
void glClearStencil(GLint s);
void glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
void glCompressedTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data );
void glCompressedTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data );
void glCopyTexImage2D(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
void glCullFace(GLenum mode);
void glDeleteBuffers(GLsizei n, const GLuint *buffers);
void glDeleteTextures(GLsizei n, const GLuint *textures);
void glDepthFunc(GLenum func);
void glDepthMask(GLboolean flag);
void glDepthRange(GLclampd zNear, GLclampd zFar);
void glDisable(GLenum cap);
void glDrawArrays(GLenum mode, GLint first, GLsizei count);
void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
void glEnable(GLenum cap);
void glFinish(void);
void glFlush(void);
void glFrontFace(GLenum mode);
void glGenBuffers(GLsizei n, GLuint *buffers);
void glGenTextures(GLsizei n, GLuint *textures);
void glGetBooleanv(GLenum pname, GLboolean *params);
void glGetBufferParameteriv(GLenum buffer, GLenum parameter, GLint *value);
GLenum glGetError(void);
void glGetFloatv(GLenum pname, GLfloat *params);
void glGetIntegerv(GLenum pname, GLint *params);
GLconstubyteptr glGetString(GLenum name);
void glTexParameterf(GLenum target, GLenum pname, GLfloat param);
void glTexParameterfv(GLenum target, GLenum pname, const GLfloat *params);
void glGetTexParameterfv(GLenum target, GLenum pname, GLfloat *params);
void glGetTexParameteriv(GLenum target, GLenum pname, GLint *params);
void glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params);
void glHint(GLenum target, GLenum mode);
GLboolean glIsBuffer(GLuint buffer);
GLboolean glIsEnabled(GLenum cap);
GLboolean glIsTexture(GLuint texture);
void glLineWidth(GLfloat width);
void glPolygonOffset(GLfloat factor, GLfloat units);
void glPixelStorei(GLenum pname, GLint param);
void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
void glSampleCoverage( GLclampf value, GLboolean invert );
void glScissor(GLint x, GLint y, GLsizei width, GLsizei height);
void glStencilFunc(GLenum func, GLint ref, GLuint mask);
void glStencilMask(GLuint mask);
void glStencilOp(GLenum fail, GLenum zfail, GLenum zpass);
void glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
void glTexParameteri(GLenum target, GLenum pname, GLint param);
void glTexParameteriv(GLenum target, GLenum pname, const GLint *params);
void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
void glPushAttrib( GLbitfield mask );
void glPushClientAttrib( GLbitfield mask );
void glPopAttrib( void );
void glPopClientAttrib( void );

View file

@ -0,0 +1,24 @@
!gles_extensions
# Common GLES 1.x / 2.0 extension functions
GLboolean glIsRenderbufferEXT(GLuint renderbuffer);
void glBindRenderbufferEXT(GLenum target, GLuint renderbuffer);
void glDeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers);
void glGenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers);
void glRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
void glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params);
GLboolean glIsFramebufferEXT(GLuint framebuffer);
void glBindFramebufferEXT(GLenum target, GLuint framebuffer);
void glDeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers);
void glGenFramebuffersEXT(GLsizei n, GLuint *framebuffers);
GLenum glCheckFramebufferStatusEXT(GLenum target);
void glFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
void glFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
void glFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
void glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
void glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint *params);
void glGenerateMipmapEXT(GLenum target);
# The following extensions are used by GLESv1Dispatch and GLESv2Dispatch, but not by GLDispatch
void glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image);
void glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image);

View file

@ -0,0 +1,26 @@
# The list of EGL functions used by libOpenglRender, without extensions.
# This is only a subset of the full EGL API.
!Render_EGL
%#include <EGL/egl.h>
EGLint eglGetError(void);
EGLDisplay eglGetDisplay(EGLNativeDisplayType dpy);
EGLBoolean eglInitialize(EGLDisplay dpy, EGLint* major, EGLint* minor);
char* eglQueryString(EGLDisplay dpy, EGLint id);
EGLBoolean eglGetConfigs(EGLDisplay display, EGLConfig* configs, EGLint config_size, EGLint* num_config);
EGLBoolean eglChooseConfig(EGLDisplay display, const EGLint* attribs, EGLConfig* configs, EGLint config_size, EGLint* num_config);
EGLBoolean eglGetConfigAttrib(EGLDisplay display, EGLConfig config, EGLint attribute, EGLint* value);
EGLSurface eglCreateWindowSurface(EGLDisplay display, EGLConfig config, EGLNativeWindowType native_window, const EGLint* attrib_list);
EGLSurface eglCreatePbufferSurface(EGLDisplay display, EGLConfig config, const EGLint* attrib_list);
EGLBoolean eglDestroySurface(EGLDisplay display, EGLSurface surface);
EGLBoolean eglBindAPI(EGLenum api);
EGLenum eglQueryAPI(void);
EGLBoolean eglReleaseThread(void);
EGLContext eglCreateContext(EGLDisplay display, EGLConfig config, EGLContext share_context, const EGLint* attrib_list);
EGLBoolean eglDestroyContext(EGLDisplay display, EGLContext context);
EGLBoolean eglMakeCurrent(EGLDisplay display, EGLSurface draw, EGLSurface read, EGLContext context);
EGLContext eglGetCurrentContext(void);
EGLSurface eglGetCurrentSurface(EGLint readdraw);
EGLBoolean eglSwapBuffers(EGLDisplay display, EGLSurface surface);
void* eglGetProcAddress(const char* function_name);

View file

@ -0,0 +1,11 @@
# The list of EGL extension functions used by libOpenglRender.
# This is only a subset of the full EGL API.
!Render_EGL_extensions
%#include <EGL/egl.h>
%#define EGL_EGLEXT_PROTOTYPES
%#include <EGL/eglext.h>
EGLImageKHR eglCreateImageKHR(EGLDisplay display, EGLContext context, EGLenum target, EGLClientBuffer buffer, const EGLint* attrib_list);
EGLBoolean eglDestroyImageKHR(EGLDisplay display, EGLImageKHR image);