aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/c_src/gen/gl_funcs.cpp
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2010-11-19 14:57:59 +0100
committerDan Gudmundsson <[email protected]>2010-11-19 16:13:05 +0100
commitabc92a6f3b4615e596992eda153da0c09a3c7cbf (patch)
tree48be474d24206c81f1bcd605427648225f1e5472 /lib/wx/c_src/gen/gl_funcs.cpp
parentb69da5dbf60e0062982c89524df97066b95ce816 (diff)
downloadotp-abc92a6f3b4615e596992eda153da0c09a3c7cbf.tar.gz
otp-abc92a6f3b4615e596992eda153da0c09a3c7cbf.tar.bz2
otp-abc92a6f3b4615e596992eda153da0c09a3c7cbf.zip
Fix non available opengl functions
Opengl functions are loaded at runtime and differ with drivers and cards.
Diffstat (limited to 'lib/wx/c_src/gen/gl_funcs.cpp')
-rw-r--r--lib/wx/c_src/gen/gl_funcs.cpp14
1 files changed, 12 insertions, 2 deletions
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 */