opengl: Remove accessor functions from encoders.
These functions are not necessary since all the fields are
public members of structures. Also gets us closer to the state
of the real emugen output, which isn't matched yet due to other
differences.
Change-Id: Iea092beca7e3a819c286fe3d84897e6a170747f8
diff --git a/system/GLESv2_enc/GL2Encoder.cpp b/system/GLESv2_enc/GL2Encoder.cpp
index eb253cb..3b2100e 100644
--- a/system/GLESv2_enc/GL2Encoder.cpp
+++ b/system/GLESv2_enc/GL2Encoder.cpp
@@ -48,74 +48,79 @@
m_error = GL_NO_ERROR;
m_num_compressedTextureFormats = 0;
m_compressedTextureFormats = NULL;
+
//overrides
- m_glFlush_enc = set_glFlush(s_glFlush);
- m_glPixelStorei_enc = set_glPixelStorei(s_glPixelStorei);
- m_glGetString_enc = set_glGetString(s_glGetString);
- m_glBindBuffer_enc = set_glBindBuffer(s_glBindBuffer);
- m_glBufferData_enc = set_glBufferData(s_glBufferData);
- m_glBufferSubData_enc = set_glBufferSubData(s_glBufferSubData);
- m_glDeleteBuffers_enc = set_glDeleteBuffers(s_glDeleteBuffers);
- m_glDrawArrays_enc = set_glDrawArrays(s_glDrawArrays);
- m_glDrawElements_enc = set_glDrawElements(s_glDrawElements);
- m_glGetIntegerv_enc = set_glGetIntegerv(s_glGetIntegerv);
- m_glGetFloatv_enc = set_glGetFloatv(s_glGetFloatv);
- m_glGetBooleanv_enc = set_glGetBooleanv(s_glGetBooleanv);
- m_glVertexAttribPointer_enc = set_glVertexAttribPointer(s_glVertexAttribPointer);
- m_glEnableVertexAttribArray_enc = set_glEnableVertexAttribArray(s_glEnableVertexAttribArray);
- m_glDisableVertexAttribArray_enc = set_glDisableVertexAttribArray(s_glDisableVertexAttribArray);
- m_glGetVertexAttribiv_enc = set_glGetVertexAttribiv(s_glGetVertexAttribiv);
- m_glGetVertexAttribfv_enc = set_glGetVertexAttribfv(s_glGetVertexAttribfv);
- m_glGetVertexAttribPointerv_enc = set_glGetVertexAttribPointerv(s_glGetVertexAttribPointerv);
- set_glShaderSource(s_glShaderSource);
- set_glFinish(s_glFinish);
- m_glGetError_enc = set_glGetError(s_glGetError);
- m_glLinkProgram_enc = set_glLinkProgram(s_glLinkProgram);
- m_glDeleteProgram_enc = set_glDeleteProgram(s_glDeleteProgram);
- m_glGetUniformiv_enc = set_glGetUniformiv(s_glGetUniformiv);
- m_glGetUniformfv_enc = set_glGetUniformfv(s_glGetUniformfv);
- m_glCreateProgram_enc = set_glCreateProgram(s_glCreateProgram);
- m_glCreateShader_enc = set_glCreateShader(s_glCreateShader);
- m_glDeleteShader_enc = set_glDeleteShader(s_glDeleteShader);
- m_glAttachShader_enc = set_glAttachShader(s_glAttachShader);
- m_glDetachShader_enc = set_glDetachShader(s_glDetachShader);
- m_glGetAttachedShaders_enc = set_glGetAttachedShaders(s_glGetAttachedShaders);
- m_glGetShaderSource_enc = set_glGetShaderSource(s_glGetShaderSource);
- m_glGetShaderInfoLog_enc = set_glGetShaderInfoLog(s_glGetShaderInfoLog);
- m_glGetProgramInfoLog_enc = set_glGetProgramInfoLog(s_glGetProgramInfoLog);
+#define OVERRIDE(name) m_##name##_enc = this-> name ; this-> name = &s_##name
- m_glGetUniformLocation_enc = set_glGetUniformLocation(s_glGetUniformLocation);
- m_glUseProgram_enc = set_glUseProgram(s_glUseProgram);
+ OVERRIDE(glFlush);
+ OVERRIDE(glPixelStorei);
+ OVERRIDE(glGetString);
+ OVERRIDE(glBindBuffer);
+ OVERRIDE(glBufferData);
+ OVERRIDE(glBufferSubData);
+ OVERRIDE(glDeleteBuffers);
+ OVERRIDE(glDrawArrays);
+ OVERRIDE(glDrawElements);
+ OVERRIDE(glGetIntegerv);
+ OVERRIDE(glGetFloatv);
+ OVERRIDE(glGetBooleanv);
+ OVERRIDE(glVertexAttribPointer);
+ OVERRIDE(glEnableVertexAttribArray);
+ OVERRIDE(glDisableVertexAttribArray);
+ OVERRIDE(glGetVertexAttribiv);
+ OVERRIDE(glGetVertexAttribfv);
+ OVERRIDE(glGetVertexAttribPointerv);
- m_glUniform1f_enc = set_glUniform1f(s_glUniform1f);
- m_glUniform1fv_enc = set_glUniform1fv(s_glUniform1fv);
- m_glUniform1i_enc = set_glUniform1i(s_glUniform1i);
- m_glUniform1iv_enc = set_glUniform1iv(s_glUniform1iv);
- m_glUniform2f_enc = set_glUniform2f(s_glUniform2f);
- m_glUniform2fv_enc = set_glUniform2fv(s_glUniform2fv);
- m_glUniform2i_enc = set_glUniform2i(s_glUniform2i);
- m_glUniform2iv_enc = set_glUniform2iv(s_glUniform2iv);
- m_glUniform3f_enc = set_glUniform3f(s_glUniform3f);
- m_glUniform3fv_enc = set_glUniform3fv(s_glUniform3fv);
- m_glUniform3i_enc = set_glUniform3i(s_glUniform3i);
- m_glUniform3iv_enc = set_glUniform3iv(s_glUniform3iv);
- m_glUniform4f_enc = set_glUniform4f(s_glUniform4f);
- m_glUniform4fv_enc = set_glUniform4fv(s_glUniform4fv);
- m_glUniform4i_enc = set_glUniform4i(s_glUniform4i);
- m_glUniform4iv_enc = set_glUniform4iv(s_glUniform4iv);
- m_glUniformMatrix2fv_enc = set_glUniformMatrix2fv(s_glUniformMatrix2fv);
- m_glUniformMatrix3fv_enc = set_glUniformMatrix3fv(s_glUniformMatrix3fv);
- m_glUniformMatrix4fv_enc = set_glUniformMatrix4fv(s_glUniformMatrix4fv);
+ this->glShaderSource = &s_glShaderSource;
+ this->glFinish = &s_glFinish;
- m_glActiveTexture_enc = set_glActiveTexture(s_glActiveTexture);
- m_glBindTexture_enc = set_glBindTexture(s_glBindTexture);
- m_glDeleteTextures_enc = set_glDeleteTextures(s_glDeleteTextures);
- m_glGetTexParameterfv_enc = set_glGetTexParameterfv(s_glGetTexParameterfv);
- m_glGetTexParameteriv_enc = set_glGetTexParameteriv(s_glGetTexParameteriv);
- m_glTexParameterf_enc = set_glTexParameterf(s_glTexParameterf);
- m_glTexParameterfv_enc = set_glTexParameterfv(s_glTexParameterfv);
- m_glTexParameteri_enc = set_glTexParameteri(s_glTexParameteri);
- m_glTexParameteriv_enc = set_glTexParameteriv(s_glTexParameteriv);
+ OVERRIDE(glGetError);
+ OVERRIDE(glLinkProgram);
+ OVERRIDE(glDeleteProgram);
+ OVERRIDE(glGetUniformiv);
+ OVERRIDE(glGetUniformfv);
+ OVERRIDE(glCreateProgram);
+ OVERRIDE(glCreateShader);
+ OVERRIDE(glDeleteShader);
+ OVERRIDE(glAttachShader);
+ OVERRIDE(glDetachShader);
+ OVERRIDE(glGetAttachedShaders);
+ OVERRIDE(glGetShaderSource);
+ OVERRIDE(glGetShaderInfoLog);
+ OVERRIDE(glGetProgramInfoLog);
+
+ OVERRIDE(glGetUniformLocation);
+ OVERRIDE(glUseProgram);
+
+ OVERRIDE(glUniform1f);
+ OVERRIDE(glUniform1fv);
+ OVERRIDE(glUniform1i);
+ OVERRIDE(glUniform1iv);
+ OVERRIDE(glUniform2f);
+ OVERRIDE(glUniform2fv);
+ OVERRIDE(glUniform2i);
+ OVERRIDE(glUniform2iv);
+ OVERRIDE(glUniform3f);
+ OVERRIDE(glUniform3fv);
+ OVERRIDE(glUniform3i);
+ OVERRIDE(glUniform3iv);
+ OVERRIDE(glUniform4f);
+ OVERRIDE(glUniform4fv);
+ OVERRIDE(glUniform4i);
+ OVERRIDE(glUniform4iv);
+ OVERRIDE(glUniformMatrix2fv);
+ OVERRIDE(glUniformMatrix3fv);
+ OVERRIDE(glUniformMatrix4fv);
+
+ OVERRIDE(glActiveTexture);
+ OVERRIDE(glBindTexture);
+ OVERRIDE(glDeleteTextures);
+ OVERRIDE(glGetTexParameterfv);
+ OVERRIDE(glGetTexParameteriv);
+ OVERRIDE(glTexParameterf);
+ OVERRIDE(glTexParameterfv);
+ OVERRIDE(glTexParameteri);
+ OVERRIDE(glTexParameteriv);
}
GL2Encoder::~GL2Encoder()