aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/c_src/wxe_gl.cpp
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2015-05-20 12:53:44 +0200
committerDan Gudmundsson <[email protected]>2015-06-01 13:07:33 +0200
commit01c0f71f9e963b2c6fbc9417c8a414345d524609 (patch)
treedec0a9595b9ee827633ba7ea05af8a40526a2e9f /lib/wx/c_src/wxe_gl.cpp
parent7819974d320c8fdf4994a6b76a3ad2d686065a6b (diff)
downloadotp-01c0f71f9e963b2c6fbc9417c8a414345d524609.tar.gz
otp-01c0f71f9e963b2c6fbc9417c8a414345d524609.tar.bz2
otp-01c0f71f9e963b2c6fbc9417c8a414345d524609.zip
wx: Optimize event and return value construction
Preallocated an rt array of 64 items (which covers 99%) of the calls and thus avoids allocation and copying in most cases.
Diffstat (limited to 'lib/wx/c_src/wxe_gl.cpp')
-rw-r--r--lib/wx/c_src/wxe_gl.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/wx/c_src/wxe_gl.cpp b/lib/wx/c_src/wxe_gl.cpp
index 26b45d219e..7921c1d52a 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)