aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/c_src/wxe_gl.cpp
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2015-06-09 09:37:34 +0200
committerDan Gudmundsson <[email protected]>2015-06-09 09:37:34 +0200
commitbbd68fb2f45ec2089d6f1bbffd2601bf776aa267 (patch)
tree029c2c77b7d399e49e02b13a12f906c3d9606b7f /lib/wx/c_src/wxe_gl.cpp
parent798219edd8adf36dbcc02ce9c9de71685da85d64 (diff)
parent38cb91a91ac2d8f3231761b98909ff89416a4942 (diff)
downloadotp-bbd68fb2f45ec2089d6f1bbffd2601bf776aa267.tar.gz
otp-bbd68fb2f45ec2089d6f1bbffd2601bf776aa267.tar.bz2
otp-bbd68fb2f45ec2089d6f1bbffd2601bf776aa267.zip
Merge branch 'dgud/wx/float-return'
* dgud/wx/float-return: wx: Optimize binary args wx: Driver lock cleanup wx: Optimize event and return value construction wx: Cleanup tests wx: Fix bad float in return values
Diffstat (limited to 'lib/wx/c_src/wxe_gl.cpp')
-rw-r--r--lib/wx/c_src/wxe_gl.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/lib/wx/c_src/wxe_gl.cpp b/lib/wx/c_src/wxe_gl.cpp
index 26b45d219e..347718ab14 100644
--- a/lib/wx/c_src/wxe_gl.cpp
+++ b/lib/wx/c_src/wxe_gl.cpp
@@ -67,7 +67,7 @@ void dlclose(HMODULE Lib) {
typedef void * DL_LIB_P;
#endif
-void wxe_initOpenGL(wxeReturn rt, char *bp) {
+void wxe_initOpenGL(wxeReturn *rt, char *bp) {
DL_LIB_P LIBhandle;
int (*init_opengl)(void *);
#ifdef _WIN32
@@ -82,9 +82,9 @@ void wxe_initOpenGL(wxeReturn rt, char *bp) {
wxe_gl_dispatch = (WXE_GL_DISPATCH) dlsym(LIBhandle, "egl_dispatch");
if(init_opengl && wxe_gl_dispatch) {
(*init_opengl)(erlCallbacks);
- rt.addAtom((char *) "ok");
- rt.add(wxString::FromAscii("initiated"));
- rt.addTupleCount(2);
+ rt->addAtom((char *) "ok");
+ rt->add(wxString::FromAscii("initiated"));
+ rt->addTupleCount(2);
erl_gl_initiated = TRUE;
} else {
wxString msg;
@@ -95,24 +95,24 @@ void wxe_initOpenGL(wxeReturn rt, char *bp) {
msg += wxT("egl_init_opengl ");
if(!wxe_gl_dispatch)
msg += wxT("egl_dispatch ");
- rt.addAtom((char *) "error");
- rt.add(msg);
- rt.addTupleCount(2);
+ rt->addAtom((char *) "error");
+ rt->add(msg);
+ rt->addTupleCount(2);
}
} else {
wxString msg;
msg.Printf(wxT("Could not load dll: "));
msg += wxString::FromAscii(bp);
- rt.addAtom((char *) "error");
- rt.add(msg);
- rt.addTupleCount(2);
+ rt->addAtom((char *) "error");
+ rt->add(msg);
+ rt->addTupleCount(2);
}
} else {
- rt.addAtom((char *) "ok");
- rt.add(wxString::FromAscii("already initilized"));
- rt.addTupleCount(2);
+ rt->addAtom((char *) "ok");
+ rt->add(wxString::FromAscii("already initilized"));
+ rt->addTupleCount(2);
}
- rt.send();
+ rt->send();
}
void setActiveGL(ErlDrvTermData caller, wxGLCanvas *canvas)
@@ -132,7 +132,7 @@ void deleteActiveGL(wxGLCanvas *canvas)
}
}
-void gl_dispatch(int op, char *bp,ErlDrvTermData caller,WXEBinRef *bins[]){
+void gl_dispatch(int op, char *bp,ErlDrvTermData caller,WXEBinRef *bins){
if(caller != gl_active) {
wxGLCanvas * current = glc[caller];
if(current) {
@@ -153,12 +153,12 @@ void gl_dispatch(int op, char *bp,ErlDrvTermData caller,WXEBinRef *bins[]){
char * bs[3];
int bs_sz[3];
for(int i=0; i<3; i++) {
- if(bins[i]) {
- bs[i] = bins[i]->base;
- bs_sz[i] = bins[i]->size;
+ if(bins[i].from) {
+ bs[i] = bins[i].base;
+ bs_sz[i] = bins[i].size;
}
- else
- bs[i] = NULL;
+ else
+ break;
}
wxe_gl_dispatch(op, bp, WXE_DRV_PORT_HANDLE, caller, bs, bs_sz);
}