aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/c_src
diff options
context:
space:
mode:
Diffstat (limited to 'lib/wx/c_src')
-rw-r--r--lib/wx/c_src/egl_impl.cpp10
-rw-r--r--lib/wx/c_src/gen/gl_fdefs.h7
-rw-r--r--lib/wx/c_src/gen/gl_finit.h6
-rw-r--r--lib/wx/c_src/gen/gl_funcs.cpp14
4 files changed, 22 insertions, 15 deletions
diff --git a/lib/wx/c_src/egl_impl.cpp b/lib/wx/c_src/egl_impl.cpp
index 87724f97dc..e2dbbb73c4 100644
--- a/lib/wx/c_src/egl_impl.cpp
+++ b/lib/wx/c_src/egl_impl.cpp
@@ -160,14 +160,8 @@ int load_gl_functions() {
}
void gl_error() {
- // int AP = 0; ErlDrvTermData rt[8];
- // rt[AP++] = ERL_DRV_ATOM; rt[AP++] = driver_mk_atom((char *)"_wxe_error_");
- // rt[AP++] = ERL_DRV_INT; rt[AP++] = (int) gl_error_op;
- // rt[AP++] = ERL_DRV_ATOM; rt[AP++] = driver_mk_atom((char *)"undef");
- // rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 3;
- // driver_send_term(WXE_DRV_PORT,gl_active,rt,AP);
- // BUGBUG
- fprintf(stderr, "OpenGL Extension not available : %d\r\n", gl_error_op);
+ // fprintf(stderr, "OpenGL Extension not available \r\n");
+ throw "undef_extension";
}
/* *******************************************************************************
diff --git a/lib/wx/c_src/gen/gl_fdefs.h b/lib/wx/c_src/gen/gl_fdefs.h
index c0fc338aa8..a45896d30d 100644
--- a/lib/wx/c_src/gen/gl_fdefs.h
+++ b/lib/wx/c_src/gen/gl_fdefs.h
@@ -24,6 +24,13 @@
# define WXE_EXTERN extern
#endif
+typedef struct {
+ const char * name;
+ const char * alt;
+ void * func;
+} gl_fns_t;
+
+#define GLE_GL_FUNC_START 5037
typedef void (APIENTRY * WXEGLACCUM)(GLenum,GLfloat);
WXE_EXTERN WXEGLACCUM weglAccum;
typedef void (APIENTRY * WXEGLALPHAFUNC)(GLenum,GLclampf);
diff --git a/lib/wx/c_src/gen/gl_finit.h b/lib/wx/c_src/gen/gl_finit.h
index 3d707f4c18..583e36faf7 100644
--- a/lib/wx/c_src/gen/gl_finit.h
+++ b/lib/wx/c_src/gen/gl_finit.h
@@ -18,11 +18,7 @@
*/
/***** This file is generated do not edit ****/
-static struct {
- const char * name;
- const char * alt;
- void * func;
-} gl_fns[] =
+gl_fns_t gl_fns[] =
{
{"glAccum", NULL, &weglAccum},
{"glAlphaFunc", NULL, &weglAlphaFunc},
diff --git a/lib/wx/c_src/gen/gl_funcs.cpp b/lib/wx/c_src/gen/gl_funcs.cpp
index ea82635846..30542a0f02 100644
--- a/lib/wx/c_src/gen/gl_funcs.cpp
+++ b/lib/wx/c_src/gen/gl_funcs.cpp
@@ -23,9 +23,10 @@
#include "../egl_impl.h"
#include "gl_fdefs.h"
-int gl_error_op;
+extern gl_fns_t gl_fns[];
+
void egl_dispatch(int op, char *bp, ErlDrvPort port, ErlDrvTermData caller, char *bins[], int bins_sz[]){
- gl_error_op = op;
+ try {
switch(op)
{
case 5000:
@@ -6955,5 +6956,14 @@ case 5863: { // glStencilClearTagEXT
GLuint *stencilClearTag = (GLuint *) bp; bp += 4;
weglStencilClearTagEXT(*stencilTagBits,*stencilClearTag);
}; break;
+}} catch (char *err_msg) {
+int AP = 0; ErlDrvTermData rt[12];
+rt[AP++] = ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_error_");
+rt[AP++] = ERL_DRV_INT; rt[AP++] = (int) op;
+rt[AP++] = ERL_DRV_ATOM; rt[AP++] = driver_mk_atom((char *) err_msg);
+// rt[AP++] = ERL_DRV_ATOM; rt[AP++] = driver_mk_atom((char *) gl_fns[op-GLE_GL_FUNC_START].name);
+// rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 3;
+driver_send_term(port,caller,rt,AP);
}} /* The End */