mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 08:23:01 +00:00

NeHe Lesson 3 works (crashes at close); Lesson 8 does not work - fixed some bugs in wgl.c and disable asm proxy functions for the moment because they crash svn path=/trunk/; revision=8152
85 lines
4.1 KiB
C
85 lines
4.1 KiB
C
/*
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
* PROJECT: ReactOS kernel
|
|
* FILE: lib/opengl32/gl.c
|
|
* PURPOSE: OpenGL32 lib, glXXX functions
|
|
* PROGRAMMER: Anich Gregor (blight)
|
|
* UPDATE HISTORY:
|
|
* Feb 2, 2004: Created
|
|
*/
|
|
|
|
/* On a x86 we call the ICD functions in a special-way:
|
|
*
|
|
* For every glXXX function we export a glXXX entry-point which loads the
|
|
* matching "real" function pointer from the NtCurrentTeb()->glDispatchTable
|
|
* for gl functions in teblist.h and for others it gets the pointer from
|
|
* NtCurrentTeb()->glTable and jmps to the address, leaving the stack alone and
|
|
* letting the "real" function return for us.
|
|
* Royce has implemented this in NASM =D
|
|
*
|
|
* On other machines we use C to forward the calls (slow...)
|
|
*/
|
|
|
|
#define WIN32_LEAN_AND_MEAN
|
|
#include <windows.h>
|
|
#include "teb.h"
|
|
|
|
#include "opengl32.h"
|
|
|
|
int STDCALL glEmptyFunc0() { return 0; }
|
|
int STDCALL glEmptyFunc4( long l1 ) { return 0; }
|
|
int STDCALL glEmptyFunc8( long l1, long l2 ) { return 0; }
|
|
int STDCALL glEmptyFunc12( long l1, long l2, long l3 ) { return 0; }
|
|
int STDCALL glEmptyFunc16( long l1, long l2, long l3, long l4 ) { return 0; }
|
|
int STDCALL glEmptyFunc20( long l1, long l2, long l3, long l4, long l5 )
|
|
{ return 0; }
|
|
int STDCALL glEmptyFunc24( long l1, long l2, long l3, long l4, long l5,
|
|
long l6 ) { return 0; }
|
|
int STDCALL glEmptyFunc28( long l1, long l2, long l3, long l4, long l5,
|
|
long l6, long l7 ) { return 0; }
|
|
int STDCALL glEmptyFunc32( long l1, long l2, long l3, long l4, long l5,
|
|
long l6, long l7, long l8 ) { return 0; }
|
|
int STDCALL glEmptyFunc36( long l1, long l2, long l3, long l4, long l5,
|
|
long l6, long l7, long l8, long l9 ) { return 0; }
|
|
int STDCALL glEmptyFunc40( long l1, long l2, long l3, long l4, long l5,
|
|
long l6, long l7, long l8, long l9, long l10 )
|
|
{ return 0; }
|
|
int STDCALL glEmptyFunc44( long l1, long l2, long l3, long l4, long l5,
|
|
long l6, long l7, long l8, long l9, long l10,
|
|
long l11 ) { return 0; }
|
|
int STDCALL glEmptyFunc48( long l1, long l2, long l3, long l4, long l5,
|
|
long l6, long l7, long l8, long l9, long l10,
|
|
long l11, long l12 ) { return 0; }
|
|
int STDCALL glEmptyFunc52( long l1, long l2, long l3, long l4, long l5,
|
|
long l6, long l7, long l8, long l9, long l10,
|
|
long l11, long l12, long l13 ) { return 0; }
|
|
int STDCALL glEmptyFunc56( long l1, long l2, long l3, long l4, long l5,
|
|
long l6, long l7, long l8, long l9, long l10,
|
|
long l11, long l12, long l13, long l14 )
|
|
{ return 0; }
|
|
|
|
#if 1//!defined(_M_IX86)
|
|
# define X(func, ret, typeargs, args, icdidx, tebidx, stack) \
|
|
ret STDCALL func typeargs \
|
|
{ \
|
|
PROC *table; \
|
|
PROC fn; \
|
|
if (tebidx >= 0) \
|
|
{ \
|
|
table = (PROC *)NtCurrentTeb()->glDispatchTable; \
|
|
fn = table[tebidx]; \
|
|
} \
|
|
else \
|
|
{ \
|
|
table = (PROC *)NtCurrentTeb()->glTable; \
|
|
fn = table[icdidx]; \
|
|
} \
|
|
return (ret)((ret(*)typeargs)fn)args; \
|
|
}
|
|
|
|
GLFUNCS_MACRO
|
|
|
|
#undef X
|
|
#endif//non-x86 architectures
|
|
|
|
/* EOF */
|