diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2023-03-05 16:42:20 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2023-03-05 16:42:20 +0100 |
| commit | 791efc9e79b09f9f5ec3d01329ab33727a6afb0b (patch) | |
| tree | d344c7ec0e292339d59bb0ba2393c55510d9a1d6 /src | |
| parent | f9bc94bfb8529c6b10c989ad3a355498a72d7f85 (diff) | |
| download | box64-791efc9e79b09f9f5ec3d01329ab33727a6afb0b.tar.gz box64-791efc9e79b09f9f5ec3d01329ab33727a6afb0b.zip | |
Added wrapped libGLX
Diffstat (limited to 'src')
| -rwxr-xr-x | src/library_list.h | 2 | ||||
| -rw-r--r-- | src/wrapped/generated/functions_list.txt | 4 | ||||
| -rw-r--r-- | src/wrapped/generated/wrappedlibglxdefs.h | 8 | ||||
| -rw-r--r-- | src/wrapped/generated/wrappedlibglxtypes.h | 20 | ||||
| -rw-r--r-- | src/wrapped/generated/wrappedlibglxundefs.h | 8 | ||||
| -rw-r--r-- | src/wrapped/wrappedlibglx.c | 61 | ||||
| -rw-r--r-- | src/wrapped/wrappedlibglx_private.h | 48 |
7 files changed, 151 insertions, 0 deletions
diff --git a/src/library_list.h b/src/library_list.h index dcc58a2c..9fbb5513 100755 --- a/src/library_list.h +++ b/src/library_list.h @@ -11,6 +11,8 @@ GO("libGL.so.1", libgl) GO("libGL.so", libgl) GO("libOpenGL.so.0", libgl) GO("libGLU.so.1", libglu) +GO("libGLX.so.0", libglx) +GO("libGLX.so", libglx) GO("libX11.so.6", libx11) GO("libasound.so.2", libasound) GO("libdl.so.2", libdl) diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt index 23efbb80..02a8720c 100644 --- a/src/wrapped/generated/functions_list.txt +++ b/src/wrapped/generated/functions_list.txt @@ -3410,6 +3410,10 @@ wrappedlibglu: - gluNurbsCallback - gluQuadricCallback - gluTessCallback +wrappedlibglx: +- pFp: + - glXGetProcAddress + - glXGetProcAddressARB wrappedlibibus: - vFpippp: - ibus_bus_current_input_context_async diff --git a/src/wrapped/generated/wrappedlibglxdefs.h b/src/wrapped/generated/wrappedlibglxdefs.h new file mode 100644 index 00000000..ec21a1f1 --- /dev/null +++ b/src/wrapped/generated/wrappedlibglxdefs.h @@ -0,0 +1,8 @@ +/******************************************************************* + * File automatically generated by rebuild_wrappers.py (v2.2.0.16) * + *******************************************************************/ +#ifndef __wrappedlibglxDEFS_H_ +#define __wrappedlibglxDEFS_H_ + + +#endif // __wrappedlibglxDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibglxtypes.h b/src/wrapped/generated/wrappedlibglxtypes.h new file mode 100644 index 00000000..94a5a155 --- /dev/null +++ b/src/wrapped/generated/wrappedlibglxtypes.h @@ -0,0 +1,20 @@ +/******************************************************************* + * File automatically generated by rebuild_wrappers.py (v2.2.0.16) * + *******************************************************************/ +#ifndef __wrappedlibglxTYPES_H_ +#define __wrappedlibglxTYPES_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void* (*pFp_t)(void*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(glXGetProcAddress, pFp_t) \ + GO(glXGetProcAddressARB, pFp_t) + +#endif // __wrappedlibglxTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibglxundefs.h b/src/wrapped/generated/wrappedlibglxundefs.h new file mode 100644 index 00000000..4113a9f3 --- /dev/null +++ b/src/wrapped/generated/wrappedlibglxundefs.h @@ -0,0 +1,8 @@ +/******************************************************************* + * File automatically generated by rebuild_wrappers.py (v2.2.0.16) * + *******************************************************************/ +#ifndef __wrappedlibglxUNDEFS_H_ +#define __wrappedlibglxUNDEFS_H_ + + +#endif // __wrappedlibglxUNDEFS_H_ diff --git a/src/wrapped/wrappedlibglx.c b/src/wrapped/wrappedlibglx.c new file mode 100644 index 00000000..52bae55d --- /dev/null +++ b/src/wrapped/wrappedlibglx.c @@ -0,0 +1,61 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include <dlfcn.h> + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" +#include "myalign.h" +#include "gltools.h" + +const char* libglxName = "libGLX.so.0"; +#define LIBNAME libglx + +#include "generated/wrappedlibglxtypes.h" + +#include "wrappercallback.h" + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ + + +#undef SUPER + +EXPORT void* myx_glXGetProcAddress(x64emu_t* emu, void* name) +{ + khint_t k; + const char* rname = (const char*)name; + return getGLProcAddress(emu, (glprocaddress_t)my->glXGetProcAddress, rname); +} + +EXPORT void* myx_glXGetProcAddressARB(x64emu_t* emu, void* name) +{ + khint_t k; + const char* rname = (const char*)name; + return getGLProcAddress(emu, (glprocaddress_t)my->glXGetProcAddressARB, rname); +} + + + +#define CUSTOM_INIT \ + getMy(lib); \ + SETALT(myx_); \ + +#define CUSTOM_FINI \ + freeMy(); + +#include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibglx_private.h b/src/wrapped/wrappedlibglx_private.h new file mode 100644 index 00000000..aab119d6 --- /dev/null +++ b/src/wrapped/wrappedlibglx_private.h @@ -0,0 +1,48 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error meh! +#endif + +// __glXGLLoadGLXFunction +GO(glXChooseFBConfig, pFpipp) +GO(glXChooseVisual, pFpip) +GO(glXCopyContext,vFppp) +GO(glXCreateContext,pFpppi) +GO(glXCreateGLXPixmap,pFppp) +GO(glXCreateNewContext,pFppipi) +GO(glXCreatePbuffer,pFppp) +GO(glXCreatePixmap,pFppp) +GO(glXCreateWindow,pFpppp) +GO(glXDestroyContext,vFpp) +GO(glXDestroyGLXPixmap,vFpp) +GO(glXDestroyPbuffer,vFpp) +GO(glXDestroyPixmap,vFpp) +GO(glXDestroyWindow,vFpp) +GO(glXGetClientString, pFpi) +GO(glXGetConfig, iFppip) +GO(glXGetCurrentContext, pFv) +GO(glXGetCurrentDisplay, pFv) +GO(glXGetCurrentDrawable, pFv) +GO(glXGetCurrentReadDrawable, pFv) +GO(glXGetFBConfigAttrib, iFppip) +GO(glXGetFBConfigs,pFpip) +GOM(glXGetProcAddress, pFEp) +GOM(glXGetProcAddressARB, pFEp) +GO(glXGetSelectedEvent, vFppp) +GO(glXGetVisualFromFBConfig, pFpp) +GO(glXIsDirect,iFpp) +GO(glXMakeContextCurrent,iFpppp) +GO(glXMakeCurrent,iFppp) +GO(glXQueryContext,iFppip) +GO(glXQueryDrawable, iFppip) +GO(glXQueryExtension, iFppp) +GO(glXQueryExtensionsString,pFpi) +GO(glXQueryServerString,pFpii) +GO(glXQueryVersion,iFppp) +GO(glXSelectEvent, vFppu) +GO(glXSwapBuffers,vFpp) +GO(glXUseXFont,vFpiii) +GO(glXWaitGL,vFv) +GO(glXWaitX,vFv) + + + |