* commit '85f7ec006cdad4bacdc578068d5c670ea8f05403': emulator opengl: system GLESv1 first commit.
This commit is contained in:
@@ -155,27 +155,32 @@ int ApiGen::genEntryPoints(const std::string & filename, SideType side)
|
||||
fprintf(fp, "#include \"%s_%s_context.h\"\n", m_basename.c_str(), sideString(side));
|
||||
fprintf(fp, "\n");
|
||||
|
||||
fprintf(fp, "#ifndef GL_TRUE\n");
|
||||
fprintf(fp, "extern \"C\" {\n");
|
||||
|
||||
for (size_t i = 0; i < size(); i++) {
|
||||
fprintf(fp, "\t"); at(i).print(fp, false); fprintf(fp, ";\n");
|
||||
}
|
||||
fprintf(fp, "};\n\n");
|
||||
fprintf(fp, "#endif\n");
|
||||
|
||||
fprintf(fp, "#ifndef GET_CONTEXT\n");
|
||||
fprintf(fp, "static %s_%s_context_t::CONTEXT_ACCESSOR_TYPE *getCurrentContext = NULL;\n",
|
||||
m_basename.c_str(), sideString(side));
|
||||
|
||||
fprintf(fp,
|
||||
"void %s_%s_context_t::setContextAccessor(CONTEXT_ACCESSOR_TYPE *f) { getCurrentContext = f; }\n\n",
|
||||
"void %s_%s_context_t::setContextAccessor(CONTEXT_ACCESSOR_TYPE *f) { getCurrentContext = f; }\n",
|
||||
m_basename.c_str(), sideString(side));
|
||||
fprintf(fp, "#define GET_CONTEXT %s_%s_context_t * ctx = getCurrentContext() \n",
|
||||
m_basename.c_str(), sideString(side));
|
||||
fprintf(fp, "#endif\n\n");
|
||||
|
||||
|
||||
for (size_t i = 0; i < size(); i++) {
|
||||
EntryPoint *e = &at(i);
|
||||
e->print(fp);
|
||||
fprintf(fp, "{\n");
|
||||
fprintf(fp, "\t %s_%s_context_t * ctx = getCurrentContext(); \n",
|
||||
m_basename.c_str(), sideString(side));
|
||||
fprintf(fp, "\tGET_CONTEXT; \n");
|
||||
|
||||
bool shouldReturn = !e->retval().isVoid();
|
||||
bool shouldCallWithContext = (side == CLIENT_SIDE);
|
||||
|
||||
@@ -57,9 +57,10 @@ bool parseTypeField(const std::string & f, std::string *vartype, std::string *va
|
||||
case ST_TYPE:
|
||||
if (str == "const") {
|
||||
pos = last;
|
||||
*vartype = "const ";
|
||||
} else {
|
||||
// must be a type name;
|
||||
*vartype = str;
|
||||
*vartype += str;
|
||||
state = ST_NAME;
|
||||
pos = last;
|
||||
}
|
||||
|
||||
@@ -134,6 +134,8 @@ int TypeFactory::initFromFile(const std::string &filename)
|
||||
lc, name.c_str(), lc);
|
||||
}
|
||||
g_varMap.insert(std::pair<std::string, VarType>(name, VarType(g_typeId++, name, v ,printString,isPointer)));
|
||||
std::string constName = "const " + name;
|
||||
g_varMap.insert(std::pair<std::string, VarType>(constName, VarType(g_typeId++, constName, v ,printString,isPointer))); //add a const type
|
||||
}
|
||||
g_initialized = true;
|
||||
return 0;
|
||||
|
||||
@@ -70,7 +70,7 @@ void GLClientState::enable(int location, int state)
|
||||
m_states[location].enabled = state;
|
||||
}
|
||||
|
||||
void GLClientState::setState(int location, int size, GLenum type, GLboolean normalized, GLsizei stride, void *data)
|
||||
void GLClientState::setState(int location, int size, GLenum type, GLboolean normalized, GLsizei stride, const void *data)
|
||||
{
|
||||
if (!validLocation(location)) {
|
||||
return;
|
||||
@@ -78,7 +78,7 @@ void GLClientState::setState(int location, int size, GLenum type, GLboolean norm
|
||||
m_states[location].size = size;
|
||||
m_states[location].type = type;
|
||||
m_states[location].stride = stride;
|
||||
m_states[location].data = data;
|
||||
m_states[location].data = (void*)data;
|
||||
m_states[location].bufferObject = m_currentArrayVbo;
|
||||
m_states[location].elementSize = glSizeof(type) * size;
|
||||
m_states[location].normalized = normalized;
|
||||
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
GLuint currentArrayVbo() { return m_currentArrayVbo; }
|
||||
GLuint currentIndexVbo() { return m_currentIndexVbo; }
|
||||
void enable(int location, int state);
|
||||
void setState(int location, int size, GLenum type, GLboolean normalized, GLsizei stride, void *data);
|
||||
void setState(int location, int size, GLenum type, GLboolean normalized, GLsizei stride, const void *data);
|
||||
void setBufferObject(int location, GLuint id);
|
||||
const VertexAttribState *getState(int location);
|
||||
const VertexAttribState *getStateAndEnableDirty(int location, bool *enableChanged);
|
||||
|
||||
46
tools/emulator/opengl/system/GLESv1/Android.mk
Normal file
46
tools/emulator/opengl/system/GLESv1/Android.mk
Normal file
@@ -0,0 +1,46 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
emulatorOpengl := $(LOCAL_PATH)/../..
|
||||
|
||||
### EGL implementation ###########################################
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
# add additional depencies to ensure that the generated code that we depend on
|
||||
# is generated
|
||||
LOCAL_ADDITIONAL_DEPENDENCIES := \
|
||||
$(TARGET_OUT_SHARED_LIBRARIES)/lib_renderControl_enc$(TARGET_SHLIB_SUFFIX) \
|
||||
$(TARGET_OUT_SHARED_LIBRARIES)/libGLESv1_enc$(TARGET_SHLIB_SUFFIX)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
gl.cpp
|
||||
|
||||
|
||||
LOCAL_PRELINK_MODULE := false
|
||||
LOCAL_CFLAGS += -DLOG_TAG=\"GLES_emulation\"
|
||||
LOCAL_C_INCLUDES += \
|
||||
$(emulatorOpengl)/host/include/libOpenglRender \
|
||||
$(emulatorOpengl)/shared/OpenglCodecCommon \
|
||||
$(emulatorOpengl)/system/OpenglSystemCommon \
|
||||
$(emulatorOpengl)/system/GLESv1_enc \
|
||||
$(emulatorOpengl)/system/renderControl_enc \
|
||||
$(call intermediates-dir-for, SHARED_LIBRARIES, lib_renderControl_enc) \
|
||||
$(call intermediates-dir-for, SHARED_LIBRARIES, libGLESv1_enc)
|
||||
|
||||
LOCAL_MODULE_TAGS := debug
|
||||
LOCAL_MODULE := libGL_emulation
|
||||
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
|
||||
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := \
|
||||
libOpenglSystemCommon \
|
||||
libOpenglCodecCommon \
|
||||
libqemu
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libcutils \
|
||||
libutils \
|
||||
libdl \
|
||||
libGLESv1_enc \
|
||||
lib_renderControl_enc
|
||||
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
31
tools/emulator/opengl/system/GLESv1/gl.cpp
Normal file
31
tools/emulator/opengl/system/GLESv1/gl.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "EGLClientIface.h"
|
||||
#include "HostConnection.h"
|
||||
#include "GLEncoder.h"
|
||||
|
||||
|
||||
//XXX: fix this macro to get the context from fast tls path
|
||||
#define GET_CONTEXT gl_client_context_t * ctx = HostConnection::get()->glEncoder();
|
||||
|
||||
#include "gl_entry.cpp"
|
||||
|
||||
static EGLClient_eglInterface * s_egl = NULL;
|
||||
static EGLClient_glesInterface * s_gl = NULL;
|
||||
|
||||
void finish()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
EGLClient_glesInterface * init_emul_gles(EGLClient_eglInterface *eglIface)
|
||||
{
|
||||
s_egl = eglIface;
|
||||
|
||||
if (!s_gl) {
|
||||
s_gl = new EGLClient_glesInterface();
|
||||
s_gl->getProcAddress = NULL; //TODO: what goes here?
|
||||
s_gl->finish = finish;
|
||||
}
|
||||
|
||||
return s_gl;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ LOCAL_PRELINK_MODULE := false
|
||||
LOCAL_CFLAGS += -DLOG_TAG=\"egl_GLESv1_enc\"
|
||||
LOCAL_C_INCLUDES += \
|
||||
$(emulatorOpengl)/shared/OpenglCodecCommon \
|
||||
$(emulatorOpengl)/system/OpenglSystemCommon \
|
||||
$(emulatorOpengl)/host/include/libOpenglRender \
|
||||
$(glesv1_intermediates)
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ void GLEncoder::s_glFlush(void *self)
|
||||
ctx->m_stream->flush();
|
||||
}
|
||||
|
||||
GLubyte *GLEncoder::s_glGetString(void *self, GLenum name)
|
||||
const GLubyte *GLEncoder::s_glGetString(void *self, GLenum name)
|
||||
{
|
||||
GLubyte *retval = (GLubyte *) "";
|
||||
switch(name) {
|
||||
@@ -143,28 +143,28 @@ void GLEncoder::s_glPixelStorei(void *self, GLenum param, GLint value)
|
||||
ctx->m_state->setPixelStore(param, value);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glVertexPointer(void *self, int size, GLenum type, GLsizei stride, void *data)
|
||||
void GLEncoder::s_glVertexPointer(void *self, int size, GLenum type, GLsizei stride, const void *data)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
assert(ctx->m_state != NULL);
|
||||
ctx->m_state->setState(GLClientState::VERTEX_LOCATION, size, type, false, stride, data);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glNormalPointer(void *self, GLenum type, GLsizei stride, void *data)
|
||||
void GLEncoder::s_glNormalPointer(void *self, GLenum type, GLsizei stride, const void *data)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
assert(ctx->m_state != NULL);
|
||||
ctx->m_state->setState(GLClientState::NORMAL_LOCATION, 3, type, false, stride, data);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glColorPointer(void *self, int size, GLenum type, GLsizei stride, void *data)
|
||||
void GLEncoder::s_glColorPointer(void *self, int size, GLenum type, GLsizei stride, const void *data)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
assert(ctx->m_state != NULL);
|
||||
ctx->m_state->setState(GLClientState::COLOR_LOCATION, size, type, false, stride, data);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glPointsizePointer(void *self, GLenum type, GLsizei stride, void *data)
|
||||
void GLEncoder::s_glPointsizePointer(void *self, GLenum type, GLsizei stride, const void *data)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
assert(ctx->m_state != NULL);
|
||||
@@ -178,7 +178,7 @@ void GLEncoder::s_glClientActiveTexture(void *self, GLenum texture)
|
||||
ctx->m_state->setActiveTexture(texture - GL_TEXTURE0);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glTexcoordPointer(void *self, int size, GLenum type, GLsizei stride, void *data)
|
||||
void GLEncoder::s_glTexcoordPointer(void *self, int size, GLenum type, GLsizei stride, const void *data)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
assert(ctx->m_state != NULL);
|
||||
@@ -186,7 +186,7 @@ void GLEncoder::s_glTexcoordPointer(void *self, int size, GLenum type, GLsizei s
|
||||
ctx->m_state->setState(loc, size, type, false, stride, data);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glMatrixIndexPointerOES(void *self, int size, GLenum type, GLsizei stride, void * data)
|
||||
void GLEncoder::s_glMatrixIndexPointerOES(void *self, int size, GLenum type, GLsizei stride, const void * data)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
assert(ctx->m_state != NULL);
|
||||
@@ -194,7 +194,7 @@ void GLEncoder::s_glMatrixIndexPointerOES(void *self, int size, GLenum type, GLs
|
||||
ctx->m_state->setState(loc, size, type, false, stride, data);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glWeightPointerOES(void * self, int size, GLenum type, GLsizei stride, void * data)
|
||||
void GLEncoder::s_glWeightPointerOES(void * self, int size, GLenum type, GLsizei stride, const void * data)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
assert(ctx->m_state != NULL);
|
||||
@@ -362,7 +362,7 @@ void GLEncoder::s_glDrawArrays(void *self, GLenum mode, GLint first, GLsizei cou
|
||||
ctx->m_glDrawArrays_enc(ctx, mode, /*first*/ 0, count);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum type, void *indices)
|
||||
void GLEncoder::s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum type, const void *indices)
|
||||
{
|
||||
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
@@ -395,7 +395,7 @@ void GLEncoder::s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum
|
||||
LOGE("glDrawElements: indirect index arrays, with immidate-mode data array is not supported\n");
|
||||
}
|
||||
} else {
|
||||
void *adjustedIndices = indices;
|
||||
void *adjustedIndices = (void*)indices;
|
||||
int minIndex = 0, maxIndex = 0;
|
||||
|
||||
switch(type) {
|
||||
|
||||
@@ -71,21 +71,21 @@ private:
|
||||
static void s_glGetPointerv(void *self, GLenum pname, GLvoid **params);
|
||||
|
||||
static void s_glFlush(void * self);
|
||||
static GLubyte * s_glGetString(void *self, GLenum name);
|
||||
static void s_glVertexPointer(void *self, int size, GLenum type, GLsizei stride, void *data);
|
||||
static void s_glNormalPointer(void *self, GLenum type, GLsizei stride, void *data);
|
||||
static void s_glColorPointer(void *self, int size, GLenum type, GLsizei stride, void *data);
|
||||
static void s_glPointsizePointer(void *self, GLenum type, GLsizei stride, void *data);
|
||||
static const GLubyte * s_glGetString(void *self, GLenum name);
|
||||
static void s_glVertexPointer(void *self, int size, GLenum type, GLsizei stride, const void *data);
|
||||
static void s_glNormalPointer(void *self, GLenum type, GLsizei stride, const void *data);
|
||||
static void s_glColorPointer(void *self, int size, GLenum type, GLsizei stride, const void *data);
|
||||
static void s_glPointsizePointer(void *self, GLenum type, GLsizei stride, const void *data);
|
||||
static void s_glClientActiveTexture(void *self, GLenum texture);
|
||||
static void s_glTexcoordPointer(void *self, int size, GLenum type, GLsizei stride, void *data);
|
||||
static void s_glMatrixIndexPointerOES(void *self, int size, GLenum type, GLsizei stride, void * data);
|
||||
static void s_glWeightPointerOES(void *self, int size, GLenum type, GLsizei stride, void * data);
|
||||
static void s_glTexcoordPointer(void *self, int size, GLenum type, GLsizei stride, const void *data);
|
||||
static void s_glMatrixIndexPointerOES(void *self, int size, GLenum type, GLsizei stride, const void * data);
|
||||
static void s_glWeightPointerOES(void *self, int size, GLenum type, GLsizei stride, const void * data);
|
||||
static void s_glDisableClientState(void *self, GLenum state);
|
||||
static void s_glEnableClientState(void *self, GLenum state);
|
||||
static GLboolean s_glIsEnabled(void *self, GLenum cap);
|
||||
static void s_glBindBuffer(void *self, GLenum target, GLuint id);
|
||||
static void s_glDrawArrays(void *self, GLenum mode, GLint first, GLsizei count);
|
||||
static void s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum type, void *indices);
|
||||
static void s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum type, const void *indices);
|
||||
static void s_glPixelStorei(void *self, GLenum param, GLint value);
|
||||
void sendVertexData(unsigned first, unsigned count);
|
||||
};
|
||||
|
||||
@@ -295,15 +295,17 @@ glTexCoordPointerData
|
||||
|
||||
#void glWeightPointerData(GLint size, GLenum type, GLsizei stride, void * data, GLuint datalen)
|
||||
glWeightPointerData
|
||||
len data datalen
|
||||
custom_pack data glUtilsPackPointerData((unsigned char *)ptr, (unsigned char*)data, size, type, stride, datalen)
|
||||
flag custom_decoder
|
||||
len data datalen
|
||||
custom_pack data glUtilsPackPointerData((unsigned char *)ptr, (unsigned char*)data, size, type, stride, datalen)
|
||||
flag custom_decoder
|
||||
flag not_api
|
||||
|
||||
#void glMatrixIndexPointerData(GLint size, GLenum type, GLsizei stride, void * data, GLuint datalen)
|
||||
glMatrixIndexPointerData
|
||||
len data datalen
|
||||
custom_pack data glUtilsPackPointerData((unsigned char *)ptr, (unsigned char*)data, size, type, stride, datalen)
|
||||
flag custom_decoder
|
||||
len data datalen
|
||||
custom_pack data glUtilsPackPointerData((unsigned char *)ptr, (unsigned char*)data, size, type, stride, datalen)
|
||||
flag custom_decoder
|
||||
flag not_api
|
||||
|
||||
glVertexPointerOffset
|
||||
flag custom_decoder
|
||||
@@ -513,32 +515,26 @@ glGetClipPlanefOES
|
||||
|
||||
#void glTexGenfvOES(GLenum coord, GLenum pname, GLfloat *params)
|
||||
glTexGenfvOES
|
||||
dir params out
|
||||
len params (glUtilsParamSize(pname) * sizeof(GLfloat))
|
||||
|
||||
#void glTexGenivOES(GLenum coord, GLenum pname, GLint *params)
|
||||
glTexGenivOES
|
||||
dir params out
|
||||
len params (glUtilsParamSize(pname) * sizeof(GLint))
|
||||
|
||||
#void glTexGenxvOES(GLenum coord, GLenum pname, GLfixed *params)
|
||||
glTexGenxvOES
|
||||
dir params out
|
||||
len params (glUtilsParamSize(pname) * sizeof(GLfixed))
|
||||
|
||||
#void glGetTexGenfvOES(GLenum coord, GLenum pname, GLfloat *params)
|
||||
glGetTexGenfvOES
|
||||
dir params out
|
||||
len params (glUtilsParamSize(pname) * sizeof(GLfloat))
|
||||
|
||||
#void glGetTexGenivOES(GLenum coord, GLenum pname, GLint *params)
|
||||
glGetTexGenivOES
|
||||
dir params out
|
||||
len params (glUtilsParamSize(pname) * sizeof(GLint))
|
||||
|
||||
#void glGetTexGenxvOES(GLenum coord, GLenum pname, GLfixed *params)
|
||||
glGetTexGenxvOES
|
||||
dir params out
|
||||
len params (glUtilsParamSize(pname) * sizeof(GLfixed))
|
||||
|
||||
#void glDeleteVertexArraysOES(GLsizei n, const GLuint *arrays)
|
||||
|
||||
@@ -68,7 +68,7 @@ GL_ENTRY(void, glDrawArrays, GLenum mode, GLint first, GLsizei count)
|
||||
GL_ENTRY(void, glDrawElements, GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
|
||||
GL_ENTRY(void, glEnable, GLenum cap)
|
||||
GL_ENTRY(void, glEnableClientState, GLenum array)
|
||||
GL_ENTRY(GLint, glFinish, void)
|
||||
GL_ENTRY(void, glFinish, void)
|
||||
GL_ENTRY(void, glFlush, void)
|
||||
GL_ENTRY(void, glFogx, GLenum pname, GLfixed param)
|
||||
GL_ENTRY(void, glFogxv, GLenum pname, const GLfixed *params)
|
||||
|
||||
@@ -40,7 +40,7 @@ void GL2Encoder::s_glFlush(void *self)
|
||||
ctx->m_stream->flush();
|
||||
}
|
||||
|
||||
GLubyte *GL2Encoder::s_glGetString(void *self, GLenum name)
|
||||
const GLubyte *GL2Encoder::s_glGetString(void *self, GLenum name)
|
||||
{
|
||||
GLubyte *retval = (GLubyte *) "";
|
||||
switch(name) {
|
||||
@@ -78,7 +78,7 @@ void GL2Encoder::s_glBindBuffer(void *self, GLenum target, GLuint id)
|
||||
ctx->m_glBindBuffer_enc(self, target, id);
|
||||
}
|
||||
|
||||
void GL2Encoder::s_glVertexAtrribPointer(void *self, GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLvoid * ptr)
|
||||
void GL2Encoder::s_glVertexAtrribPointer(void *self, GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * ptr)
|
||||
{
|
||||
GL2Encoder *ctx = (GL2Encoder *)self;
|
||||
assert(ctx->m_state != NULL);
|
||||
@@ -232,7 +232,7 @@ void GL2Encoder::s_glDrawArrays(void *self, GLenum mode, GLint first, GLsizei co
|
||||
}
|
||||
|
||||
|
||||
void GL2Encoder::s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum type, void *indices)
|
||||
void GL2Encoder::s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum type, const void *indices)
|
||||
{
|
||||
|
||||
GL2Encoder *ctx = (GL2Encoder *)self;
|
||||
@@ -266,7 +266,7 @@ void GL2Encoder::s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum
|
||||
LOGE("glDrawElements: indirect index arrays, with immidate-mode data array is not supported\n");
|
||||
}
|
||||
} else {
|
||||
void *adjustedIndices = indices;
|
||||
void *adjustedIndices = (void*)indices;
|
||||
int minIndex = 0, maxIndex = 0;
|
||||
|
||||
switch(type) {
|
||||
@@ -324,12 +324,12 @@ GLint * GL2Encoder::getCompressedTextureFormats()
|
||||
return m_compressedTextureFormats;
|
||||
}
|
||||
|
||||
void GL2Encoder::s_glShaderSource(void *self, GLuint shader, GLsizei count, GLstr *string, GLint *length)
|
||||
void GL2Encoder::s_glShaderSource(void *self, GLuint shader, GLsizei count, const GLstr *string, const GLint *length)
|
||||
{
|
||||
|
||||
int len = glUtilsCalcShaderSourceLen(string, length, count);
|
||||
int len = glUtilsCalcShaderSourceLen((char**)string, (GLint*)length, count);
|
||||
char *str = new char[len + 1];
|
||||
glUtilsPackStrings(str, string, length, count);
|
||||
glUtilsPackStrings(str, (char**)string, (GLint*)length, count);
|
||||
|
||||
GL2Encoder *ctx = (GL2Encoder *)self;
|
||||
ctx->glShaderString(ctx, shader, str, len + 1);
|
||||
|
||||
@@ -51,7 +51,7 @@ private:
|
||||
static void s_glPixelStorei(void *self, GLenum param, GLint value);
|
||||
|
||||
glGetString_client_proc_t m_glGetString_enc;
|
||||
static GLubyte * s_glGetString(void *self, GLenum name);
|
||||
static const GLubyte * s_glGetString(void *self, GLenum name);
|
||||
|
||||
glBindBuffer_client_proc_t m_glBindBuffer_enc;
|
||||
static void s_glBindBuffer(void *self, GLenum target, GLuint id);
|
||||
@@ -60,7 +60,7 @@ private:
|
||||
static void s_glDrawArrays(void *self, GLenum mode, GLint first, GLsizei count);
|
||||
|
||||
glDrawElements_client_proc_t m_glDrawElements_enc;
|
||||
static void s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum type, void *indices);
|
||||
static void s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum type, const void *indices);
|
||||
|
||||
|
||||
glGetIntegerv_client_proc_t m_glGetIntegerv_enc;
|
||||
@@ -74,7 +74,7 @@ private:
|
||||
|
||||
glVertexAttribPointer_client_proc_t m_glVertexAttribPointer_enc;
|
||||
static void s_glVertexAtrribPointer(void *self, GLuint indx, GLint size, GLenum type,
|
||||
GLboolean normalized, GLsizei stride, GLvoid * ptr);
|
||||
GLboolean normalized, GLsizei stride, const GLvoid * ptr);
|
||||
|
||||
glEnableVertexAttribArray_client_proc_t m_glEnableVertexAttribArray_enc;
|
||||
static void s_glEnableVertexAttribArray(void *self, GLuint index);
|
||||
@@ -91,6 +91,6 @@ private:
|
||||
glGetVertexAttribPointerv_client_proc_t m_glGetVertexAttribPointerv;
|
||||
static void s_glGetVertexAttribPointerv(void *self, GLuint index, GLenum pname, GLvoid **pointer);
|
||||
|
||||
static void s_glShaderSource(void *self, GLuint shader, GLsizei count, GLstr *string, GLint *length);
|
||||
static void s_glShaderSource(void *self, GLuint shader, GLsizei count, const GLstr *string, const GLint *length);
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -42,8 +42,7 @@ GL_ENTRY(void, glDrawArrays, GLenum mode, GLint first, GLsizei count)
|
||||
GL_ENTRY(void, glDrawElements, GLenum mode, GLsizei count, GLenum type, const GLvoid* indices)
|
||||
GL_ENTRY(void, glEnable, GLenum cap)
|
||||
GL_ENTRY(void, glEnableVertexAttribArray, GLuint index)
|
||||
# divert from the Opengl definition. Make glFinish retrun a value to ensure round trip.
|
||||
GL_ENTRY(GLint, glFinish, void)
|
||||
GL_ENTRY(void, glFinish, void)
|
||||
GL_ENTRY(void, glFlush, void)
|
||||
GL_ENTRY(void, glFramebufferRenderbuffer, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
|
||||
GL_ENTRY(void, glFramebufferTexture2D, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
|
||||
|
||||
@@ -56,7 +56,7 @@ GLuint RendererContext::getTex2DBind()
|
||||
return m_tex2DBind[m_activeTexture];
|
||||
}
|
||||
|
||||
void RendererContext::addPendingCropRect(int *rect)
|
||||
void RendererContext::addPendingCropRect(const int *rect)
|
||||
{
|
||||
PendingCropRect *r = new PendingCropRect;
|
||||
r->texture = m_tex2DBind[m_activeTexture];
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
}
|
||||
bool isTex2DEnable(int texunit) { return m_tex2DEnable[texunit]; }
|
||||
GLuint getTex2DBind();
|
||||
void addPendingCropRect(int *rect);
|
||||
void addPendingCropRect(const int *rect);
|
||||
PendingCropRectSet &getPendingCropRects() { return m_pendingCropRects; }
|
||||
|
||||
void setClientActiveTexture(GLenum texture) { m_clientActiveTexture = texture - GL_TEXTURE0; }
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
__thread RenderingThread * RenderingThread::m_tls;
|
||||
|
||||
#ifdef PVR_WAR
|
||||
void RenderingThread::s_glTexParameteriv(GLenum target, GLenum param, int *p)
|
||||
void RenderingThread::s_glTexParameteriv(GLenum target, GLenum param, const int *p)
|
||||
{
|
||||
if (target == GL_TEXTURE_2D && param == GL_TEXTURE_CROP_RECT_OES) {
|
||||
m_tls->m_currentContext->addPendingCropRect(p);
|
||||
@@ -64,28 +64,28 @@ void RenderingThread::s_glDrawTexxOES(GLfixed x, GLfixed y, GLfixed z, GLfixed w
|
||||
m_tls->fixTextureEnable();
|
||||
}
|
||||
|
||||
void RenderingThread::s_glDrawTexfvOES(GLfloat *coords)
|
||||
void RenderingThread::s_glDrawTexfvOES(const GLfloat *coords)
|
||||
{
|
||||
m_tls->applyPendingCropRects();
|
||||
m_tls->m_glDrawTexfvOES(coords);
|
||||
m_tls->fixTextureEnable();
|
||||
}
|
||||
|
||||
void RenderingThread::s_glDrawTexsvOES(GLshort *coords)
|
||||
void RenderingThread::s_glDrawTexsvOES(const GLshort *coords)
|
||||
{
|
||||
m_tls->applyPendingCropRects();
|
||||
m_tls->m_glDrawTexsvOES(coords);
|
||||
m_tls->fixTextureEnable();
|
||||
}
|
||||
|
||||
void RenderingThread::s_glDrawTexivOES(GLint *coords)
|
||||
void RenderingThread::s_glDrawTexivOES(const GLint *coords)
|
||||
{
|
||||
m_tls->applyPendingCropRects();
|
||||
m_tls->m_glDrawTexivOES(coords);
|
||||
m_tls->fixTextureEnable();
|
||||
}
|
||||
|
||||
void RenderingThread::s_glDrawTexxvOES(GLfixed *coords)
|
||||
void RenderingThread::s_glDrawTexxvOES(const GLfixed *coords)
|
||||
{
|
||||
m_tls->applyPendingCropRects();
|
||||
m_tls->m_glDrawTexxvOES(coords);
|
||||
|
||||
@@ -73,15 +73,15 @@ private:
|
||||
static int s_makeCurrent(uint32_t pid, uint32_t drawSurface, uint32_t readSurface, uint32_t ctx);
|
||||
static void s_swapBuffers(uint32_t pid, uint32_t surface);
|
||||
#ifdef PVR_WAR
|
||||
static void s_glTexParameteriv(GLenum target, GLenum param, int *p);
|
||||
static void s_glTexParameteriv(GLenum target, GLenum param, const int *p);
|
||||
static void s_glDrawTexfOES(GLfloat x, GLfloat y, GLfloat z, GLfloat w, GLfloat h);
|
||||
static void s_glDrawTexsOES(GLshort x, GLshort y, GLshort z, GLshort w, GLshort h);
|
||||
static void s_glDrawTexiOES(GLint x, GLint y, GLint z, GLint w, GLint h);
|
||||
static void s_glDrawTexxOES(GLfixed x, GLfixed y, GLfixed z, GLfixed w, GLfixed h);
|
||||
static void s_glDrawTexfvOES(GLfloat *coords);
|
||||
static void s_glDrawTexsvOES(GLshort *coords);
|
||||
static void s_glDrawTexivOES(GLint *coords);
|
||||
static void s_glDrawTexxvOES(GLfixed *coords);
|
||||
static void s_glDrawTexfvOES(const GLfloat *coords);
|
||||
static void s_glDrawTexsvOES(const GLshort *coords);
|
||||
static void s_glDrawTexivOES(const GLint *coords);
|
||||
static void s_glDrawTexxvOES(const GLfixed *coords);
|
||||
|
||||
static void s_glActiveTexture(GLenum texture);
|
||||
static void s_glBindTexture(GLenum target, GLuint texture);
|
||||
|
||||
Reference in New Issue
Block a user