summaryrefslogtreecommitdiff
path: root/glretrace_cgl.cpp
diff options
context:
space:
mode:
authorJosé Fonseca <jose.r.fonseca@gmail.com>2011-10-07 23:36:39 +0100
committerJosé Fonseca <jose.r.fonseca@gmail.com>2011-10-07 23:36:39 +0100
commit2741ed8b85842cf5f08fe6dff8d4ae5626434046 (patch)
treef279aededc60370c6b4cd92a4b382749ffa03f66 /glretrace_cgl.cpp
parent69fe7f8e041e615035e333e0581c003137007e63 (diff)
Use a vector to dispatch calls when retracing.
As opposed to generated switch tables. Speeds up retracing speed by 8%, and should speed up compilation times too.
Diffstat (limited to 'glretrace_cgl.cpp')
-rw-r--r--glretrace_cgl.cpp20
1 files changed, 5 insertions, 15 deletions
diff --git a/glretrace_cgl.cpp b/glretrace_cgl.cpp
index 8cb5786..411706b 100644
--- a/glretrace_cgl.cpp
+++ b/glretrace_cgl.cpp
@@ -112,19 +112,9 @@ static void retrace_CGLFlushDrawable(Trace::Call &call) {
}
-void glretrace::retrace_call_cgl(Trace::Call &call) {
- const char *name = call.name();
-
- if (strcmp(name, "CGLSetCurrentContext") == 0) {
- retrace_CGLSetCurrentContext(call);
- return;
- }
-
- if (strcmp(name, "CGLFlushDrawable") == 0) {
- retrace_CGLFlushDrawable(call);
- return;
- }
-
- return;
-}
+const retrace::Entry glretrace::cgl_callbacks[] = {
+ {"CGLSetCurrentContext", &retrace_CGLSetCurrentContext},
+ {"CGLFlushDrawable", &retrace_CGLFlushDrawable},
+ {NULL, NULL},
+};