Small update of opengl32.

svn path=/trunk/; revision=13410
This commit is contained in:
Gregor Anich 2005-02-05 00:07:57 +00:00
parent 61f4f70343
commit 9566275d1b
2 changed files with 28 additions and 19 deletions

View file

@ -61,11 +61,12 @@ int STDCALL glEmptyFunc56( long l1, long l2, long l3, long l4, long l5,
#if defined(_M_IX86) #if defined(_M_IX86)
# define FOO(x) #x # define FOO(x) #x
# define X(func, ret, typeargs, args, icdidx, tebidx, stack) \ # define X(func, ret, typeargs, args, icdidx, tebidx, stack) \
__asm__(".globl _"#func"@"#stack "\n\t" \ __asm__(".align 4" "\n\t" \
".globl _"#func"@"#stack "\n\t" \
"_"#func"@"#stack":" "\n\t" \ "_"#func"@"#stack":" "\n\t" \
" movl %fs:0x18, %eax" "\n\t" \ " movl %fs:0x18, %eax" "\n\t" \
" movl 0xbe8(%eax), %eax" "\n\t" \ " movl 0xbe8(%eax), %eax" "\n\t" \
" jmp *"FOO((icdidx*4))"(%eax)" "\n\t"); " jmp *"FOO((icdidx*4))"(%eax)" "\n\t");
GLFUNCS_MACRO GLFUNCS_MACRO
# undef FOO # undef FOO
@ -74,19 +75,19 @@ GLFUNCS_MACRO
# define X(func, ret, typeargs, args, icdidx, tebidx, stack) \ # define X(func, ret, typeargs, args, icdidx, tebidx, stack) \
ret STDCALL func typeargs \ ret STDCALL func typeargs \
{ \ { \
PROC *table; \ PROC *table; \
PROC fn; \ PROC fn; \
if (tebidx >= 0 && 0) \ if (tebidx >= 0 && 0) \
{ \ { \
table = (PROC *)NtCurrentTeb()->glDispatchTable; \ table = (PROC *)NtCurrentTeb()->glDispatchTable; \
fn = table[tebidx]; \ fn = table[tebidx]; \
} \ } \
else \ else \
{ \ { \
table = (PROC *)NtCurrentTeb()->glTable; \ table = (PROC *)NtCurrentTeb()->glTable; \
fn = table[icdidx]; \ fn = table[icdidx]; \
} \ } \
return (ret)((ret(*)typeargs)fn)args; \ return (ret)((ret(*)typeargs)fn)args; \
} }
GLFUNCS_MACRO GLFUNCS_MACRO

View file

@ -10,6 +10,7 @@
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "teb.h" #include "teb.h"
@ -334,6 +335,15 @@ ROSGL_ICDForHDC( HDC hdc )
} }
/* load driver (or get a reference) */ /* load driver (or get a reference) */
dcdata->icd = OPENGL32_LoadICD( info.driver_name ); dcdata->icd = OPENGL32_LoadICD( info.driver_name );
if (dcdata->icd == NULL)
{
WCHAR Buffer[256];
snwprintf(Buffer, sizeof(Buffer)/sizeof(WCHAR),
L"Couldn't load driver \"%s\".", driverName);
MessageBox(WindowFromDC( hdc ), Buffer,
L"OPENGL32.dll: Warning",
MB_OK | MB_ICONWARNING);
}
} }
return dcdata->icd; return dcdata->icd;
@ -398,7 +408,6 @@ ROSGL_SetContextCallBack( const ICDTable *table )
#undef X #undef X
DBGPRINT( "Done." ); DBGPRINT( "Done." );
/* DBGBREAK();*/
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
@ -894,7 +903,6 @@ rosglMakeCurrent( HDC hdc, HGLRC hglrc )
if (glrc->hglrc != NULL) if (glrc->hglrc != NULL)
{ {
DBGPRINT( "Info: Calling DrvSetContext!" ); DBGPRINT( "Info: Calling DrvSetContext!" );
DBGBREAK();
icdTable = glrc->icd->DrvSetContext( hdc, glrc->hglrc, icdTable = glrc->icd->DrvSetContext( hdc, glrc->hglrc,
ROSGL_SetContextCallBack ); ROSGL_SetContextCallBack );
if (icdTable == NULL) if (icdTable == NULL)