mirror of
https://github.com/FEX-Emu/FEX.git
synced 2025-02-02 20:44:30 +00:00
Thunks: Use libclang-based code generation for libGL
This commit is contained in:
parent
3a2f9a4d46
commit
f4dd1a895e
File diff suppressed because it is too large
Load Diff
@ -125,7 +125,7 @@ add_guest_lib(asound)
|
||||
generate(libEGL thunks function_packs function_packs_public)
|
||||
add_guest_lib(EGL)
|
||||
|
||||
generate(libGL thunks function_packs function_packs_public tab_function_packs)
|
||||
generate_new(libGL ${CMAKE_CURRENT_SOURCE_DIR}/../libGL/libGL_interface.cpp thunks function_packs function_packs_public)
|
||||
add_guest_lib(GL)
|
||||
|
||||
# disabled for now, headers are platform specific
|
||||
|
@ -117,7 +117,7 @@ add_host_lib(asound)
|
||||
generate(libEGL function_unpacks tab_function_unpacks ldr ldr_ptrs)
|
||||
add_host_lib(EGL)
|
||||
|
||||
generate(libGL function_unpacks tab_function_unpacks ldr ldr_ptrs)
|
||||
generate_new(libGL ${CMAKE_CURRENT_SOURCE_DIR}/../libGL/libGL_interface.cpp function_unpacks tab_function_unpacks ldr ldr_ptrs)
|
||||
add_host_lib(GL)
|
||||
|
||||
find_package(OpenGL REQUIRED)
|
||||
|
@ -25,19 +25,14 @@ $end_info$
|
||||
|
||||
typedef void voidFunc();
|
||||
|
||||
static struct { const char* name; voidFunc* fn; } symtab[] = {
|
||||
#include "tab_function_packs.inl"
|
||||
{ nullptr, nullptr }
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
voidFunc *glXGetProcAddress(const GLubyte *procname) {
|
||||
|
||||
for (int i = 0; symtab[i].name; i++) {
|
||||
if (strcmp(symtab[i].name, (const char*)procname) == 0) {
|
||||
for (int i = 0; internal_symtable[i].name; i++) {
|
||||
if (strcmp(internal_symtable[i].name, (const char*)procname) == 0) {
|
||||
// for debugging
|
||||
//printf("glXGetProcAddress: looked up %s %s %p %p\n", procname, symtab[i].name, symtab[i].fn, &glXGetProcAddress);
|
||||
return symtab[i].fn;
|
||||
//printf("glXGetProcAddress: looked up %s %s %p %p\n", procname, internal_symtable[i].name, internal_symtable[i].fn, &glXGetProcAddress);
|
||||
return internal_symtable[i].fn;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,10 +18,24 @@ $end_info$
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glext.h>
|
||||
|
||||
#define dlsym(so, name) (void*)glXGetProcAddress((const GLubyte*)name)
|
||||
|
||||
#include "common/Host.h"
|
||||
|
||||
void fexfn_impl_libGL_glDebugMessageCallbackAMD_internal(GLDEBUGPROCAMD, const void*) {
|
||||
fprintf(stderr, "%s: Stubbed\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
void fexfn_impl_libGL_glDebugMessageCallbackARB_internal(GLDEBUGPROCARB, const void*) {
|
||||
fprintf(stderr, "%s: Stubbed\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
void fexfn_impl_libGL_glDebugMessageCallback_internal(GLDEBUGPROC, const void*) {
|
||||
fprintf(stderr, "%s: Stubbed\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
void* symbolFromGlXGetProcAddr(void*, const char* name) {
|
||||
return (void*)glXGetProcAddress((const GLubyte*)name);
|
||||
}
|
||||
|
||||
#include "ldr_ptrs.inl"
|
||||
#include "function_unpacks.inl"
|
||||
|
||||
@ -32,4 +46,4 @@ static ExportEntry exports[] = {
|
||||
|
||||
#include "ldr.inl"
|
||||
|
||||
EXPORTS(libGL)
|
||||
EXPORTS(libGL)
|
||||
|
3059
ThunkLibs/libGL/libGL_interface.cpp
Normal file
3059
ThunkLibs/libGL/libGL_interface.cpp
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user