mirror of
https://github.com/reactos/reactos.git
synced 2025-06-04 17:00:31 +00:00
Small update of opengl32.
svn path=/trunk/; revision=13410
This commit is contained in:
parent
61f4f70343
commit
9566275d1b
2 changed files with 28 additions and 19 deletions
|
@ -61,11 +61,12 @@ int STDCALL glEmptyFunc56( long l1, long l2, long l3, long l4, long l5,
|
|||
#if defined(_M_IX86)
|
||||
# define FOO(x) #x
|
||||
# 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" \
|
||||
" movl %fs:0x18, %eax" "\n\t" \
|
||||
" movl 0xbe8(%eax), %eax" "\n\t" \
|
||||
" jmp *"FOO((icdidx*4))"(%eax)" "\n\t");
|
||||
" movl %fs:0x18, %eax" "\n\t" \
|
||||
" movl 0xbe8(%eax), %eax" "\n\t" \
|
||||
" jmp *"FOO((icdidx*4))"(%eax)" "\n\t");
|
||||
|
||||
GLFUNCS_MACRO
|
||||
# undef FOO
|
||||
|
@ -74,19 +75,19 @@ GLFUNCS_MACRO
|
|||
# define X(func, ret, typeargs, args, icdidx, tebidx, stack) \
|
||||
ret STDCALL func typeargs \
|
||||
{ \
|
||||
PROC *table; \
|
||||
PROC fn; \
|
||||
if (tebidx >= 0 && 0) \
|
||||
{ \
|
||||
table = (PROC *)NtCurrentTeb()->glDispatchTable; \
|
||||
fn = table[tebidx]; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
table = (PROC *)NtCurrentTeb()->glTable; \
|
||||
fn = table[icdidx]; \
|
||||
} \
|
||||
return (ret)((ret(*)typeargs)fn)args; \
|
||||
PROC *table; \
|
||||
PROC fn; \
|
||||
if (tebidx >= 0 && 0) \
|
||||
{ \
|
||||
table = (PROC *)NtCurrentTeb()->glDispatchTable; \
|
||||
fn = table[tebidx]; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
table = (PROC *)NtCurrentTeb()->glTable; \
|
||||
fn = table[icdidx]; \
|
||||
} \
|
||||
return (ret)((ret(*)typeargs)fn)args; \
|
||||
}
|
||||
|
||||
GLFUNCS_MACRO
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "teb.h"
|
||||
|
@ -334,6 +335,15 @@ ROSGL_ICDForHDC( HDC hdc )
|
|||
}
|
||||
/* load driver (or get a reference) */
|
||||
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;
|
||||
|
@ -398,7 +408,6 @@ ROSGL_SetContextCallBack( const ICDTable *table )
|
|||
#undef X
|
||||
|
||||
DBGPRINT( "Done." );
|
||||
/* DBGBREAK();*/
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
@ -894,7 +903,6 @@ rosglMakeCurrent( HDC hdc, HGLRC hglrc )
|
|||
if (glrc->hglrc != NULL)
|
||||
{
|
||||
DBGPRINT( "Info: Calling DrvSetContext!" );
|
||||
DBGBREAK();
|
||||
icdTable = glrc->icd->DrvSetContext( hdc, glrc->hglrc,
|
||||
ROSGL_SetContextCallBack );
|
||||
if (icdTable == NULL)
|
||||
|
|
Loading…
Reference in a new issue