From: José Fonseca Date: Thu, 25 Nov 2010 20:32:59 +0000 (+0000) Subject: Split glxapi. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=99771fcc2dade2764e765eff9822533326ec8128;p=apitrace Split glxapi. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 64c0f53..2fc59ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -134,7 +134,7 @@ if (WIN32) add_custom_command ( OUTPUT opengl32.cpp COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/wgltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/opengl32.cpp - DEPENDS wgltrace.py trace.py wglapi.py glenum.py glapi.py glenum.py winapi.py stdapi.py + DEPENDS wgltrace.py trace.py wglapi.py glapi.py glenum.py winapi.py stdapi.py ) add_library (opengl SHARED opengl32.def opengl32.cpp log.cpp os_win32.cpp) set_target_properties (opengl PROPERTIES @@ -150,7 +150,7 @@ else () add_custom_command ( OUTPUT glxtrace.cpp COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glxtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/glxtrace.cpp - DEPENDS glxtrace.py trace.py glapi.py glenum.py stdapi.py + DEPENDS glxtrace.py trace.py glxapi.py glapi.py glenum.py stdapi.py ) add_library (glxtrace SHARED glxtrace.cpp log.cpp os_posix.cpp) diff --git a/glxapi.py b/glxapi.py new file mode 100644 index 0000000..b58e471 --- /dev/null +++ b/glxapi.py @@ -0,0 +1,41 @@ +########################################################################## +# +# Copyright 2008-2009 VMware, Inc. +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# +##########################################################################/ + + +from stdapi import * +from glapi import glapi + + +glxapi = API("GLX") + +PROC = Opaque("__GLXextFuncPtr") + +glxapi.add_functions(glapi.functions) +glxapi.add_functions([ + Function(PROC, "glXGetProcAddressARB", [(Alias("const GLubyte *", CString), "procName")]), + Function(PROC, "glXGetProcAddress", [(Alias("const GLubyte *", CString), "procName")]), +]) + + diff --git a/glxtrace.py b/glxtrace.py index 2729844..b8cd151 100644 --- a/glxtrace.py +++ b/glxtrace.py @@ -1,6 +1,6 @@ ########################################################################## # -# Copyright 2008-2009 VMware, Inc. +# Copyright 2008-2010 VMware, Inc. # All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -24,23 +24,11 @@ ##########################################################################/ -from stdapi import * -from glapi import glapi -import trace +from glxapi import glxapi +from trace import Tracer -glxapi = API("GLX") - -PROC = Opaque("__GLXextFuncPtr") - -glxapi.add_functions(glapi.functions) -glxapi.add_functions([ - Function(PROC, "glXGetProcAddressARB", [(Alias("const GLubyte *", CString), "procName")]), - Function(PROC, "glXGetProcAddress", [(Alias("const GLubyte *", CString), "procName")]), -]) - - -class GlxTracer(trace.Tracer): +class GlxTracer(Tracer): def get_function_address(self, function): if function.name.startswith("glXGetProcAddress"):