emulator opengl: implemented getProcAddress in GLESv1.
Also changed emugen to generates gl_ftable.h needed for getProcAddress implementation. Added not_api attrib to emugen's gl.attrib to exclude from the generated ftable. Change-Id: I03786ea5d5a640bbcf5efccadca5bf2ec3e09fca
This commit is contained in:
committed by
Guy Zadikario
parent
d32c2d9633
commit
903945c963
@@ -1,19 +1,34 @@
|
||||
#include "EGLClientIface.h"
|
||||
#include "HostConnection.h"
|
||||
#include "GLEncoder.h"
|
||||
|
||||
#include "GLES/gl.h"
|
||||
#include "GLES/glext.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"
|
||||
|
||||
//The functions table
|
||||
#include "gl_ftable.h"
|
||||
|
||||
static EGLClient_eglInterface * s_egl = NULL;
|
||||
static EGLClient_glesInterface * s_gl = NULL;
|
||||
|
||||
void * getProcAddress(const char * procname)
|
||||
{
|
||||
// search in GL function table
|
||||
for (int i=0; i<gl_num_funcs; i++) {
|
||||
if (!strcmp(gl_funcs_by_name[i].name, procname)) {
|
||||
return gl_funcs_by_name[i].proc;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void finish()
|
||||
{
|
||||
|
||||
glFinish();
|
||||
}
|
||||
|
||||
EGLClient_glesInterface * init_emul_gles(EGLClient_eglInterface *eglIface)
|
||||
@@ -22,7 +37,7 @@ EGLClient_glesInterface * init_emul_gles(EGLClient_eglInterface *eglIface)
|
||||
|
||||
if (!s_gl) {
|
||||
s_gl = new EGLClient_glesInterface();
|
||||
s_gl->getProcAddress = NULL; //TODO: what goes here?
|
||||
s_gl->getProcAddress = getProcAddress;
|
||||
s_gl->finish = finish;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user