Commit 60eeb92a authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

opengl32: Build with msvcrt.

parent 5902cfd2
MODULE = opengl32.dll
UNIXLIB = opengl32.so
EXTRADEFS = -DWINE_NO_LONG_TYPES -D_OPENGL32_
IMPORTLIB = opengl32
IMPORTS = user32 gdi32 advapi32 win32u
DELAYIMPORTS = glu32
UNIX_LIBS = -lwin32u
EXTRADLLFLAGS = -Wl,--image-base,0x7a800000 -mcygwin
EXTRADLLFLAGS = -Wl,--image-base,0x7a800000
C_SRCS = \
thunks.c \
......
......@@ -815,6 +815,7 @@ foreach (sort keys %ext_functions)
print OUT "enum unix_funcs\n";
print OUT "{\n";
print OUT " unix_thread_attach,\n";
foreach (sort keys %wgl_functions)
{
next if defined $manual_win_functions{$_};
......@@ -846,11 +847,10 @@ print OUT " GLsizei length;\n";
print OUT " const GLchar *message;\n";
print OUT "};\n\n";
print OUT "typedef NTSTATUS (*unixlib_function_t)( void *args );\n";
print OUT "extern const unixlib_function_t __wine_unix_call_funcs[] DECLSPEC_HIDDEN;\n";
print OUT "#define UNIX_CALL( func, params ) __wine_unix_call_funcs[unix_ ## func]( params )\n";
print OUT "extern unixlib_handle_t unixlib_handle DECLSPEC_HIDDEN;\n";
print OUT "#define UNIX_CALL( func, params ) __wine_unix_call( unixlib_handle, unix_ ## func, params )\n\n";
print OUT "\n#endif /* __WINE_OPENGL32_UNIXLIB_H */\n";
print OUT "#endif /* __WINE_OPENGL32_UNIXLIB_H */\n";
close OUT;
#
......@@ -917,6 +917,10 @@ close OUT;
open OUT, ">unix_thunks.c" or die "cannot create unix_thunks.c";
print OUT "/* Automatically generated from http://www.opengl.org/registry files; DO NOT EDIT! */\n\n";
print OUT "#if 0\n";
print OUT "#pragma makedep unix\n";
print OUT "#endif\n\n";
print OUT "#include <stdarg.h>\n";
print OUT "#include <stddef.h>\n\n";
......@@ -929,6 +933,7 @@ print OUT "#include \"wingdi.h\"\n\n";
print OUT "#include \"unixlib.h\"\n";
print OUT "#include \"unix_private.h\"\n\n";
print OUT "extern NTSTATUS thread_attach( void *args ) DECLSPEC_HIDDEN;\n";
foreach (sort keys %wgl_functions)
{
next if defined $manual_win_functions{$_};
......@@ -968,8 +973,9 @@ foreach (sort keys %ext_functions)
print OUT generate_unix_thunk($_, $ext_functions{$_}, "ext");
}
print OUT "const unixlib_function_t __wine_unix_call_funcs[] =\n";
print OUT "const unixlib_entry_t __wine_unix_call_funcs[] =\n";
print OUT "{\n";
print OUT " &thread_attach,\n";
foreach (sort keys %wgl_functions)
{
next if defined $manual_win_functions{$_};
......
/* Automatically generated from http://www.opengl.org/registry files; DO NOT EDIT! */
#if 0
#pragma makedep unix
#endif
#include <stdarg.h>
#include <stddef.h>
......@@ -12,6 +16,7 @@
#include "unixlib.h"
#include "unix_private.h"
extern NTSTATUS thread_attach( void *args ) DECLSPEC_HIDDEN;
extern NTSTATUS wgl_wglCopyContext( void *args ) DECLSPEC_HIDDEN;
extern NTSTATUS wgl_wglCreateContext( void *args ) DECLSPEC_HIDDEN;
extern NTSTATUS wgl_wglDeleteContext( void *args ) DECLSPEC_HIDDEN;
......@@ -24141,8 +24146,9 @@ static NTSTATUS ext_wglSwapIntervalEXT( void *args )
return STATUS_SUCCESS;
}
const unixlib_function_t __wine_unix_call_funcs[] =
const unixlib_entry_t __wine_unix_call_funcs[] =
{
&thread_attach,
&wgl_wglCopyContext,
&wgl_wglCreateContext,
&wgl_wglDeleteContext,
......@@ -22293,6 +22293,7 @@ struct wglSwapIntervalEXT_params
enum unix_funcs
{
unix_thread_attach,
unix_wglCopyContext,
unix_wglCreateContext,
unix_wglDeleteContext,
......@@ -25349,8 +25350,7 @@ struct wine_gl_debug_message_params
const GLchar *message;
};
typedef NTSTATUS (*unixlib_function_t)( void *args );
extern const unixlib_function_t __wine_unix_call_funcs[] DECLSPEC_HIDDEN;
#define UNIX_CALL( func, params ) __wine_unix_call_funcs[unix_ ## func]( params )
extern unixlib_handle_t unixlib_handle DECLSPEC_HIDDEN;
#define UNIX_CALL( func, params ) __wine_unix_call( unixlib_handle, unix_ ## func, params )
#endif /* __WINE_OPENGL32_UNIXLIB_H */
......@@ -18,8 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#include <stdlib.h>
#include <math.h>
......@@ -40,6 +38,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(wgl);
WINE_DECLARE_DEBUG_CHANNEL(fps);
unixlib_handle_t unixlib_handle;
static const MAT2 identity = { {0,1},{0,0},{0,0},{0,1} };
/***********************************************************************
......@@ -865,25 +865,33 @@ static BOOL WINAPI call_opengl_debug_message_callback( struct wine_gl_debug_mess
return TRUE;
}
extern struct opengl_funcs null_opengl_funcs DECLSPEC_HIDDEN;
/***********************************************************************
* OpenGL initialisation routine
*/
BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
{
void **kernel_callback_table;
NTSTATUS status;
switch(reason)
{
case DLL_PROCESS_ATTACH:
NtCurrentTeb()->glTable = &null_opengl_funcs;
if ((status = NtQueryVirtualMemory( GetCurrentProcess(), hinst, MemoryWineUnixFuncs,
&unixlib_handle, sizeof(unixlib_handle), NULL )))
{
ERR( "Failed to load unixlib, status %#x\n", status );
return FALSE;
}
kernel_callback_table = NtCurrentTeb()->Peb->KernelCallbackTable;
kernel_callback_table[NtUserCallOpenGLDebugMessageCallback] = call_opengl_debug_message_callback;
break;
/* fallthrough */
case DLL_THREAD_ATTACH:
NtCurrentTeb()->glTable = &null_opengl_funcs;
if ((status = UNIX_CALL( thread_attach, NULL )))
{
WARN( "Failed to initialize thread, status %#x\n", status );
return FALSE;
}
break;
}
return TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment