Implemented eglGetProcAddress

TRAC #12102 Signed-off-by: Andrew Lewycky Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@223 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent bade8927
......@@ -1030,9 +1030,26 @@ __eglMustCastToProperFunctionPointerType __stdcall eglGetProcAddress(const char
try
{
UNIMPLEMENTED(); // FIXME
struct Extension
{
const char *name;
__eglMustCastToProperFunctionPointerType address;
};
static const Extension eglExtensions[] =
{
{"", NULL},
};
for (int ext = 0; ext < sizeof(eglExtensions) / sizeof(Extension); ext++)
{
if (strcmp(procname, eglExtensions[ext].name) == 0)
{
return (__eglMustCastToProperFunctionPointerType)eglExtensions[ext].address;
}
}
return NULL;
return glGetProcAddress(procname);
}
catch(std::bad_alloc&)
{
......
......@@ -365,6 +365,7 @@ gl::Context *glCreateContext(const egl::Config *config);
void glDestroyContext(gl::Context *context);
void glMakeCurrent(gl::Context *context, egl::Display *display, egl::Surface *surface);
gl::Context *glGetCurrentContext();
__eglMustCastToProperFunctionPointerType __stdcall glGetProcAddress(const char *procname);
}
#endif // INCLUDE_CONTEXT_H_
......@@ -5040,4 +5040,29 @@ void __stdcall glTexImage3DOES(GLenum target, GLint level, GLenum internalformat
return error(GL_OUT_OF_MEMORY);
}
}
__eglMustCastToProperFunctionPointerType __stdcall glGetProcAddress(const char *procname)
{
struct Extension
{
const char *name;
__eglMustCastToProperFunctionPointerType address;
};
static const Extension glExtensions[] =
{
{"glTexImage3DOES", (__eglMustCastToProperFunctionPointerType)glTexImage3DOES},
};
for (int ext = 0; ext < sizeof(glExtensions) / sizeof(Extension); ext++)
{
if (strcmp(procname, glExtensions[ext].name) == 0)
{
return (__eglMustCastToProperFunctionPointerType)glExtensions[ext].address;
}
}
return NULL;
}
}
......@@ -150,4 +150,5 @@ EXPORTS
glCreateContext @144 NONAME
glDestroyContext @145 NONAME
glMakeCurrent @146 NONAME
glGetCurrentContext @147 NONAME
\ No newline at end of file
glGetCurrentContext @147 NONAME
glGetProcAddress @148 NONAME
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment