Create a branch for Aleksandar Andrejevic for his work on NTVDM. See http://jira.reactos.org/browse/CORE-7250 for more details.

svn path=/branches/ntvdm/; revision=59241
This commit is contained in:
Hermès Bélusca-Maïto 2013-06-16 22:01:41 +00:00
parent 3e3200acef
commit 4f0b8d3db0
20620 changed files with 0 additions and 1232833 deletions

View file

@ -0,0 +1,22 @@
spec2def(opengl32.dll opengl32.spec ADD_IMPORTLIB)
add_definitions(
-D_GDI32_ # prevent gl* being declared __declspec(dllimport) in MS headers
-DBUILD_GL32 # declare gl* as __declspec(dllexport) in Mesa headers
)
list(APPEND SOURCE
font.c
gl.c
opengl32.c
wgl.c
${CMAKE_CURRENT_BINARY_DIR}/opengl32_stubs.c
${CMAKE_CURRENT_BINARY_DIR}/opengl32.def)
add_library(opengl32 SHARED ${SOURCE})
target_link_libraries(opengl32 wine)
set_module_type(opengl32 win32dll UNICODE)
add_importlibs(opengl32 gdi32 user32 advapi32 msvcrt kernel32 ntdll)
add_pch(opengl32 opengl32.h)
add_cd_file(TARGET opengl32 DESTINATION reactos/system32 FOR all)

565
dll/opengl/opengl32/font.c Normal file
View file

@ -0,0 +1,565 @@
/* Window-specific OpenGL functions implementation.
*
* Copyright (c) 1999 Lionel Ulmer
* Copyright (c) 2005 Raphael Junqueira
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include <math.h>
#include <GL/gl.h>
#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wgl);
/***********************************************************************
* wglUseFontBitmaps_common
*/
static BOOL wglUseFontBitmaps_common( HDC hdc, DWORD first, DWORD count, DWORD listBase, BOOL unicode )
{
GLYPHMETRICS gm;
unsigned int glyph, size = 0;
void *bitmap = NULL, *gl_bitmap = NULL;
int org_alignment;
BOOL ret = TRUE;
glGetIntegerv(GL_UNPACK_ALIGNMENT, &org_alignment);
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
for (glyph = first; glyph < first + count; glyph++) {
static const MAT2 identity = { {0,1},{0,0},{0,0},{0,1} };
unsigned int needed_size, height, width, width_int;
if (unicode)
needed_size = GetGlyphOutlineW(hdc, glyph, GGO_BITMAP, &gm, 0, NULL, &identity);
else
needed_size = GetGlyphOutlineA(hdc, glyph, GGO_BITMAP, &gm, 0, NULL, &identity);
TRACE("Glyph: %3d / List: %d size %d\n", glyph, listBase, needed_size);
if (needed_size == GDI_ERROR) {
ret = FALSE;
break;
}
if (needed_size > size) {
size = needed_size;
HeapFree(GetProcessHeap(), 0, bitmap);
HeapFree(GetProcessHeap(), 0, gl_bitmap);
bitmap = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
gl_bitmap = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
}
if (unicode)
ret = (GetGlyphOutlineW(hdc, glyph, GGO_BITMAP, &gm, size, bitmap, &identity) != GDI_ERROR);
else
ret = (GetGlyphOutlineA(hdc, glyph, GGO_BITMAP, &gm, size, bitmap, &identity) != GDI_ERROR);
if (!ret) break;
if (TRACE_ON(wgl)) {
unsigned int bitmask;
unsigned char *bitmap_ = bitmap;
TRACE(" - bbox: %d x %d\n", gm.gmBlackBoxX, gm.gmBlackBoxY);
TRACE(" - origin: (%d, %d)\n", gm.gmptGlyphOrigin.x, gm.gmptGlyphOrigin.y);
TRACE(" - increment: %d - %d\n", gm.gmCellIncX, gm.gmCellIncY);
if (needed_size != 0) {
TRACE(" - bitmap:\n");
for (height = 0; height < gm.gmBlackBoxY; height++) {
TRACE(" ");
for (width = 0, bitmask = 0x80; width < gm.gmBlackBoxX; width++, bitmask >>= 1) {
if (bitmask == 0) {
bitmap_ += 1;
bitmask = 0x80;
}
if (*bitmap_ & bitmask)
TRACE("*");
else
TRACE(" ");
}
bitmap_ += (4 - ((UINT_PTR)bitmap_ & 0x03));
TRACE("\n");
}
}
}
/* In OpenGL, the bitmap is drawn from the bottom to the top... So we need to invert the
* glyph for it to be drawn properly.
*/
if (needed_size != 0) {
width_int = (gm.gmBlackBoxX + 31) / 32;
for (height = 0; height < gm.gmBlackBoxY; height++) {
for (width = 0; width < width_int; width++) {
((int *) gl_bitmap)[(gm.gmBlackBoxY - height - 1) * width_int + width] =
((int *) bitmap)[height * width_int + width];
}
}
}
glNewList(listBase++, GL_COMPILE);
if (needed_size != 0) {
glBitmap(gm.gmBlackBoxX, gm.gmBlackBoxY,
0 - gm.gmptGlyphOrigin.x, (int) gm.gmBlackBoxY - gm.gmptGlyphOrigin.y,
gm.gmCellIncX, gm.gmCellIncY,
gl_bitmap);
} else {
/* This is the case of 'empty' glyphs like the space character */
glBitmap(0, 0, 0, 0, gm.gmCellIncX, gm.gmCellIncY, NULL);
}
glEndList();
}
glPixelStorei(GL_UNPACK_ALIGNMENT, org_alignment);
HeapFree(GetProcessHeap(), 0, bitmap);
HeapFree(GetProcessHeap(), 0, gl_bitmap);
return ret;
}
/***********************************************************************
* wglUseFontBitmapsA (OPENGL32.@)
*/
BOOL WINAPI wglUseFontBitmapsA(HDC hdc, DWORD first, DWORD count, DWORD listBase)
{
return wglUseFontBitmaps_common( hdc, first, count, listBase, FALSE );
}
/***********************************************************************
* wglUseFontBitmapsW (OPENGL32.@)
*/
BOOL WINAPI wglUseFontBitmapsW(HDC hdc, DWORD first, DWORD count, DWORD listBase)
{
return wglUseFontBitmaps_common( hdc, first, count, listBase, TRUE );
}
/* FIXME: should probably have a glu.h header */
typedef struct GLUtesselator GLUtesselator;
typedef void (WINAPI *_GLUfuncptr)(void);
#define GLU_TESS_BEGIN 100100
#define GLU_TESS_VERTEX 100101
#define GLU_TESS_END 100102
static GLUtesselator * (WINAPI *pgluNewTess)(void);
static void (WINAPI *pgluDeleteTess)(GLUtesselator *tess);
static void (WINAPI *pgluTessNormal)(GLUtesselator *tess, GLdouble x, GLdouble y, GLdouble z);
static void (WINAPI *pgluTessBeginPolygon)(GLUtesselator *tess, void *polygon_data);
static void (WINAPI *pgluTessEndPolygon)(GLUtesselator *tess);
static void (WINAPI *pgluTessCallback)(GLUtesselator *tess, GLenum which, _GLUfuncptr fn);
static void (WINAPI *pgluTessBeginContour)(GLUtesselator *tess);
static void (WINAPI *pgluTessEndContour)(GLUtesselator *tess);
static void (WINAPI *pgluTessVertex)(GLUtesselator *tess, GLdouble *location, GLvoid* data);
static HMODULE load_libglu(void)
{
static const WCHAR glu32W[] = {'g','l','u','3','2','.','d','l','l',0};
static int already_loaded;
static HMODULE module;
if (already_loaded) return module;
already_loaded = 1;
TRACE("Trying to load GLU library\n");
module = LoadLibraryW( glu32W );
if (!module)
{
WARN("Failed to load glu32\n");
return NULL;
}
#define LOAD_FUNCPTR(f) p##f = (void *)GetProcAddress( module, #f )
LOAD_FUNCPTR(gluNewTess);
LOAD_FUNCPTR(gluDeleteTess);
LOAD_FUNCPTR(gluTessBeginContour);
LOAD_FUNCPTR(gluTessNormal);
LOAD_FUNCPTR(gluTessBeginPolygon);
LOAD_FUNCPTR(gluTessCallback);
LOAD_FUNCPTR(gluTessEndContour);
LOAD_FUNCPTR(gluTessEndPolygon);
LOAD_FUNCPTR(gluTessVertex);
#undef LOAD_FUNCPTR
return module;
}
static void fixed_to_double(POINTFX fixed, UINT em_size, GLdouble vertex[3])
{
vertex[0] = (fixed.x.value + (GLdouble)fixed.x.fract / (1 << 16)) / em_size;
vertex[1] = (fixed.y.value + (GLdouble)fixed.y.fract / (1 << 16)) / em_size;
vertex[2] = 0.0;
}
static void WINAPI tess_callback_vertex(GLvoid *vertex)
{
GLdouble *dbl = vertex;
TRACE("%f, %f, %f\n", dbl[0], dbl[1], dbl[2]);
glVertex3dv(vertex);
}
static void WINAPI tess_callback_begin(GLenum which)
{
TRACE("%d\n", which);
glBegin(which);
}
static void WINAPI tess_callback_end(void)
{
TRACE("\n");
glEnd();
}
typedef struct _bezier_vector {
GLdouble x;
GLdouble y;
} bezier_vector;
static double bezier_deviation_squared(const bezier_vector *p)
{
bezier_vector deviation;
bezier_vector vertex;
bezier_vector base;
double base_length;
double dot;
vertex.x = (p[0].x + p[1].x*2 + p[2].x)/4 - p[0].x;
vertex.y = (p[0].y + p[1].y*2 + p[2].y)/4 - p[0].y;
base.x = p[2].x - p[0].x;
base.y = p[2].y - p[0].y;
base_length = sqrt(base.x*base.x + base.y*base.y);
base.x /= base_length;
base.y /= base_length;
dot = base.x*vertex.x + base.y*vertex.y;
dot = min(max(dot, 0.0), base_length);
base.x *= dot;
base.y *= dot;
deviation.x = vertex.x-base.x;
deviation.y = vertex.y-base.y;
return deviation.x*deviation.x + deviation.y*deviation.y;
}
static int bezier_approximate(const bezier_vector *p, bezier_vector *points, FLOAT deviation)
{
bezier_vector first_curve[3];
bezier_vector second_curve[3];
bezier_vector vertex;
int total_vertices;
if(bezier_deviation_squared(p) <= deviation*deviation)
{
if(points)
*points = p[2];
return 1;
}
vertex.x = (p[0].x + p[1].x*2 + p[2].x)/4;
vertex.y = (p[0].y + p[1].y*2 + p[2].y)/4;
first_curve[0] = p[0];
first_curve[1].x = (p[0].x + p[1].x)/2;
first_curve[1].y = (p[0].y + p[1].y)/2;
first_curve[2] = vertex;
second_curve[0] = vertex;
second_curve[1].x = (p[2].x + p[1].x)/2;
second_curve[1].y = (p[2].y + p[1].y)/2;
second_curve[2] = p[2];
total_vertices = bezier_approximate(first_curve, points, deviation);
if(points)
points += total_vertices;
total_vertices += bezier_approximate(second_curve, points, deviation);
return total_vertices;
}
/***********************************************************************
* wglUseFontOutlines_common
*/
static BOOL wglUseFontOutlines_common(HDC hdc,
DWORD first,
DWORD count,
DWORD listBase,
FLOAT deviation,
FLOAT extrusion,
int format,
LPGLYPHMETRICSFLOAT lpgmf,
BOOL unicode)
{
UINT glyph;
const MAT2 identity = {{0,1},{0,0},{0,0},{0,1}};
GLUtesselator *tess = NULL;
LOGFONTW lf;
HFONT old_font, unscaled_font;
UINT em_size = 1024;
RECT rc;
TRACE("(%p, %d, %d, %d, %f, %f, %d, %p, %s)\n", hdc, first, count,
listBase, deviation, extrusion, format, lpgmf, unicode ? "W" : "A");
if(deviation <= 0.0)
deviation = 1.0/em_size;
if(format == WGL_FONT_POLYGONS)
{
if (!load_libglu())
{
ERR("glu32 is required for this function but isn't available\n");
return FALSE;
}
tess = pgluNewTess();
if(!tess) return FALSE;
pgluTessCallback(tess, GLU_TESS_VERTEX, (_GLUfuncptr)tess_callback_vertex);
pgluTessCallback(tess, GLU_TESS_BEGIN, (_GLUfuncptr)tess_callback_begin);
pgluTessCallback(tess, GLU_TESS_END, tess_callback_end);
}
GetObjectW(GetCurrentObject(hdc, OBJ_FONT), sizeof(lf), &lf);
rc.left = rc.right = rc.bottom = 0;
rc.top = em_size;
DPtoLP(hdc, (POINT*)&rc, 2);
lf.lfHeight = -abs(rc.top - rc.bottom);
lf.lfOrientation = lf.lfEscapement = 0;
unscaled_font = CreateFontIndirectW(&lf);
old_font = SelectObject(hdc, unscaled_font);
for (glyph = first; glyph < first + count; glyph++)
{
DWORD needed;
GLYPHMETRICS gm;
BYTE *buf;
TTPOLYGONHEADER *pph;
TTPOLYCURVE *ppc;
GLdouble *vertices = NULL;
int vertex_total = -1;
if(unicode)
needed = GetGlyphOutlineW(hdc, glyph, GGO_NATIVE, &gm, 0, NULL, &identity);
else
needed = GetGlyphOutlineA(hdc, glyph, GGO_NATIVE, &gm, 0, NULL, &identity);
if(needed == GDI_ERROR)
goto error;
buf = HeapAlloc(GetProcessHeap(), 0, needed);
if(unicode)
GetGlyphOutlineW(hdc, glyph, GGO_NATIVE, &gm, needed, buf, &identity);
else
GetGlyphOutlineA(hdc, glyph, GGO_NATIVE, &gm, needed, buf, &identity);
TRACE("glyph %d\n", glyph);
if(lpgmf)
{
lpgmf->gmfBlackBoxX = (float)gm.gmBlackBoxX / em_size;
lpgmf->gmfBlackBoxY = (float)gm.gmBlackBoxY / em_size;
lpgmf->gmfptGlyphOrigin.x = (float)gm.gmptGlyphOrigin.x / em_size;
lpgmf->gmfptGlyphOrigin.y = (float)gm.gmptGlyphOrigin.y / em_size;
lpgmf->gmfCellIncX = (float)gm.gmCellIncX / em_size;
lpgmf->gmfCellIncY = (float)gm.gmCellIncY / em_size;
TRACE("%fx%f at %f,%f inc %f,%f\n", lpgmf->gmfBlackBoxX, lpgmf->gmfBlackBoxY,
lpgmf->gmfptGlyphOrigin.x, lpgmf->gmfptGlyphOrigin.y, lpgmf->gmfCellIncX, lpgmf->gmfCellIncY);
lpgmf++;
}
glNewList(listBase++, GL_COMPILE);
glFrontFace(GL_CCW);
if(format == WGL_FONT_POLYGONS)
{
glNormal3d(0.0, 0.0, 1.0);
pgluTessNormal(tess, 0, 0, 1);
pgluTessBeginPolygon(tess, NULL);
}
while(!vertices)
{
if(vertex_total != -1)
vertices = HeapAlloc(GetProcessHeap(), 0, vertex_total * 3 * sizeof(GLdouble));
vertex_total = 0;
pph = (TTPOLYGONHEADER*)buf;
while((BYTE*)pph < buf + needed)
{
GLdouble previous[3];
fixed_to_double(pph->pfxStart, em_size, previous);
if(vertices)
TRACE("\tstart %d, %d\n", pph->pfxStart.x.value, pph->pfxStart.y.value);
if(format == WGL_FONT_POLYGONS)
pgluTessBeginContour(tess);
else
glBegin(GL_LINE_LOOP);
if(vertices)
{
fixed_to_double(pph->pfxStart, em_size, vertices);
if(format == WGL_FONT_POLYGONS)
pgluTessVertex(tess, vertices, vertices);
else
glVertex3d(vertices[0], vertices[1], vertices[2]);
vertices += 3;
}
vertex_total++;
ppc = (TTPOLYCURVE*)((char*)pph + sizeof(*pph));
while((char*)ppc < (char*)pph + pph->cb)
{
int i, j;
int num;
switch(ppc->wType) {
case TT_PRIM_LINE:
for(i = 0; i < ppc->cpfx; i++)
{
if(vertices)
{
TRACE("\t\tline to %d, %d\n",
ppc->apfx[i].x.value, ppc->apfx[i].y.value);
fixed_to_double(ppc->apfx[i], em_size, vertices);
if(format == WGL_FONT_POLYGONS)
pgluTessVertex(tess, vertices, vertices);
else
glVertex3d(vertices[0], vertices[1], vertices[2]);
vertices += 3;
}
fixed_to_double(ppc->apfx[i], em_size, previous);
vertex_total++;
}
break;
case TT_PRIM_QSPLINE:
for(i = 0; i < ppc->cpfx-1; i++)
{
bezier_vector curve[3];
bezier_vector *points;
GLdouble curve_vertex[3];
if(vertices)
TRACE("\t\tcurve %d,%d %d,%d\n",
ppc->apfx[i].x.value, ppc->apfx[i].y.value,
ppc->apfx[i + 1].x.value, ppc->apfx[i + 1].y.value);
curve[0].x = previous[0];
curve[0].y = previous[1];
fixed_to_double(ppc->apfx[i], em_size, curve_vertex);
curve[1].x = curve_vertex[0];
curve[1].y = curve_vertex[1];
fixed_to_double(ppc->apfx[i + 1], em_size, curve_vertex);
curve[2].x = curve_vertex[0];
curve[2].y = curve_vertex[1];
if(i < ppc->cpfx-2)
{
curve[2].x = (curve[1].x + curve[2].x)/2;
curve[2].y = (curve[1].y + curve[2].y)/2;
}
num = bezier_approximate(curve, NULL, deviation);
points = HeapAlloc(GetProcessHeap(), 0, num*sizeof(bezier_vector));
num = bezier_approximate(curve, points, deviation);
vertex_total += num;
if(vertices)
{
for(j=0; j<num; j++)
{
TRACE("\t\t\tvertex at %f,%f\n", points[j].x, points[j].y);
vertices[0] = points[j].x;
vertices[1] = points[j].y;
vertices[2] = 0.0;
if(format == WGL_FONT_POLYGONS)
pgluTessVertex(tess, vertices, vertices);
else
glVertex3d(vertices[0], vertices[1], vertices[2]);
vertices += 3;
}
}
HeapFree(GetProcessHeap(), 0, points);
previous[0] = curve[2].x;
previous[1] = curve[2].y;
}
break;
default:
ERR("\t\tcurve type = %d\n", ppc->wType);
if(format == WGL_FONT_POLYGONS)
pgluTessEndContour(tess);
else
glEnd();
goto error_in_list;
}
ppc = (TTPOLYCURVE*)((char*)ppc + sizeof(*ppc) +
(ppc->cpfx - 1) * sizeof(POINTFX));
}
if(format == WGL_FONT_POLYGONS)
pgluTessEndContour(tess);
else
glEnd();
pph = (TTPOLYGONHEADER*)((char*)pph + pph->cb);
}
}
error_in_list:
if(format == WGL_FONT_POLYGONS)
pgluTessEndPolygon(tess);
glTranslated((GLdouble)gm.gmCellIncX / em_size, (GLdouble)gm.gmCellIncY / em_size, 0.0);
glEndList();
HeapFree(GetProcessHeap(), 0, buf);
HeapFree(GetProcessHeap(), 0, vertices);
}
error:
DeleteObject(SelectObject(hdc, old_font));
if(format == WGL_FONT_POLYGONS)
pgluDeleteTess(tess);
return TRUE;
}
/***********************************************************************
* wglUseFontOutlinesA (OPENGL32.@)
*/
BOOL WINAPI wglUseFontOutlinesA(HDC hdc,
DWORD first,
DWORD count,
DWORD listBase,
FLOAT deviation,
FLOAT extrusion,
int format,
LPGLYPHMETRICSFLOAT lpgmf)
{
return wglUseFontOutlines_common(hdc, first, count, listBase, deviation, extrusion, format, lpgmf, FALSE);
}
/***********************************************************************
* wglUseFontOutlinesW (OPENGL32.@)
*/
BOOL WINAPI wglUseFontOutlinesW(HDC hdc,
DWORD first,
DWORD count,
DWORD listBase,
FLOAT deviation,
FLOAT extrusion,
int format,
LPGLYPHMETRICSFLOAT lpgmf)
{
return wglUseFontOutlines_common(hdc, first, count, listBase, deviation, extrusion, format, lpgmf, TRUE);
}

134
dll/opengl/opengl32/gl.c Normal file
View file

@ -0,0 +1,134 @@
/*
* 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...)
*/
#include "opengl32.h"
#if defined(_M_IX86)
C_ASSERT(FIELD_OFFSET(TEB, glTable) == 0xbe8);
#endif
int WINAPI glEmptyFunc0( void ) { return 0; }
int WINAPI glEmptyFunc4( long l1 ) { return 0; }
int WINAPI glEmptyFunc8( long l1, long l2 ) { return 0; }
int WINAPI glEmptyFunc12( long l1, long l2, long l3 ) { return 0; }
int WINAPI glEmptyFunc16( long l1, long l2, long l3, long l4 ) { return 0; }
int WINAPI glEmptyFunc20( long l1, long l2, long l3, long l4, long l5 )
{ return 0; }
int WINAPI glEmptyFunc24( long l1, long l2, long l3, long l4, long l5,
long l6 ) { return 0; }
int WINAPI glEmptyFunc28( long l1, long l2, long l3, long l4, long l5,
long l6, long l7 ) { return 0; }
int WINAPI glEmptyFunc32( long l1, long l2, long l3, long l4, long l5,
long l6, long l7, long l8 ) { return 0; }
int WINAPI glEmptyFunc36( long l1, long l2, long l3, long l4, long l5,
long l6, long l7, long l8, long l9 ) { return 0; }
int WINAPI glEmptyFunc40( long l1, long l2, long l3, long l4, long l5,
long l6, long l7, long l8, long l9, long l10 )
{ return 0; }
int WINAPI 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 WINAPI 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 WINAPI 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 WINAPI 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 defined(_M_IX86)
# define FOO(x) #x
#ifdef __GNUC__
# define X(func, ret, typeargs, args, icdidx, tebidx, stack) \
__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");
#elif defined(_MSC_VER)
# define X(func, ret, typeargs, args, icdidx, tebidx, stack) \
__declspec(naked) ret WINAPI func typeargs \
{ \
__asm { mov eax, dword ptr fs:[18h] }; \
__asm { mov eax, dword ptr [eax+0be8h] }; \
__asm { jmp dword ptr [eax+icdidx*4] }; \
}
#else
# define X(func, ret, typeargs, args, icdidx, tebidx, stack) \
ret WINAPI 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; \
}
#endif
GLFUNCS_MACRO
# undef FOO
# undef X
#else /* defined(_M_IX86) */
# define X(func, ret, typeargs, args, icdidx, tebidx, stack) \
ret WINAPI 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; \
}
GLFUNCS_MACRO
# undef X
#endif /* !defined(_M_IX86) */
/* Unknown debugging function */
GLint WINAPI glDebugEntry( GLint unknown1, GLint unknown2 )
{
return 0;
}
/* EOF */

View file

@ -0,0 +1,357 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: lib/opengl32/glfuncs.h
* PURPOSE: OpenGL32 lib, GLFUNCS_MACRO
* PROGRAMMER: gen_glfuncs_macro.sh
* UPDATE HISTORY:
* !!! AUTOMATICALLY CREATED FROM glfuncs.csv !!!
*/
/* To use this macro define a macro X(name, ret, typeargs, args, icdidx, tebidx, stack).
* It gets called for every glXXX function. i.e. glVertex3f: name = "glVertex3f",
* ret = "void", typeargs = "(GLfloat x, GLfloat y, GLfloat z)", args = "(x,y,z)",
* icdidx = "136", tebidx = "98" and stack = "12".
* Don't forget to undefine X ;-)
*/
#define GLFUNCS_MACRO \
X(glAccum, void, (GLenum op, GLfloat value), (op,value), 213, -1, 8) \
X(glAlphaFunc, void, (GLenum func, GLclampf ref), (func,ref), 240, -1, 8) \
X(glAreTexturesResident, GLboolean, (GLsizei n, const GLuint *textures, GLboolean *residences), (n,textures,residences), 322, -1, 12) \
X(glArrayElement, void, (GLint i), (i), 306, 144, 4) \
X(glBegin, void, (GLenum mode), (mode), 7, 2, 4) \
X(glBindTexture, void, (GLenum target, GLuint texture), (target,texture), 307, 145, 8) \
X(glBitmap, void, (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap), (width,height,xorig,yorig,xmove,ymove,bitmap), 8, -1, 28) \
X(glBlendFunc, void, (GLenum sfactor, GLenum dfactor), (sfactor,dfactor), 241, -1, 8) \
X(glCallList, void, (GLuint list), (list), 2, 0, 4) \
X(glCallLists, void, (GLsizei n, GLenum type, const GLvoid *lists), (n,type,lists), 3, 1, 12) \
X(glClear, void, (GLbitfield mask), (mask), 203, -1, 4) \
X(glClearAccum, void, (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha), (red,green,blue,alpha), 204, -1, 16) \
X(glClearColor, void, (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha), (red,green,blue,alpha), 206, -1, 16) \
X(glClearDepth, void, (GLclampd depth), (depth), 208, -1, 8) \
X(glClearIndex, void, (GLfloat c), (c), 205, -1, 4) \
X(glClearStencil, void, (GLint s), (s), 207, -1, 4) \
X(glClipPlane, void, (GLenum plane, const GLdouble *equation), (plane,equation), 150, -1, 8) \
X(glColor3b, void, (GLbyte red, GLbyte green, GLbyte blue), (red,green,blue), 9, 3, 12) \
X(glColor3bv, void, (const GLbyte *v), (v), 10, 4, 4) \
X(glColor3d, void, (GLdouble red, GLdouble green, GLdouble blue), (red,green,blue), 11, 5, 24) \
X(glColor3dv, void, (const GLdouble *v), (v), 12, 6, 4) \
X(glColor3f, void, (GLfloat red, GLfloat green, GLfloat blue), (red,green,blue), 13, 7, 12) \
X(glColor3fv, void, (const GLfloat *v), (v), 14, 8, 4) \
X(glColor3i, void, (GLint red, GLint green, GLint blue), (red,green,blue), 15, 9, 12) \
X(glColor3iv, void, (const GLint *v), (v), 16, 10, 4) \
X(glColor3s, void, (GLshort red, GLshort green, GLshort blue), (red,green,blue), 17, 11, 12) \
X(glColor3sv, void, (const GLshort *v), (v), 18, 12, 4) \
X(glColor3ub, void, (GLubyte red, GLubyte green, GLubyte blue), (red,green,blue), 19, 13, 12) \
X(glColor3ubv, void, (const GLubyte *v), (v), 20, 14, 4) \
X(glColor3ui, void, (GLuint red, GLuint green, GLuint blue), (red,green,blue), 21, 15, 12) \
X(glColor3uiv, void, (const GLuint *v), (v), 22, 16, 4) \
X(glColor3us, void, (GLushort red, GLushort green, GLushort blue), (red,green,blue), 23, 17, 12) \
X(glColor3usv, void, (const GLushort *v), (v), 24, 18, 4) \
X(glColor4b, void, (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha), (red,green,blue,alpha), 25, 19, 16) \
X(glColor4bv, void, (const GLbyte *v), (v), 26, 20, 4) \
X(glColor4d, void, (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha), (red,green,blue,alpha), 27, 21, 32) \
X(glColor4dv, void, (const GLdouble *v), (v), 28, 22, 4) \
X(glColor4f, void, (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha), (red,green,blue,alpha), 29, 23, 16) \
X(glColor4fv, void, (const GLfloat *v), (v), 30, 24, 4) \
X(glColor4i, void, (GLint red, GLint green, GLint blue, GLint alpha), (red,green,blue,alpha), 31, 25, 16) \
X(glColor4iv, void, (const GLint *v), (v), 32, 26, 4) \
X(glColor4s, void, (GLshort red, GLshort green, GLshort blue, GLshort alpha), (red,green,blue,alpha), 33, 27, 16) \
X(glColor4sv, void, (const GLshort *v), (v), 34, 28, 4) \
X(glColor4ub, void, (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha), (red,green,blue,alpha), 35, 29, 16) \
X(glColor4ubv, void, (const GLubyte *v), (v), 36, 30, 4) \
X(glColor4ui, void, (GLuint red, GLuint green, GLuint blue, GLuint alpha), (red,green,blue,alpha), 37, 31, 16) \
X(glColor4uiv, void, (const GLuint *v), (v), 38, 32, 4) \
X(glColor4us, void, (GLushort red, GLushort green, GLushort blue, GLushort alpha), (red,green,blue,alpha), 39, 33, 16) \
X(glColor4usv, void, (const GLushort *v), (v), 40, 34, 4) \
X(glColorMask, void, (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha), (red,green,blue,alpha), 210, -1, 16) \
X(glColorMaterial, void, (GLenum face, GLenum mode), (face,mode), 151, -1, 8) \
X(glColorPointer, void, (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer), (size,type,stride,pointer), 308, 146, 16) \
X(glCopyPixels, void, (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type), (x,y,width,height,type), 255, -1, 20) \
X(glCopyTexImage1D, void, (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border), (target,level,internalformat,x,y,width,border), 323, -1, 28) \
X(glCopyTexImage2D, void, (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border), (target,level,internalformat,x,y,width,height,border), 324, -1, 32) \
X(glCopyTexSubImage1D, void, (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width), (target,level,xoffset,x,y,width), 325, -1, 24) \
X(glCopyTexSubImage2D, void, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height), (target,level,xoffset,yoffset,x,y,width,height), 326, -1, 32) \
X(glCullFace, void, (GLenum mode), (mode), 152, -1, 4) \
X(glDeleteLists, void, (GLuint list, GLsizei range), (list,range), 4, -1, 8) \
X(glDeleteTextures, void, (GLsizei n, const GLuint *textures), (n,textures), 327, -1, 8) \
X(glDepthFunc, void, (GLenum func), (func), 245, -1, 4) \
X(glDepthMask, void, (GLboolean flag), (flag), 211, -1, 4) \
X(glDepthRange, void, (GLclampd zNear, GLclampd zFar), (zNear,zFar), 288, -1, 16) \
X(glDisable, void, (GLenum cap), (cap), 214, 116, 4) \
X(glDisableClientState, void, (GLenum array), (array), 309, 147, 4) \
X(glDrawArrays, void, (GLenum mode, GLint first, GLsizei count), (mode,first,count), 310, 148, 12) \
X(glDrawBuffer, void, (GLenum mode), (mode), 202, -1, 4) \
X(glDrawElements, void, (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices), (mode,count,type,indices), 311, 149, 16) \
X(glDrawPixels, void, (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels), (width,height,format,type,pixels), 257, -1, 20) \
X(glEdgeFlag, void, (GLboolean flag), (flag), 41, 35, 4) \
X(glEdgeFlagPointer, void, (GLsizei stride, const GLvoid *pointer), (stride,pointer), 312, 150, 8) \
X(glEdgeFlagv, void, (const GLboolean *flag), (flag), 42, 36, 4) \
X(glEnable, void, (GLenum cap), (cap), 215, 117, 4) \
X(glEnableClientState, void, (GLenum array), (array), 313, 151, 4) \
X(glEnd, void, (void), (), 43, 37, 0) \
X(glEndList, void, (void), (), 1, -1, 0) \
X(glEvalCoord1d, void, (GLdouble u), (u), 228, 120, 8) \
X(glEvalCoord1dv, void, (const GLdouble *u), (u), 229, 121, 4) \
X(glEvalCoord1f, void, (GLfloat u), (u), 230, 122, 4) \
X(glEvalCoord1fv, void, (const GLfloat *u), (u), 231, 123, 4) \
X(glEvalCoord2d, void, (GLdouble u, GLdouble v), (u,v), 232, 124, 16) \
X(glEvalCoord2dv, void, (const GLdouble *u), (u), 233, 125, 4) \
X(glEvalCoord2f, void, (GLfloat u, GLfloat v), (u,v), 234, 126, 8) \
X(glEvalCoord2fv, void, (const GLfloat *u), (u), 235, 127, 4) \
X(glEvalMesh1, void, (GLenum mode, GLint i1, GLint i2), (mode,i1,i2), 236, -1, 12) \
X(glEvalMesh2, void, (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2), (mode,i1,i2,j1,j2), 238, -1, 20) \
X(glEvalPoint1, void, (GLint i), (i), 237, 128, 4) \
X(glEvalPoint2, void, (GLint i, GLint j), (i,j), 239, 129, 8) \
X(glFeedbackBuffer, void, (GLsizei size, GLenum type, GLfloat *buffer), (size,type,buffer), 194, -1, 12) \
X(glFinish, void, (void), (), 216, -1, 0) \
X(glFlush, void, (void), (), 217, -1, 0) \
X(glFogf, void, (GLenum pname, GLfloat param), (pname,param), 153, -1, 8) \
X(glFogfv, void, (GLenum pname, const GLfloat *params), (pname,params), 154, -1, 8) \
X(glFogi, void, (GLenum pname, GLint param), (pname,param), 155, -1, 8) \
X(glFogiv, void, (GLenum pname, const GLint *params), (pname,params), 156, -1, 8) \
X(glFrontFace, void, (GLenum mode), (mode), 157, -1, 4) \
X(glFrustum, void, (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar), (left,right,bottom,top,zNear,zFar), 289, -1, 48) \
X(glGenLists, GLuint, (GLsizei range), (range), 5, -1, 4) \
X(glGenTextures, void, (GLsizei n, GLuint *textures), (n,textures), 328, -1, 8) \
X(glGetBooleanv, void, (GLenum pname, GLboolean *params), (pname,params), 258, -1, 8) \
X(glGetClipPlane, void, (GLenum plane, GLdouble *equation), (plane,equation), 259, -1, 8) \
X(glGetDoublev, void, (GLenum pname, GLdouble *params), (pname,params), 260, -1, 8) \
X(glGetError, GLenum, (void), (), 261, -1, 0) \
X(glGetFloatv, void, (GLenum pname, GLfloat *params), (pname,params), 262, -1, 8) \
X(glGetIntegerv, void, (GLenum pname, GLint *params), (pname,params), 263, -1, 8) \
X(glGetLightfv, void, (GLenum light, GLenum pname, GLfloat *params), (light,pname,params), 264, -1, 12) \
X(glGetLightiv, void, (GLenum light, GLenum pname, GLint *params), (light,pname,params), 265, -1, 12) \
X(glGetMapdv, void, (GLenum target, GLenum query, GLdouble *v), (target,query,v), 266, -1, 12) \
X(glGetMapfv, void, (GLenum target, GLenum query, GLfloat *v), (target,query,v), 267, -1, 12) \
X(glGetMapiv, void, (GLenum target, GLenum query, GLint *v), (target,query,v), 268, -1, 12) \
X(glGetMaterialfv, void, (GLenum face, GLenum pname, GLfloat *params), (face,pname,params), 269, -1, 12) \
X(glGetMaterialiv, void, (GLenum face, GLenum pname, GLint *params), (face,pname,params), 270, -1, 12) \
X(glGetPixelMapfv, void, (GLenum map, GLfloat *values), (map,values), 271, -1, 8) \
X(glGetPixelMapuiv, void, (GLenum map, GLuint *values), (map,values), 272, -1, 8) \
X(glGetPixelMapusv, void, (GLenum map, GLushort *values), (map,values), 273, -1, 8) \
X(glGetPointerv, void, (GLenum pname, GLvoid* *params), (pname,params), 329, 160, 8) \
X(glGetPolygonStipple, void, (GLubyte *mask), (mask), 274, -1, 4) \
X(glGetString, const GLubyte *, (GLenum name), (name), 275, -1, 4) \
X(glGetTexEnvfv, void, (GLenum target, GLenum pname, GLfloat *params), (target,pname,params), 276, -1, 12) \
X(glGetTexEnviv, void, (GLenum target, GLenum pname, GLint *params), (target,pname,params), 277, -1, 12) \
X(glGetTexGendv, void, (GLenum coord, GLenum pname, GLdouble *params), (coord,pname,params), 278, -1, 12) \
X(glGetTexGenfv, void, (GLenum coord, GLenum pname, GLfloat *params), (coord,pname,params), 279, -1, 12) \
X(glGetTexGeniv, void, (GLenum coord, GLenum pname, GLint *params), (coord,pname,params), 280, -1, 12) \
X(glGetTexImage, void, (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels), (target,level,format,type,pixels), 281, -1, 20) \
X(glGetTexLevelParameterfv, void, (GLenum target, GLint level, GLenum pname, GLfloat *params), (target,level,pname,params), 284, -1, 16) \
X(glGetTexLevelParameteriv, void, (GLenum target, GLint level, GLenum pname, GLint *params), (target,level,pname,params), 285, -1, 16) \
X(glGetTexParameterfv, void, (GLenum target, GLenum pname, GLfloat *params), (target,pname,params), 282, -1, 12) \
X(glGetTexParameteriv, void, (GLenum target, GLenum pname, GLint *params), (target,pname,params), 283, -1, 12) \
X(glHint, void, (GLenum target, GLenum mode), (target,mode), 158, -1, 8) \
X(glIndexMask, void, (GLuint mask), (mask), 212, -1, 4) \
X(glIndexPointer, void, (GLenum type, GLsizei stride, const GLvoid *pointer), (type,stride,pointer), 314, 152, 12) \
X(glIndexd, void, (GLdouble c), (c), 44, 38, 8) \
X(glIndexdv, void, (const GLdouble *c), (c), 45, 39, 4) \
X(glIndexf, void, (GLfloat c), (c), 46, 40, 4) \
X(glIndexfv, void, (const GLfloat *c), (c), 47, 41, 4) \
X(glIndexi, void, (GLint c), (c), 48, 42, 4) \
X(glIndexiv, void, (const GLint *c), (c), 49, 43, 4) \
X(glIndexs, void, (GLshort c), (c), 50, 44, 4) \
X(glIndexsv, void, (const GLshort *c), (c), 51, 45, 4) \
X(glIndexub, void, (GLubyte c), (c), 315, 153, 4) \
X(glIndexubv, void, (const GLubyte *c), (c), 316, 154, 4) \
X(glInitNames, void, (void), (), 197, -1, 0) \
X(glInterleavedArrays, void, (GLenum format, GLsizei stride, const GLvoid *pointer), (format,stride,pointer), 317, 155, 12) \
X(glIsEnabled, GLboolean, (GLenum cap), (cap), 286, -1, 4) \
X(glIsList, GLboolean, (GLuint list), (list), 287, -1, 4) \
X(glIsTexture, GLboolean, (GLuint texture), (texture), 330, -1, 4) \
X(glLightModelf, void, (GLenum pname, GLfloat param), (pname,param), 163, -1, 8) \
X(glLightModelfv, void, (GLenum pname, const GLfloat *params), (pname,params), 164, -1, 8) \
X(glLightModeli, void, (GLenum pname, GLint param), (pname,param), 165, -1, 8) \
X(glLightModeliv, void, (GLenum pname, const GLint *params), (pname,params), 166, -1, 8) \
X(glLightf, void, (GLenum light, GLenum pname, GLfloat param), (light,pname,param), 159, -1, 12) \
X(glLightfv, void, (GLenum light, GLenum pname, const GLfloat *params), (light,pname,params), 160, -1, 12) \
X(glLighti, void, (GLenum light, GLenum pname, GLint param), (light,pname,param), 161, -1, 12) \
X(glLightiv, void, (GLenum light, GLenum pname, const GLint *params), (light,pname,params), 162, -1, 12) \
X(glLineStipple, void, (GLint factor, GLushort pattern), (factor,pattern), 167, -1, 8) \
X(glLineWidth, void, (GLfloat width), (width), 168, -1, 4) \
X(glListBase, void, (GLuint base), (base), 6, -1, 4) \
X(glLoadIdentity, void, (void), (), 290, 130, 0) \
X(glLoadMatrixd, void, (const GLdouble *m), (m), 292, 132, 4) \
X(glLoadMatrixf, void, (const GLfloat *m), (m), 291, 131, 4) \
X(glLoadName, void, (GLuint name), (name), 198, -1, 4) \
X(glLogicOp, void, (GLenum opcode), (opcode), 242, -1, 4) \
X(glMap1d, void, (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points), (target,u1,u2,stride,order,points), 220, -1, 32) \
X(glMap1f, void, (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points), (target,u1,u2,stride,order,points), 221, -1, 24) \
X(glMap2d, void, (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points), (target,u1,u2,ustride,uorder,v1,v2,vstride,vorder,points), 222, -1, 56) \
X(glMap2f, void, (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points), (target,u1,u2,ustride,uorder,v1,v2,vstride,vorder,points), 223, -1, 40) \
X(glMapGrid1d, void, (GLint un, GLdouble u1, GLdouble u2), (un,u1,u2), 224, -1, 20) \
X(glMapGrid1f, void, (GLint un, GLfloat u1, GLfloat u2), (un,u1,u2), 225, -1, 12) \
X(glMapGrid2d, void, (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2), (un,u1,u2,vn,v1,v2), 226, -1, 40) \
X(glMapGrid2f, void, (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2), (un,u1,u2,vn,v1,v2), 227, -1, 24) \
X(glMaterialf, void, (GLenum face, GLenum pname, GLfloat param), (face,pname,param), 169, 112, 12) \
X(glMaterialfv, void, (GLenum face, GLenum pname, const GLfloat *params), (face,pname,params), 170, 113, 12) \
X(glMateriali, void, (GLenum face, GLenum pname, GLint param), (face,pname,param), 171, 114, 12) \
X(glMaterialiv, void, (GLenum face, GLenum pname, const GLint *params), (face,pname,params), 172, 115, 12) \
X(glMatrixMode, void, (GLenum mode), (mode), 293, 133, 4) \
X(glMultMatrixd, void, (const GLdouble *m), (m), 295, 135, 4) \
X(glMultMatrixf, void, (const GLfloat *m), (m), 294, 134, 4) \
X(glNewList, void, (GLuint list, GLenum mode), (list,mode), 0, -1, 8) \
X(glNormal3b, void, (GLbyte nx, GLbyte ny, GLbyte nz), (nx,ny,nz), 52, 46, 12) \
X(glNormal3bv, void, (const GLbyte *v), (v), 53, 47, 4) \
X(glNormal3d, void, (GLdouble nx, GLdouble ny, GLdouble nz), (nx,ny,nz), 54, 48, 24) \
X(glNormal3dv, void, (const GLdouble *v), (v), 55, 49, 4) \
X(glNormal3f, void, (GLfloat nx, GLfloat ny, GLfloat nz), (nx,ny,nz), 56, 50, 12) \
X(glNormal3fv, void, (const GLfloat *v), (v), 57, 51, 4) \
X(glNormal3i, void, (GLint nx, GLint ny, GLint nz), (nx,ny,nz), 58, 52, 12) \
X(glNormal3iv, void, (const GLint *v), (v), 59, 53, 4) \
X(glNormal3s, void, (GLshort nx, GLshort ny, GLshort nz), (nx,ny,nz), 60, 54, 12) \
X(glNormal3sv, void, (const GLshort *v), (v), 61, 55, 4) \
X(glNormalPointer, void, (GLenum type, GLsizei stride, const GLvoid *pointer), (type,stride,pointer), 318, 156, 12) \
X(glOrtho, void, (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar), (left,right,bottom,top,zNear,zFar), 296, -1, 48) \
X(glPassThrough, void, (GLfloat token), (token), 199, -1, 4) \
X(glPixelMapfv, void, (GLenum map, GLint mapsize, const GLfloat *values), (map,mapsize,values), 251, -1, 12) \
X(glPixelMapuiv, void, (GLenum map, GLint mapsize, const GLuint *values), (map,mapsize,values), 252, -1, 12) \
X(glPixelMapusv, void, (GLenum map, GLint mapsize, const GLushort *values), (map,mapsize,values), 253, -1, 12) \
X(glPixelStoref, void, (GLenum pname, GLfloat param), (pname,param), 249, -1, 8) \
X(glPixelStorei, void, (GLenum pname, GLint param), (pname,param), 250, -1, 8) \
X(glPixelTransferf, void, (GLenum pname, GLfloat param), (pname,param), 247, -1, 8) \
X(glPixelTransferi, void, (GLenum pname, GLint param), (pname,param), 248, -1, 8) \
X(glPixelZoom, void, (GLfloat xfactor, GLfloat yfactor), (xfactor,yfactor), 246, -1, 8) \
X(glPointSize, void, (GLfloat size), (size), 173, -1, 4) \
X(glPolygonMode, void, (GLenum face, GLenum mode), (face,mode), 174, -1, 8) \
X(glPolygonOffset, void, (GLfloat factor, GLfloat units), (factor,units), 319, 157, 8) \
X(glPolygonStipple, void, (const GLubyte *mask), (mask), 175, -1, 4) \
X(glPopAttrib, void, (void), (), 218, 118, 0) \
X(glPopClientAttrib, void, (void), (), 334, 161, 0) \
X(glPopMatrix, void, (void), (), 297, 136, 0) \
X(glPopName, void, (void), (), 200, -1, 0) \
X(glPrioritizeTextures, void, (GLsizei n, const GLuint *textures, const GLclampf *priorities), (n,textures,priorities), 331, -1, 12) \
X(glPushAttrib, void, (GLbitfield mask), (mask), 219, 119, 4) \
X(glPushClientAttrib, void, (GLbitfield mask), (mask), 335, 162, 4) \
X(glPushMatrix, void, (void), (), 298, 137, 0) \
X(glPushName, void, (GLuint name), (name), 201, -1, 4) \
X(glRasterPos2d, void, (GLdouble x, GLdouble y), (x,y), 62, -1, 16) \
X(glRasterPos2dv, void, (const GLdouble *v), (v), 63, -1, 4) \
X(glRasterPos2f, void, (GLfloat x, GLfloat y), (x,y), 64, -1, 8) \
X(glRasterPos2fv, void, (const GLfloat *v), (v), 65, -1, 4) \
X(glRasterPos2i, void, (GLint x, GLint y), (x,y), 66, -1, 8) \
X(glRasterPos2iv, void, (const GLint *v), (v), 67, -1, 4) \
X(glRasterPos2s, void, (GLshort x, GLshort y), (x,y), 68, -1, 8) \
X(glRasterPos2sv, void, (const GLshort *v), (v), 69, -1, 4) \
X(glRasterPos3d, void, (GLdouble x, GLdouble y, GLdouble z), (x,y,z), 70, -1, 24) \
X(glRasterPos3dv, void, (const GLdouble *v), (v), 71, -1, 4) \
X(glRasterPos3f, void, (GLfloat x, GLfloat y, GLfloat z), (x,y,z), 72, -1, 12) \
X(glRasterPos3fv, void, (const GLfloat *v), (v), 73, -1, 4) \
X(glRasterPos3i, void, (GLint x, GLint y, GLint z), (x,y,z), 74, -1, 12) \
X(glRasterPos3iv, void, (const GLint *v), (v), 75, -1, 4) \
X(glRasterPos3s, void, (GLshort x, GLshort y, GLshort z), (x,y,z), 76, -1, 12) \
X(glRasterPos3sv, void, (const GLshort *v), (v), 77, -1, 4) \
X(glRasterPos4d, void, (GLdouble x, GLdouble y, GLdouble z, GLdouble w), (x,y,z,w), 78, -1, 32) \
X(glRasterPos4dv, void, (const GLdouble *v), (v), 79, -1, 4) \
X(glRasterPos4f, void, (GLfloat x, GLfloat y, GLfloat z, GLfloat w), (x,y,z,w), 80, -1, 16) \
X(glRasterPos4fv, void, (const GLfloat *v), (v), 81, -1, 4) \
X(glRasterPos4i, void, (GLint x, GLint y, GLint z, GLint w), (x,y,z,w), 82, -1, 16) \
X(glRasterPos4iv, void, (const GLint *v), (v), 83, -1, 4) \
X(glRasterPos4s, void, (GLshort x, GLshort y, GLshort z, GLshort w), (x,y,z,w), 84, -1, 16) \
X(glRasterPos4sv, void, (const GLshort *v), (v), 85, -1, 4) \
X(glReadBuffer, void, (GLenum mode), (mode), 254, -1, 4) \
X(glReadPixels, void, (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels), (x,y,width,height,format,type,pixels), 256, -1, 28) \
X(glRectd, void, (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2), (x1,y1,x2,y2), 86, -1, 32) \
X(glRectdv, void, (const GLdouble *v1, const GLdouble *v2), (v1,v2), 87, -1, 8) \
X(glRectf, void, (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2), (x1,y1,x2,y2), 88, -1, 16) \
X(glRectfv, void, (const GLfloat *v1, const GLfloat *v2), (v1,v2), 89, -1, 8) \
X(glRecti, void, (GLint x1, GLint y1, GLint x2, GLint y2), (x1,y1,x2,y2), 90, -1, 16) \
X(glRectiv, void, (const GLint *v1, const GLint *v2), (v1,v2), 91, -1, 8) \
X(glRects, void, (GLshort x1, GLshort y1, GLshort x2, GLshort y2), (x1,y1,x2,y2), 92, -1, 16) \
X(glRectsv, void, (const GLshort *v1, const GLshort *v2), (v1,v2), 93, -1, 8) \
X(glRenderMode, GLint, (GLenum mode), (mode), 196, -1, 4) \
X(glRotated, void, (GLdouble angle, GLdouble x, GLdouble y, GLdouble z), (angle,x,y,z), 299, 138, 32) \
X(glRotatef, void, (GLfloat angle, GLfloat x, GLfloat y, GLfloat z), (angle,x,y,z), 300, 139, 16) \
X(glScaled, void, (GLdouble x, GLdouble y, GLdouble z), (x,y,z), 301, 140, 24) \
X(glScalef, void, (GLfloat x, GLfloat y, GLfloat z), (x,y,z), 302, 141, 12) \
X(glScissor, void, (GLint x, GLint y, GLsizei width, GLsizei height), (x,y,width,height), 176, -1, 16) \
X(glSelectBuffer, void, (GLsizei size, GLuint *buffer), (size,buffer), 195, -1, 8) \
X(glShadeModel, void, (GLenum mode), (mode), 177, -1, 4) \
X(glStencilFunc, void, (GLenum func, GLint ref, GLuint mask), (func,ref,mask), 243, -1, 12) \
X(glStencilMask, void, (GLuint mask), (mask), 209, -1, 4) \
X(glStencilOp, void, (GLenum fail, GLenum zfail, GLenum zpass), (fail,zfail,zpass), 244, -1, 12) \
X(glTexCoord1d, void, (GLdouble s), (s), 94, 56, 8) \
X(glTexCoord1dv, void, (const GLdouble *v), (v), 95, 57, 4) \
X(glTexCoord1f, void, (GLfloat s), (s), 96, 58, 4) \
X(glTexCoord1fv, void, (const GLfloat *v), (v), 97, 59, 4) \
X(glTexCoord1i, void, (GLint s), (s), 98, 60, 4) \
X(glTexCoord1iv, void, (const GLint *v), (v), 99, 61, 4) \
X(glTexCoord1s, void, (GLshort s), (s), 100, 62, 4) \
X(glTexCoord1sv, void, (const GLshort *v), (v), 101, 63, 4) \
X(glTexCoord2d, void, (GLdouble s, GLdouble t), (s,t), 102, 64, 16) \
X(glTexCoord2dv, void, (const GLdouble *v), (v), 103, 65, 4) \
X(glTexCoord2f, void, (GLfloat s, GLfloat t), (s,t), 104, 66, 8) \
X(glTexCoord2fv, void, (const GLfloat *v), (v), 105, 67, 4) \
X(glTexCoord2i, void, (GLint s, GLint t), (s,t), 106, 68, 8) \
X(glTexCoord2iv, void, (const GLint *v), (v), 107, 69, 4) \
X(glTexCoord2s, void, (GLshort s, GLshort t), (s,t), 108, 70, 8) \
X(glTexCoord2sv, void, (const GLshort *v), (v), 109, 71, 4) \
X(glTexCoord3d, void, (GLdouble s, GLdouble t, GLdouble r), (s,t,r), 110, 72, 24) \
X(glTexCoord3dv, void, (const GLdouble *v), (v), 111, 73, 4) \
X(glTexCoord3f, void, (GLfloat s, GLfloat t, GLfloat r), (s,t,r), 112, 74, 12) \
X(glTexCoord3fv, void, (const GLfloat *v), (v), 113, 75, 4) \
X(glTexCoord3i, void, (GLint s, GLint t, GLint r), (s,t,r), 114, 76, 12) \
X(glTexCoord3iv, void, (const GLint *v), (v), 115, 77, 4) \
X(glTexCoord3s, void, (GLshort s, GLshort t, GLshort r), (s,t,r), 116, 78, 12) \
X(glTexCoord3sv, void, (const GLshort *v), (v), 117, 79, 4) \
X(glTexCoord4d, void, (GLdouble s, GLdouble t, GLdouble r, GLdouble q), (s,t,r,q), 118, 80, 32) \
X(glTexCoord4dv, void, (const GLdouble *v), (v), 119, 81, 4) \
X(glTexCoord4f, void, (GLfloat s, GLfloat t, GLfloat r, GLfloat q), (s,t,r,q), 120, 82, 16) \
X(glTexCoord4fv, void, (const GLfloat *v), (v), 121, 83, 4) \
X(glTexCoord4i, void, (GLint s, GLint t, GLint r, GLint q), (s,t,r,q), 122, 84, 16) \
X(glTexCoord4iv, void, (const GLint *v), (v), 123, 85, 4) \
X(glTexCoord4s, void, (GLshort s, GLshort t, GLshort r, GLshort q), (s,t,r,q), 124, 86, 16) \
X(glTexCoord4sv, void, (const GLshort *v), (v), 125, 87, 4) \
X(glTexCoordPointer, void, (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer), (size,type,stride,pointer), 320, 158, 16) \
X(glTexEnvf, void, (GLenum target, GLenum pname, GLfloat param), (target,pname,param), 184, -1, 12) \
X(glTexEnvfv, void, (GLenum target, GLenum pname, const GLfloat *params), (target,pname,params), 185, -1, 12) \
X(glTexEnvi, void, (GLenum target, GLenum pname, GLint param), (target,pname,param), 186, -1, 12) \
X(glTexEnviv, void, (GLenum target, GLenum pname, const GLint *params), (target,pname,params), 187, -1, 12) \
X(glTexGend, void, (GLenum coord, GLenum pname, GLdouble param), (coord,pname,param), 188, -1, 16) \
X(glTexGendv, void, (GLenum coord, GLenum pname, const GLdouble *params), (coord,pname,params), 189, -1, 12) \
X(glTexGenf, void, (GLenum coord, GLenum pname, GLfloat param), (coord,pname,param), 190, -1, 12) \
X(glTexGenfv, void, (GLenum coord, GLenum pname, const GLfloat *params), (coord,pname,params), 191, -1, 12) \
X(glTexGeni, void, (GLenum coord, GLenum pname, GLint param), (coord,pname,param), 192, -1, 12) \
X(glTexGeniv, void, (GLenum coord, GLenum pname, const GLint *params), (coord,pname,params), 193, -1, 12) \
X(glTexImage1D, void, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels), (target,level,internalformat,width,border,format,type,pixels), 182, -1, 32) \
X(glTexImage2D, void, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels), (target,level,internalformat,width,height,border,format,type,pixels), 183, -1, 36) \
X(glTexParameterf, void, (GLenum target, GLenum pname, GLfloat param), (target,pname,param), 178, -1, 12) \
X(glTexParameterfv, void, (GLenum target, GLenum pname, const GLfloat *params), (target,pname,params), 179, -1, 12) \
X(glTexParameteri, void, (GLenum target, GLenum pname, GLint param), (target,pname,param), 180, -1, 12) \
X(glTexParameteriv, void, (GLenum target, GLenum pname, const GLint *params), (target,pname,params), 181, -1, 12) \
X(glTexSubImage1D, void, (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels), (target,level,xoffset,width,format,type,pixels), 332, -1, 28) \
X(glTexSubImage2D, void, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels), (target,level,xoffset,yoffset,width,height,format,type,pixels), 333, -1, 36) \
X(glTranslated, void, (GLdouble x, GLdouble y, GLdouble z), (x,y,z), 303, 142, 24) \
X(glTranslatef, void, (GLfloat x, GLfloat y, GLfloat z), (x,y,z), 304, 143, 12) \
X(glVertex2d, void, (GLdouble x, GLdouble y), (x,y), 126, 88, 16) \
X(glVertex2dv, void, (const GLdouble *v), (v), 127, 89, 4) \
X(glVertex2f, void, (GLfloat x, GLfloat y), (x,y), 128, 90, 8) \
X(glVertex2fv, void, (const GLfloat *v), (v), 129, 91, 4) \
X(glVertex2i, void, (GLint x, GLint y), (x,y), 130, 92, 8) \
X(glVertex2iv, void, (const GLint *v), (v), 131, 93, 4) \
X(glVertex2s, void, (GLshort x, GLshort y), (x,y), 132, 94, 8) \
X(glVertex2sv, void, (const GLshort *v), (v), 133, 95, 4) \
X(glVertex3d, void, (GLdouble x, GLdouble y, GLdouble z), (x,y,z), 134, 96, 24) \
X(glVertex3dv, void, (const GLdouble *v), (v), 135, 97, 4) \
X(glVertex3f, void, (GLfloat x, GLfloat y, GLfloat z), (x,y,z), 136, 98, 12) \
X(glVertex3fv, void, (const GLfloat *v), (v), 137, 99, 4) \
X(glVertex3i, void, (GLint x, GLint y, GLint z), (x,y,z), 138, 100, 12) \
X(glVertex3iv, void, (const GLint *v), (v), 139, 101, 4) \
X(glVertex3s, void, (GLshort x, GLshort y, GLshort z), (x,y,z), 140, 102, 12) \
X(glVertex3sv, void, (const GLshort *v), (v), 141, 103, 4) \
X(glVertex4d, void, (GLdouble x, GLdouble y, GLdouble z, GLdouble w), (x,y,z,w), 142, 104, 32) \
X(glVertex4dv, void, (const GLdouble *v), (v), 143, 105, 4) \
X(glVertex4f, void, (GLfloat x, GLfloat y, GLfloat z, GLfloat w), (x,y,z,w), 144, 106, 16) \
X(glVertex4fv, void, (const GLfloat *v), (v), 145, 107, 4) \
X(glVertex4i, void, (GLint x, GLint y, GLint z, GLint w), (x,y,z,w), 146, 108, 16) \
X(glVertex4iv, void, (const GLint *v), (v), 147, 109, 4) \
X(glVertex4s, void, (GLshort x, GLshort y, GLshort z, GLshort w), (x,y,z,w), 148, 110, 16) \
X(glVertex4sv, void, (const GLshort *v), (v), 149, 111, 4) \
X(glVertexPointer, void, (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer), (size,type,stride,pointer), 321, 159, 16) \
X(glViewport, void, (GLint x, GLint y, GLsizei width, GLsizei height), (x,y,width,height), 305, -1, 16) \
/* EOF */

View file

@ -0,0 +1,336 @@
ICD_ENTRY(glNewList) //0
ICD_ENTRY(glEndList) //1
ICD_ENTRY(glCallList) //2
ICD_ENTRY(glCallLists) //3
ICD_ENTRY(glDeleteLists) //4
ICD_ENTRY(glGenLists) //5
ICD_ENTRY(glListBase) //6
ICD_ENTRY(glBegin) //7
ICD_ENTRY(glBitmap) //8
ICD_ENTRY(glColor3b) //9
ICD_ENTRY(glColor3bv) //10
ICD_ENTRY(glColor3d) //11
ICD_ENTRY(glColor3dv) //12
ICD_ENTRY(glColor3f) //13
ICD_ENTRY(glColor3fv) //14
ICD_ENTRY(glColor3i) //15
ICD_ENTRY(glColor3iv) //16
ICD_ENTRY(glColor3s) //17
ICD_ENTRY(glColor3sv) //18
ICD_ENTRY(glColor3ub) //19
ICD_ENTRY(glColor3ubv) //20
ICD_ENTRY(glColor3ui) //21
ICD_ENTRY(glColor3uiv) //22
ICD_ENTRY(glColor3us) //23
ICD_ENTRY(glColor3usv) //24
ICD_ENTRY(glColor4b) //25
ICD_ENTRY(glColor4bv) //26
ICD_ENTRY(glColor4d) //27
ICD_ENTRY(glColor4dv) //28
ICD_ENTRY(glColor4f) //29
ICD_ENTRY(glColor4fv) //30
ICD_ENTRY(glColor4i) //31
ICD_ENTRY(glColor4iv) //32
ICD_ENTRY(glColor4s) //33
ICD_ENTRY(glColor4sv) //34
ICD_ENTRY(glColor4ub) //35
ICD_ENTRY(glColor4ubv) //36
ICD_ENTRY(glColor4ui) //37
ICD_ENTRY(glColor4uiv) //38
ICD_ENTRY(glColor4us) //39
ICD_ENTRY(glColor4usv) //40
ICD_ENTRY(glEdgeFlag) //41
ICD_ENTRY(glEdgeFlagv) //42
ICD_ENTRY(glEnd) //43
ICD_ENTRY(glIndexd) //44
ICD_ENTRY(glIndexdv) //45
ICD_ENTRY(glIndexf) //46
ICD_ENTRY(glIndexfv) //47
ICD_ENTRY(glIndexi) //48
ICD_ENTRY(glIndexiv) //49
ICD_ENTRY(glIndexs) //50
ICD_ENTRY(glIndexsv) //51
ICD_ENTRY(glNormal3b) //52
ICD_ENTRY(glNormal3bv) //53
ICD_ENTRY(glNormal3d) //54
ICD_ENTRY(glNormal3dv) //55
ICD_ENTRY(glNormal3f) //56
ICD_ENTRY(glNormal3fv) //57
ICD_ENTRY(glNormal3i) //58
ICD_ENTRY(glNormal3iv) //59
ICD_ENTRY(glNormal3s) //60
ICD_ENTRY(glNormal3sv) //61
ICD_ENTRY(glRasterPos2d) //62
ICD_ENTRY(glRasterPos2dv) //63
ICD_ENTRY(glRasterPos2f) //64
ICD_ENTRY(glRasterPos2fv) //65
ICD_ENTRY(glRasterPos2i) //66
ICD_ENTRY(glRasterPos2iv) //67
ICD_ENTRY(glRasterPos2s) //68
ICD_ENTRY(glRasterPos2sv) //69
ICD_ENTRY(glRasterPos3d) //70
ICD_ENTRY(glRasterPos3dv) //71
ICD_ENTRY(glRasterPos3f) //72
ICD_ENTRY(glRasterPos3fv) //73
ICD_ENTRY(glRasterPos3i) //74
ICD_ENTRY(glRasterPos3iv) //75
ICD_ENTRY(glRasterPos3s) //76
ICD_ENTRY(glRasterPos3sv) //77
ICD_ENTRY(glRasterPos4d) //78
ICD_ENTRY(glRasterPos4dv) //79
ICD_ENTRY(glRasterPos4f) //80
ICD_ENTRY(glRasterPos4fv) //81
ICD_ENTRY(glRasterPos4i) //82
ICD_ENTRY(glRasterPos4iv) //83
ICD_ENTRY(glRasterPos4s) //84
ICD_ENTRY(glRasterPos4sv) //85
ICD_ENTRY(glRectd) //86
ICD_ENTRY(glRectdv) //87
ICD_ENTRY(glRectf) //88
ICD_ENTRY(glRectfv) //89
ICD_ENTRY(glRecti) //90
ICD_ENTRY(glRectiv) //91
ICD_ENTRY(glRects) //92
ICD_ENTRY(glRectsv) //93
ICD_ENTRY(glTexCoord1d) //94
ICD_ENTRY(glTexCoord1dv) //95
ICD_ENTRY(glTexCoord1f) //96
ICD_ENTRY(glTexCoord1fv) //97
ICD_ENTRY(glTexCoord1i) //98
ICD_ENTRY(glTexCoord1iv) //99
ICD_ENTRY(glTexCoord1s) //100
ICD_ENTRY(glTexCoord1sv) //101
ICD_ENTRY(glTexCoord2d) //102
ICD_ENTRY(glTexCoord2dv) //103
ICD_ENTRY(glTexCoord2f) //104
ICD_ENTRY(glTexCoord2fv) //105
ICD_ENTRY(glTexCoord2i) //106
ICD_ENTRY(glTexCoord2iv) //107
ICD_ENTRY(glTexCoord2s) //108
ICD_ENTRY(glTexCoord2sv) //109
ICD_ENTRY(glTexCoord3d) //110
ICD_ENTRY(glTexCoord3dv) //111
ICD_ENTRY(glTexCoord3f) //112
ICD_ENTRY(glTexCoord3fv) //113
ICD_ENTRY(glTexCoord3i) //114
ICD_ENTRY(glTexCoord3iv) //115
ICD_ENTRY(glTexCoord3s) //116
ICD_ENTRY(glTexCoord3sv) //117
ICD_ENTRY(glTexCoord4d) //118
ICD_ENTRY(glTexCoord4dv) //119
ICD_ENTRY(glTexCoord4f) //120
ICD_ENTRY(glTexCoord4fv) //121
ICD_ENTRY(glTexCoord4i) //122
ICD_ENTRY(glTexCoord4iv) //123
ICD_ENTRY(glTexCoord4s) //124
ICD_ENTRY(glTexCoord4sv) //125
ICD_ENTRY(glVertex2d) //126
ICD_ENTRY(glVertex2dv) //127
ICD_ENTRY(glVertex2f) //128
ICD_ENTRY(glVertex2fv) //129
ICD_ENTRY(glVertex2i) //130
ICD_ENTRY(glVertex2iv) //131
ICD_ENTRY(glVertex2s) //132
ICD_ENTRY(glVertex2sv) //133
ICD_ENTRY(glVertex3d) //134
ICD_ENTRY(glVertex3dv) //135
ICD_ENTRY(glVertex3f) //136
ICD_ENTRY(glVertex3fv) //137
ICD_ENTRY(glVertex3i) //138
ICD_ENTRY(glVertex3iv) //139
ICD_ENTRY(glVertex3s) //140
ICD_ENTRY(glVertex3sv) //141
ICD_ENTRY(glVertex4d) //142
ICD_ENTRY(glVertex4dv) //143
ICD_ENTRY(glVertex4f) //144
ICD_ENTRY(glVertex4fv) //145
ICD_ENTRY(glVertex4i) //146
ICD_ENTRY(glVertex4iv) //147
ICD_ENTRY(glVertex4s) //148
ICD_ENTRY(glVertex4sv) //149
ICD_ENTRY(glClipPlane) //150
ICD_ENTRY(glColorMaterial) //151
ICD_ENTRY(glCullFace) //152
ICD_ENTRY(glFogf) //153
ICD_ENTRY(glFogfv) //154
ICD_ENTRY(glFogi) //155
ICD_ENTRY(glFogiv) //156
ICD_ENTRY(glFrontFace) //157
ICD_ENTRY(glHint) //158
ICD_ENTRY(glLightf) //159
ICD_ENTRY(glLightfv) //160
ICD_ENTRY(glLighti) //161
ICD_ENTRY(glLightiv) //162
ICD_ENTRY(glLightModelf) //163
ICD_ENTRY(glLightModelfv) //164
ICD_ENTRY(glLightModeli) //165
ICD_ENTRY(glLightModeliv) //166
ICD_ENTRY(glLineStipple) //167
ICD_ENTRY(glLineWidth) //168
ICD_ENTRY(glMaterialf) //169
ICD_ENTRY(glMaterialfv) //170
ICD_ENTRY(glMateriali) //171
ICD_ENTRY(glMaterialiv) //172
ICD_ENTRY(glPointSize) //173
ICD_ENTRY(glPolygonMode) //174
ICD_ENTRY(glPolygonStipple) //175
ICD_ENTRY(glScissor) //176
ICD_ENTRY(glShadeModel) //177
ICD_ENTRY(glTexParameterf) //178
ICD_ENTRY(glTexParameterfv) //179
ICD_ENTRY(glTexParameteri) //180
ICD_ENTRY(glTexParameteriv) //181
ICD_ENTRY(glTexImage1D) //182
ICD_ENTRY(glTexImage2D) //183
ICD_ENTRY(glTexEnvf) //184
ICD_ENTRY(glTexEnvfv) //185
ICD_ENTRY(glTexEnvi) //186
ICD_ENTRY(glTexEnviv) //187
ICD_ENTRY(glTexGend) //188
ICD_ENTRY(glTexGendv) //189
ICD_ENTRY(glTexGenf) //190
ICD_ENTRY(glTexGenfv) //191
ICD_ENTRY(glTexGeni) //192
ICD_ENTRY(glTexGeniv) //193
ICD_ENTRY(glFeedbackBuffer) //194
ICD_ENTRY(glSelectBuffer) //195
ICD_ENTRY(glRenderMode) //196
ICD_ENTRY(glInitNames) //197
ICD_ENTRY(glLoadName) //198
ICD_ENTRY(glPassThrough) //199
ICD_ENTRY(glPopName) //200
ICD_ENTRY(glPushName) //201
ICD_ENTRY(glDrawBuffer) //202
ICD_ENTRY(glClear) //203
ICD_ENTRY(glClearAccum) //204
ICD_ENTRY(glClearIndex) //205
ICD_ENTRY(glClearColor) //206
ICD_ENTRY(glClearStencil) //207
ICD_ENTRY(glClearDepth) //208
ICD_ENTRY(glStencilMask) //209
ICD_ENTRY(glColorMask) //210
ICD_ENTRY(glDepthMask) //211
ICD_ENTRY(glIndexMask) //212
ICD_ENTRY(glAccum) //213
ICD_ENTRY(glDisable) //214
ICD_ENTRY(glEnable) //215
ICD_ENTRY(glFinish) //216
ICD_ENTRY(glFlush) //217
ICD_ENTRY(glPopAttrib) //218
ICD_ENTRY(glPushAttrib) //219
ICD_ENTRY(glMap1d) //220
ICD_ENTRY(glMap1f) //221
ICD_ENTRY(glMap2d) //222
ICD_ENTRY(glMap2f) //223
ICD_ENTRY(glMapGrid1d) //224
ICD_ENTRY(glMapGrid1f) //225
ICD_ENTRY(glMapGrid2d) //226
ICD_ENTRY(glMapGrid2f) //227
ICD_ENTRY(glEvalCoord1d) //228
ICD_ENTRY(glEvalCoord1dv) //229
ICD_ENTRY(glEvalCoord1f) //230
ICD_ENTRY(glEvalCoord1fv) //231
ICD_ENTRY(glEvalCoord2d) //232
ICD_ENTRY(glEvalCoord2dv) //233
ICD_ENTRY(glEvalCoord2f) //234
ICD_ENTRY(glEvalCoord2fv) //235
ICD_ENTRY(glEvalMesh1) //236
ICD_ENTRY(glEvalPoint1) //237
ICD_ENTRY(glEvalMesh2) //238
ICD_ENTRY(glEvalPoint2) //239
ICD_ENTRY(glAlphaFunc) //240
ICD_ENTRY(glBlendFunc) //241
ICD_ENTRY(glLogicOp) //242
ICD_ENTRY(glStencilFunc) //243
ICD_ENTRY(glStencilOp) //244
ICD_ENTRY(glDepthFunc) //245
ICD_ENTRY(glPixelZoom) //246
ICD_ENTRY(glPixelTransferf) //247
ICD_ENTRY(glPixelTransferi) //248
ICD_ENTRY(glPixelStoref) //249
ICD_ENTRY(glPixelStorei) //250
ICD_ENTRY(glPixelMapfv) //251
ICD_ENTRY(glPixelMapuiv) //252
ICD_ENTRY(glPixelMapusv) //253
ICD_ENTRY(glReadBuffer) //254
ICD_ENTRY(glCopyPixels) //255
ICD_ENTRY(glReadPixels) //256
ICD_ENTRY(glDrawPixels) //257
ICD_ENTRY(glGetBooleanv) //258
ICD_ENTRY(glGetClipPlane) //259
ICD_ENTRY(glGetDoublev) //260
ICD_ENTRY(glGetError) //261
ICD_ENTRY(glGetFloatv) //262
ICD_ENTRY(glGetIntegerv) //263
ICD_ENTRY(glGetLightfv) //264
ICD_ENTRY(glGetLightiv) //265
ICD_ENTRY(glGetMapdv) //266
ICD_ENTRY(glGetMapfv) //267
ICD_ENTRY(glGetMapiv) //268
ICD_ENTRY(glGetMaterialfv) //269
ICD_ENTRY(glGetMaterialiv) //270
ICD_ENTRY(glGetPixelMapfv) //271
ICD_ENTRY(glGetPixelMapuiv) //272
ICD_ENTRY(glGetPixelMapusv) //273
ICD_ENTRY(glGetPolygonStipple) //274
ICD_ENTRY(glGetString) //275
ICD_ENTRY(glGetTexEnvfv) //276
ICD_ENTRY(glGetTexEnviv) //277
ICD_ENTRY(glGetTexGendv) //278
ICD_ENTRY(glGetTexGenfv) //279
ICD_ENTRY(glGetTexGeniv) //280
ICD_ENTRY(glGetTexImage) //281
ICD_ENTRY(glGetTexParameterfv) //282
ICD_ENTRY(glGetTexParameteriv) //283
ICD_ENTRY(glGetTexLevelParameterfv) //284
ICD_ENTRY(glGetTexLevelParameteriv) //285
ICD_ENTRY(glIsEnabled) //286
ICD_ENTRY(glIsList) //287
ICD_ENTRY(glDepthRange) //288
ICD_ENTRY(glFrustum) //289
ICD_ENTRY(glLoadIdentity) //290
ICD_ENTRY(glLoadMatrixf) //291
ICD_ENTRY(glLoadMatrixd) //292
ICD_ENTRY(glMatrixMode) //293
ICD_ENTRY(glMultMatrixf) //294
ICD_ENTRY(glMultMatrixd) //295
ICD_ENTRY(glOrtho) //296
ICD_ENTRY(glPopMatrix) //297
ICD_ENTRY(glPushMatrix) //298
ICD_ENTRY(glRotated) //299
ICD_ENTRY(glRotatef) //300
ICD_ENTRY(glScaled) //301
ICD_ENTRY(glScalef) //302
ICD_ENTRY(glTranslated) //303
ICD_ENTRY(glTranslatef) //304
ICD_ENTRY(glViewport) //305
ICD_ENTRY(glArrayElement) //306
ICD_ENTRY(glBindTexture) //307
ICD_ENTRY(glColorPointer) //308
ICD_ENTRY(glDisableClientState) //309
ICD_ENTRY(glDrawArrays) //310
ICD_ENTRY(glDrawElements) //311
ICD_ENTRY(glEdgeFlagPointer) //312
ICD_ENTRY(glEnableClientState) //313
ICD_ENTRY(glIndexPointer) //314
ICD_ENTRY(glIndexub) //315
ICD_ENTRY(glIndexubv) //316
ICD_ENTRY(glInterleavedArrays) //317
ICD_ENTRY(glNormalPointer) //318
ICD_ENTRY(glPolygonOffset) //319
ICD_ENTRY(glTexCoordPointer) //320
ICD_ENTRY(glVertexPointer) //321
ICD_ENTRY(glAreTexturesResident) //322
ICD_ENTRY(glCopyTexImage1D) //323
ICD_ENTRY(glCopyTexImage2D) //324
ICD_ENTRY(glCopyTexSubImage1D) //325
ICD_ENTRY(glCopyTexSubImage2D) //326
ICD_ENTRY(glDeleteTextures) //327
ICD_ENTRY(glGenTextures) //328
ICD_ENTRY(glGetPointerv) //329
ICD_ENTRY(glIsTexture) //330
ICD_ENTRY(glPrioritizeTextures) //331
ICD_ENTRY(glTexSubImage1D) //332
ICD_ENTRY(glTexSubImage2D) //333
ICD_ENTRY(glPopClientAttrib) //334
ICD_ENTRY(glPushClientAttrib) //335

View file

@ -0,0 +1,25 @@
/* icdtable.h */
#ifndef OPENGL32_PRIVATE_ICDTABLE_H
#define OPENGL32_PRIVATE_ICDTABLE_H
enum icdoffsets_e
{
ICDIDX_INVALID = -1,
#define ICD_ENTRY(x) ICDIDX_##x,
#include "icdlist.h"
#undef ICD_ENTRY
ICDIDX_COUNT
};
typedef struct tagICDTable
{
DWORD num_funcs; /*!< Normally 336 (0x150) -- the number of functions in OpenGL 1.1 */
PROC dispatch_table[812]; /*!< Table containing \a num_funcs pointers to OpenGL functions */
} ICDTable, *PICDTable;
#define DISPATCH_TABLE_SIZE 812*sizeof(PROC)
#endif /* OPENGL32_PRIVATE_ICDTABLE_H */
/* EOF */

View file

@ -0,0 +1,625 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: lib/opengl32/opengl32.c
* PURPOSE: OpenGL32 lib
* PROGRAMMER: Anich Gregor (blight), Royce Mitchell III
* UPDATE HISTORY:
* Feb 1, 2004: Created
*/
#include "opengl32.h"
/* function prototypes */
static void OPENGL32_AppendICD( GLDRIVERDATA *icd );
static void OPENGL32_RemoveICD( GLDRIVERDATA *icd );
static GLDRIVERDATA *OPENGL32_LoadDriver( LPCWSTR regKey );
static DWORD OPENGL32_InitializeDriver( GLDRIVERDATA *icd );
static BOOL OPENGL32_UnloadDriver( GLDRIVERDATA *icd );
static DWORD OPENGL32_RegGetDriverInfo( LPCWSTR driver, GLDRIVERDATA *icd );
/* global vars */
GLPROCESSDATA OPENGL32_processdata;
static BOOL
OPENGL32_ThreadAttach( void )
{
PROC *dispatchTable = NULL;
TEB *teb = NULL;
dispatchTable = (PROC*)HeapAlloc( GetProcessHeap(),
HEAP_GENERATE_EXCEPTIONS | HEAP_ZERO_MEMORY,
DISPATCH_TABLE_SIZE );
if (dispatchTable == NULL)
{
DBGPRINT( "Error: Couldn't allocate GL dispatch table" );
return FALSE;
}
teb = NtCurrentTeb();
/* initialize dispatch table with empty functions */
#define X(func, ret, typeargs, args, icdidx, tebidx, stack) \
dispatchTable[icdidx] = (PROC)glEmptyFunc##stack; \
if (tebidx >= 0) \
teb->glDispatchTable[tebidx] = (PVOID)glEmptyFunc##stack;
GLFUNCS_MACRO
#undef X
teb->glTable = dispatchTable;
/* At first we have no context */
teb->glCurrentRC = NULL;
return TRUE;
}
static void
OPENGL32_ThreadDetach( void )
{
TEB* teb = NtCurrentTeb();
rosglMakeCurrent( NULL, NULL );
if (teb->glTable != NULL)
{
if (!HeapFree( GetProcessHeap(), 0, teb->glTable ))
{
DBGPRINT( "Warning: HeapFree() on dispatch table failed (%d)",
GetLastError() );
}
/* NULL-ify it. Even if something went wrong, it's not a good idea to keep it non NULL */
teb->glTable = NULL;
}
}
static BOOL
OPENGL32_ProcessAttach( void )
{
SECURITY_ATTRIBUTES attrib = { sizeof (SECURITY_ATTRIBUTES), /* nLength */
NULL, /* lpSecurityDescriptor */
TRUE /* bInheritHandle */ };
memset( &OPENGL32_processdata, 0, sizeof (OPENGL32_processdata) );
/* create driver, glrc & dcdata list mutex */
OPENGL32_processdata.driver_mutex = CreateMutex( &attrib, FALSE, NULL );
if (OPENGL32_processdata.driver_mutex == NULL)
{
DBGPRINT( "Error: Couldn't create driver_list mutex (%d)",
GetLastError() );
return FALSE;
}
OPENGL32_processdata.glrc_mutex = CreateMutex( &attrib, FALSE, NULL );
if (OPENGL32_processdata.glrc_mutex == NULL)
{
DBGPRINT( "Error: Couldn't create glrc_list mutex (%d)",
GetLastError() );
return FALSE;
}
OPENGL32_processdata.dcdata_mutex = CreateMutex( &attrib, FALSE, NULL );
if (OPENGL32_processdata.dcdata_mutex == NULL)
{
DBGPRINT( "Error: Couldn't create dcdata_list mutex (%d)",
GetLastError() );
return FALSE;
}
return TRUE;
}
static void
OPENGL32_ProcessDetach( void )
{
GLDRIVERDATA *icd, *icd2;
GLDCDATA *dcdata, *dcdata2;
GLRC *glrc, *glrc2;
/* free lists */
for (dcdata = OPENGL32_processdata.dcdata_list; dcdata != NULL;)
{
dcdata2 = dcdata;
dcdata = dcdata->next;
if (!HeapFree( GetProcessHeap(), 0, dcdata2 ))
DBGPRINT( "Warning: HeapFree() on DCDATA 0x%08x failed (%d)",
dcdata2, GetLastError() );
}
for (glrc = OPENGL32_processdata.glrc_list; glrc != NULL;)
{
glrc2 = glrc;
glrc = glrc->next;
if (!HeapFree( GetProcessHeap(), 0, glrc2 ))
DBGPRINT( "Warning: HeapFree() on GLRC 0x%08x failed (%d)",
glrc2, GetLastError() );
}
for (icd = OPENGL32_processdata.driver_list; icd != NULL;)
{
icd2 = icd;
icd = icd->next;
if (!HeapFree( GetProcessHeap(), 0, icd2 ))
DBGPRINT( "Warning: HeapFree() on DRIVERDATA 0x%08x failed (%d)",
icd2, GetLastError() );
}
/* free mutexes */
if (OPENGL32_processdata.driver_mutex != NULL)
CloseHandle( OPENGL32_processdata.driver_mutex );
if (OPENGL32_processdata.glrc_mutex != NULL)
CloseHandle( OPENGL32_processdata.glrc_mutex );
if (OPENGL32_processdata.dcdata_mutex != NULL)
CloseHandle( OPENGL32_processdata.dcdata_mutex );
}
BOOL WINAPI
DllMain(HINSTANCE hInstance, DWORD Reason, LPVOID Reserved)
{
DBGPRINT( "Info: Called!" );
switch ( Reason )
{
/* The DLL is loading due to process
* initialization or a call to LoadLibrary.
*/
case DLL_PROCESS_ATTACH:
DBGTRACE( "Process attach" );
if (!OPENGL32_ProcessAttach())
return FALSE;
/* No break: Initialize the index for first thread. */
/* The attached process creates a new thread. */
case DLL_THREAD_ATTACH:
DBGTRACE( "Thread attach" );
if (!OPENGL32_ThreadAttach())
return FALSE;
break;
/* The thread of the attached process terminates. */
case DLL_THREAD_DETACH:
DBGTRACE( "Thread detach" );
/* Release the allocated memory for this thread.*/
OPENGL32_ThreadDetach();
break;
/* DLL unload due to process termination or FreeLibrary. */
case DLL_PROCESS_DETACH:
DBGTRACE( "Process detach" );
OPENGL32_ThreadDetach();
OPENGL32_ProcessDetach();
break;
}
return TRUE;
}
/*! \brief Append ICD to linked list.
*
* \param icd GLDRIVERDATA to append to list
*
* \note Only call this when you hold the driver_mutex.
*/
static void
OPENGL32_AppendICD( GLDRIVERDATA *icd )
{
if (OPENGL32_processdata.driver_list == NULL)
OPENGL32_processdata.driver_list = icd;
else
{
GLDRIVERDATA *p = OPENGL32_processdata.driver_list;
while (p->next != NULL)
p = p->next;
p->next = icd;
}
}
/*! \brief Remove ICD from linked list.
*
* \param icd GLDRIVERDATA to remove from list
*
* \note Only call this when you hold the driver_mutex.
*/
static void
OPENGL32_RemoveICD( GLDRIVERDATA *icd )
{
if (icd == OPENGL32_processdata.driver_list)
OPENGL32_processdata.driver_list = icd->next;
else
{
GLDRIVERDATA *p = OPENGL32_processdata.driver_list;
while (p != NULL)
{
if (p->next == icd)
{
p->next = icd->next;
return;
}
p = p->next;
}
DBGPRINT( "Error: ICD 0x%08x not found in list!", icd );
}
}
/*! \brief Load an ICD.
*
* \param driver Name of installable client driver.
*
* \return Pointer to an allocated GLDRIVERDATA struct.
* \retval NULL Failure.
*
* \todo Call SetLastError() where appropriate.
*/
static GLDRIVERDATA *
OPENGL32_LoadDriver( LPCWSTR driver )
{
LONG ret;
GLDRIVERDATA *icd;
DBGPRINT( "Info: Loading driver %ws...", driver );
/* allocate driver data */
icd = (GLDRIVERDATA*)HeapAlloc( GetProcessHeap(),
HEAP_GENERATE_EXCEPTIONS | HEAP_ZERO_MEMORY,
sizeof (GLDRIVERDATA) );
if (icd == NULL)
{
DBGPRINT( "Error: Couldn't allocate GLDRIVERDATA! (%d)", GetLastError() );
return NULL;
}
ret = OPENGL32_RegGetDriverInfo( driver, icd );
if (ret != ERROR_SUCCESS)
{
DBGPRINT( "Error: Couldn't query driver information (%d)", ret );
if (!HeapFree( GetProcessHeap(), 0, icd ))
DBGPRINT( "Error: HeapFree() returned false, error code = %d",
GetLastError() );
return NULL;
}
DBGPRINT( "Info: Dll = %ws", icd->dll );
DBGPRINT( "Info: Version = 0x%08x", icd->version );
DBGPRINT( "Info: DriverVersion = 0x%08x", icd->driver_version );
DBGPRINT( "Info: Flags = 0x%08x", icd->flags );
/* load/initialize ICD */
ret = OPENGL32_InitializeDriver( icd );
if (ret != ERROR_SUCCESS)
{
DBGPRINT( "Error: Couldnt initialize ICD!" );
if (!HeapFree( GetProcessHeap(), 0, icd ))
DBGPRINT( "Error: HeapFree() returned false, error code = %d",
GetLastError() );
return NULL;
}
/* append ICD to list */
OPENGL32_AppendICD( icd );
DBGPRINT( "Info: ICD loaded." );
return icd;
}
/*! \brief Initialize a driver (Load DLL and DrvXxx procs)
*
* \param icd ICD to initialize with the dll, version, driverVersion
* and flags already filled.
* \return Error code.
* \retval ERROR_SUCCESS Success
*/
#define LOAD_DRV_PROC( icd, proc, required ) \
*(char**)&icd->proc = (char*)GetProcAddress( icd->handle, #proc ); \
if (required && icd->proc == NULL) { \
DBGPRINT( "Error: GetProcAddress(\"%s\") failed!", #proc ); \
FreeLibrary( icd->handle ); \
return GetLastError(); \
}
static DWORD
OPENGL32_InitializeDriver( GLDRIVERDATA *icd )
{
/* check version */
if (icd->version > 2)
DBGPRINT( "Warning: ICD version > 2 (%d)", icd->version );
/* load dll */
icd->handle = LoadLibraryW( icd->dll );
if (icd->handle == NULL)
{
DWORD err = GetLastError();
DBGPRINT( "Error: Couldn't load DLL! (%d)", err );
return err;
}
/* validate version */
if (icd->driver_version > 1)
{
LOAD_DRV_PROC(icd, DrvValidateVersion, FALSE);
if (icd->DrvValidateVersion != NULL)
{
if (!icd->DrvValidateVersion( icd->driver_version ))
{
DBGPRINT( "Error: DrvValidateVersion failed!" );
DBGBREAK();
FreeLibrary( icd->handle );
return ERROR_INVALID_FUNCTION; /* FIXME: use better error code */
}
}
else
DBGPRINT( "Info: DrvValidateVersion not exported by ICD" );
}
/* load DrvXXX procs */
LOAD_DRV_PROC(icd, DrvCopyContext, TRUE);
LOAD_DRV_PROC(icd, DrvCreateContext, FALSE);
LOAD_DRV_PROC(icd, DrvCreateLayerContext, FALSE);
LOAD_DRV_PROC(icd, DrvDeleteContext, TRUE);
LOAD_DRV_PROC(icd, DrvDescribeLayerPlane, TRUE);
LOAD_DRV_PROC(icd, DrvDescribePixelFormat, TRUE);
LOAD_DRV_PROC(icd, DrvGetLayerPaletteEntries, TRUE);
LOAD_DRV_PROC(icd, DrvGetProcAddress, TRUE);
LOAD_DRV_PROC(icd, DrvReleaseContext, TRUE);
LOAD_DRV_PROC(icd, DrvRealizeLayerPalette, TRUE);
LOAD_DRV_PROC(icd, DrvSetContext, TRUE);
LOAD_DRV_PROC(icd, DrvSetLayerPaletteEntries, TRUE);
LOAD_DRV_PROC(icd, DrvSetPixelFormat, TRUE);
LOAD_DRV_PROC(icd, DrvShareLists, TRUE);
LOAD_DRV_PROC(icd, DrvSwapBuffers, TRUE);
LOAD_DRV_PROC(icd, DrvSwapLayerBuffers, TRUE);
/* we require at least one of DrvCreateContext and DrvCreateLayerContext */
if (icd->DrvCreateContext == NULL && icd->DrvCreateLayerContext == NULL)
{
DBGPRINT( "Error: One of DrvCreateContext/DrvCreateLayerContext is required!" );
FreeLibrary( icd->handle );
return ERROR_INVALID_FUNCTION; /* FIXME: use better error code... */
}
return ERROR_SUCCESS;
}
/*! \brief Unload ICD.
*
* \retval TRUE Success.
* \retval FALSE Failure.
*/
static BOOL
OPENGL32_UnloadDriver( GLDRIVERDATA *icd )
{
BOOL allOk = TRUE;
DBGPRINT( "Info: Unloading driver %ws...", icd->driver_name );
if (icd->refcount != 0)
DBGPRINT( "Warning: ICD refcount = %d (should be 0)", icd->refcount );
/* unload dll */
if (!FreeLibrary( icd->handle ))
{
allOk = FALSE;
DBGPRINT( "Warning: FreeLibrary on ICD %ws failed! (%d)", icd->dll,
GetLastError() );
}
/* free resources */
OPENGL32_RemoveICD( icd );
if (!HeapFree( GetProcessHeap(), 0, icd ))
{
allOk = FALSE;
DBGPRINT( "Warning: HeapFree() returned FALSE, error code = %d",
GetLastError() );
}
return allOk;
}
/*! \brief Load ICD (shared ICD data)
*
* \return Pointer to an allocated GLDRIVERDATA on success.
* \retval NULL Failure.
*/
GLDRIVERDATA *
OPENGL32_LoadICD( LPCWSTR driver )
{
GLDRIVERDATA *icd;
/* synchronize */
if (WaitForSingleObject( OPENGL32_processdata.driver_mutex, INFINITE ) ==
WAIT_FAILED)
{
DBGPRINT( "Error: WaitForSingleObject() failed (%d)", GetLastError() );
return NULL; /* FIXME: do we have to expect such an error and handle it? */
}
/* look if ICD is already loaded */
for (icd = OPENGL32_processdata.driver_list; icd; icd = icd->next)
{
if (!_wcsicmp( driver, icd->driver_name )) /* found */
{
/* release mutex */
if (!ReleaseMutex( OPENGL32_processdata.driver_mutex ))
DBGPRINT( "Error: ReleaseMutex() failed (%d)", GetLastError() );
return icd;
}
}
/* not found - try to load */
icd = OPENGL32_LoadDriver( driver );
/* release mutex */
if (!ReleaseMutex( OPENGL32_processdata.driver_mutex ))
DBGPRINT( "Error: ReleaseMutex() failed (%d)", GetLastError() );
return icd;
}
/*! \brief Unload ICD (shared ICD data)
*
* \retval TRUE Success.
* \retval FALSE Failure.
*/
BOOL
OPENGL32_UnloadICD( GLDRIVERDATA *icd )
{
BOOL ret = TRUE;
/* synchronize */
if (WaitForSingleObject( OPENGL32_processdata.driver_mutex, INFINITE ) ==
WAIT_FAILED)
{
DBGPRINT( "Error: WaitForSingleObject() failed (%d)", GetLastError() );
return FALSE; /* FIXME: do we have to expect such an error and handle it? */
}
if (icd->refcount == 0)
ret = OPENGL32_UnloadDriver( icd );
/* release mutex */
if (!ReleaseMutex( OPENGL32_processdata.driver_mutex ))
DBGPRINT( "Error: ReleaseMutex() failed (%d)", GetLastError() );
return ret;
}
/*! \brief Enumerate OpenGLDrivers (from registry)
*
* \param idx Index of the driver to get information about.
* \param name Pointer to an array of WCHARs (can be NULL)
* \param cName Pointer to a DWORD. Input is len of name array.
* Output is length of the drivername.
* Can be NULL if name is NULL.
*
* \return Error code
* \retval ERROR_NO_MORE_ITEMS End of driver list.
* \retval ERROR_SUCCESS Success.
*/
#if 0 /* unused */
DWORD
OPENGL32_RegEnumDrivers( DWORD idx, LPWSTR name, LPDWORD cName )
{
HKEY hKey;
LPCWSTR subKey = OPENGL_DRIVERS_SUBKEY;
LONG ret;
DWORD size;
WCHAR driver[256];
if (name == NULL)
return ERROR_SUCCESS; /* nothing to do */
if (cName == NULL)
return ERROR_INVALID_FUNCTION; /* we need cName when name is given */
/* open OpenGLDrivers registry key */
ret = RegOpenKeyExW( HKEY_LOCAL_MACHINE, subKey, 0, KEY_READ, &hKey );
if (ret != ERROR_SUCCESS)
{
DBGPRINT( "Error: Couldn't open registry key '%ws'", subKey );
return ret;
}
/* get subkey name */
size = sizeof (driver) / sizeof (driver[0]);
ret = RegEnumKeyW( hKey, idx, name, *cName );
if (ret != ERROR_SUCCESS)
{
DBGPRINT( "Error: Couldn't get OpenGLDrivers subkey name (%d)", ret );
RegCloseKey( hKey );
return ret;
}
*cName = wcslen( name );
/* close key */
RegCloseKey( hKey );
return ERROR_SUCCESS;
}
#endif /* 0 -- unused */
/*! \brief Get registry values for a driver given a name.
*
* \param driver Name of the driver to get information about.
* \param icd Pointer to GLDRIVERDATA.
*
* \return Error code.
* \retval ERROR_SUCCESS Success.
*
* \note On success the following fields of \a icd are filled: \a driver_name,
* \a dll, \a version, \a driver_version and \a flags.
*/
static DWORD
OPENGL32_RegGetDriverInfo( LPCWSTR driver, GLDRIVERDATA *icd )
{
HKEY hKey;
WCHAR subKey[1024] = OPENGL_DRIVERS_SUBKEY2;
LONG ret;
DWORD type, size;
/* drivers registry values */
DWORD version = 1, driverVersion = 0, flags = 0;
WCHAR dll[256];
/* open driver registry key */
wcsncat( subKey, driver, 1024 );
ret = RegOpenKeyExW( HKEY_LOCAL_MACHINE, subKey, 0, KEY_READ, &hKey );
if (ret != ERROR_SUCCESS)
{
DBGPRINT( "Error: Couldn't open registry key '%ws'", subKey );
return ret;
}
/* query values */
size = sizeof (dll);
ret = RegQueryValueExW( hKey, L"Dll", 0, &type, (LPBYTE)dll, &size );
if (ret != ERROR_SUCCESS || type != REG_SZ)
{
DBGPRINT( "Error: Couldn't query Dll value or not a string" );
RegCloseKey( hKey );
return ret;
}
size = sizeof (DWORD);
ret = RegQueryValueExW( hKey, L"Version", 0, &type, (LPBYTE)&version, &size );
if (ret != ERROR_SUCCESS || type != REG_DWORD)
DBGPRINT( "Warning: Couldn't query Version value or not a DWORD" );
size = sizeof (DWORD);
ret = RegQueryValueExW( hKey, L"DriverVersion", 0, &type,
(LPBYTE)&driverVersion, &size );
if (ret != ERROR_SUCCESS || type != REG_DWORD)
DBGPRINT( "Warning: Couldn't query DriverVersion value or not a DWORD" );
size = sizeof (DWORD);
ret = RegQueryValueExW( hKey, L"Flags", 0, &type, (LPBYTE)&flags, &size );
if (ret != ERROR_SUCCESS || type != REG_DWORD)
DBGPRINT( "Warning: Couldn't query Flags value or not a DWORD" );
/* close key */
RegCloseKey( hKey );
/* output data */
/* FIXME: NUL-terminate strings? */
wcsncpy( icd->driver_name, driver,
sizeof (icd->driver_name) / sizeof (icd->driver_name[0]) - 1 );
wcsncpy( icd->dll, dll,
sizeof (icd->dll) / sizeof (icd->dll[0]) );
icd->version = version;
icd->driver_version = driverVersion;
icd->flags = flags;
return ERROR_SUCCESS;
}
/* EOF */

View file

@ -0,0 +1,181 @@
# Microsoft Developer Studio Project File - Name="opengl32" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=opengl32 - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "opengl32.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "opengl32.mak" CFG="opengl32 - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "opengl32 - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "opengl32 - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "opengl32 - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OPENGL32_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OPENGL32_EXPORTS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
!ELSEIF "$(CFG)" == "opengl32 - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OPENGL32_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OPENGL32_EXPORTS" /YX /FD /TP /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 gdi32.lib advapi32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "opengl32 - Win32 Release"
# Name "opengl32 - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\gl.c
# End Source File
# Begin Source File
SOURCE=.\opengl32.c
# End Source File
# Begin Source File
SOURCE=.\tebimports.asm
!IF "$(CFG)" == "opengl32 - Win32 Release"
# Begin Custom Build - Compiling $(InputPath)
IntDir=.\Release
InputPath=.\tebimports.asm
InputName=tebimports
"$(IntDir)/$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
nasmw.exe -f win32 $(InputPath) -o "$(IntDir)/$(InputName).obj"
# End Custom Build
!ELSEIF "$(CFG)" == "opengl32 - Win32 Debug"
# Begin Custom Build - Compiling $(InputPath)
IntDir=.\Debug
InputPath=.\tebimports.asm
InputName=tebimports
"$(IntDir)/$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
nasmw.exe -f win32 -d win32 $(InputPath) -o "$(IntDir)/$(InputName).obj"
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\wgl.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\glfuncs.h
# End Source File
# Begin Source File
SOURCE=.\icdlist.h
# End Source File
# Begin Source File
SOURCE=.\icdtable.h
# End Source File
# Begin Source File
SOURCE=.\opengl32.def
# End Source File
# Begin Source File
SOURCE=.\opengl32.h
# End Source File
# Begin Source File
SOURCE=.\slowlist.h
# End Source File
# Begin Source File
SOURCE=.\teb.h
# End Source File
# Begin Source File
SOURCE=.\teblist.h
# End Source File
# Begin Source File
SOURCE=.\teblist.mac
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View file

@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "opengl32"=.\opengl32.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View file

@ -0,0 +1,234 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: lib/opengl32/opengl32.h
* PURPOSE: OpenGL32 lib
* PROGRAMMER: Royce Mitchell III, Anich Gregor (blight)
* UPDATE HISTORY:
* Feb 1, 2004: Created
*/
#ifndef OPENGL32_PRIVATE_H
#define OPENGL32_PRIVATE_H
#define snwprintf _snwprintf
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define NDEBUG
#ifndef PFD_GENERIC_ACCELERATED
# define PFD_GENERIC_ACCELERATED 0x00001000
#endif
#define OPENGL_DRIVERS_SUBKEY L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\OpenGLDrivers"
#define OPENGL_DRIVERS_SUBKEY2 L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\OpenGLDrivers\\"
#include <stdio.h>
#include <stdlib.h>
//#include <string.h>
#define WIN32_NO_STATUS
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <wingdi.h>
#include <winuser.h>
#include <winddi.h>
#define NTOS_MODE_USER
#include <ndk/pstypes.h>
//#include <GL/gl.h>
#include <GL/glu.h>
/* gl function list */
#include "glfuncs.h"
/* ICD index list/types */
#include "icdtable.h"
/* debug flags */
#if !defined(NDEBUG)
# define DEBUG_OPENGL32
/* enable breakpoints */
/*# define DEBUG_OPENGL32_BRKPTS*/
/* dumps the list of (un)supported glXXX functions when an ICD is loaded. */
# define DEBUG_OPENGL32_ICD_EXPORTS
/* prints much information about whats going on */
# define DEBUG_OPENGL32_TRACE
#endif /* !NDEBUG */
/* debug macros */
# ifdef DEBUG_OPENGL32
# include <debug.h>
# define DBGPRINT( fmt, args... ) \
DPRINT( "OpenGL32.DLL: %s: "fmt"\n", __FUNCTION__, ##args )
# endif
#ifndef DBGPRINT
# define DBGPRINT( ... ) do {} while (0)
#endif
#ifdef DEBUG_OPENGL32_BRKPTS
# if defined(__GNUC__)
# define DBGBREAK() __asm__( "int $3" );
# elif defined(_MSC_VER)
# define DBGBREAK() __asm { int 3 }
# else
# error Unsupported compiler!
# endif
#else
# define DBGBREAK() do {} while (0)
#endif
#ifdef DEBUG_OPENGL32_TRACE
# define DBGTRACE( args... ) DBGPRINT( args )
#else
# define DBGTRACE( ... ) do {} while (0)
#endif
/* function/data attributes */
#define EXPORT __declspec(dllexport)
#ifdef _MSC_VER
# define NAKED __declspec(naked)
# define SHARED
# ifndef WINAPI
# define WINAPI __stdcall
# endif /* WINAPI */
#else /* GCC */
# define NAKED __attribute__((naked))
# define SHARED __attribute__((section("shared"), shared))
#endif
#ifdef APIENTRY
#undef APIENTRY
#endif /* APIENTRY */
#define APIENTRY __stdcall
/* Called by the driver to set the dispatch table */
typedef DWORD (WINAPI *SetContextCallBack)( const ICDTable * );
/* OpenGL ICD data */
typedef struct tagGLDRIVERDATA
{
HMODULE handle; /*!< DLL handle */
UINT refcount; /*!< Number of references to this ICD */
WCHAR driver_name[256]; /*!< Name of ICD driver */
WCHAR dll[256]; /*!< Dll filename from registry */
DWORD version; /*!< Version value from registry */
DWORD driver_version; /*!< DriverVersion value from registry */
DWORD flags; /*!< Flags value from registry */
BOOL (WINAPI *DrvCopyContext)( HGLRC, HGLRC, UINT );
HGLRC (WINAPI *DrvCreateContext)( HDC );
HGLRC (WINAPI *DrvCreateLayerContext)( HDC, int );
BOOL (WINAPI *DrvDeleteContext)( HGLRC );
BOOL (WINAPI *DrvDescribeLayerPlane)( HDC, int, int, UINT, LPLAYERPLANEDESCRIPTOR );
int (WINAPI *DrvDescribePixelFormat)( IN HDC, IN int, IN UINT, OUT LPPIXELFORMATDESCRIPTOR );
int (WINAPI *DrvGetLayerPaletteEntries)( HDC, int, int, int, COLORREF * );
PROC (WINAPI *DrvGetProcAddress)( LPCSTR lpProcName );
void (WINAPI *DrvReleaseContext)( HGLRC hglrc ); /* maybe returns BOOL? */
BOOL (WINAPI *DrvRealizeLayerPalette)( HDC, int, BOOL );
PICDTable (WINAPI *DrvSetContext)( HDC hdc, HGLRC hglrc, SetContextCallBack callback );
int (WINAPI *DrvSetLayerPaletteEntries)( HDC, int, int, int, CONST COLORREF * );
BOOL (WINAPI *DrvSetPixelFormat)( IN HDC, IN int, const PIXELFORMATDESCRIPTOR * );
BOOL (WINAPI *DrvShareLists)( HGLRC, HGLRC );
BOOL (WINAPI *DrvSwapBuffers)( HDC );
BOOL (WINAPI *DrvSwapLayerBuffers)( HDC, UINT );
BOOL (WINAPI *DrvValidateVersion)( DWORD );
struct tagGLDRIVERDATA *next; /* next ICD -- linked list */
} GLDRIVERDATA;
/* Our private OpenGL context (stored in TLS) */
typedef struct tagGLRC
{
GLDRIVERDATA *icd; /*!< driver used for this context */
HDC hdc; /*!< DC handle */
BOOL is_current; /*!< Wether this context is current for some DC */
DWORD thread_id; /*!< Thread holding this context */
HGLRC hglrc; /*!< GLRC from DrvCreateContext (ICD internal) */
struct tagGLRC *next; /* linked list */
} GLRC;
/* OpenGL private device context data */
typedef struct tagGLDCDATA
{
HANDLE handle; /*!< Handle for which this data is (HWND for device, HDC for memory context) */
GLDRIVERDATA *icd; /*!< Driver used for this DC */
int pixel_format; /*!< Selected pixel format */
struct tagGLDCDATA *next; /* linked list */
} GLDCDATA;
/* Process data */
typedef struct tagGLPROCESSDATA
{
GLDRIVERDATA *driver_list; /*!< List of loaded drivers */
HANDLE driver_mutex; /*!< Mutex to protect driver list */
GLRC *glrc_list; /*!< List of GL rendering contexts */
HANDLE glrc_mutex; /*!< Mutex to protect glrc list */
GLDCDATA *dcdata_list; /*!< List of GL private DC data */
HANDLE dcdata_mutex; /*!< Mutex to protect glrc list */
} GLPROCESSDATA;
extern GLPROCESSDATA OPENGL32_processdata;
/* function prototypes */
GLDRIVERDATA *OPENGL32_LoadICD( LPCWSTR driver );
BOOL OPENGL32_UnloadICD( GLDRIVERDATA *icd );
BOOL APIENTRY rosglMakeCurrent( HDC hdc, HGLRC hglrc );
BOOL APIENTRY IntUseFontBitmapsA( HDC hDC, DWORD first, DWORD count, DWORD listBase );
BOOL APIENTRY IntUseFontBitmapsW( HDC hDC, DWORD first, DWORD count, DWORD listBase );
BOOL APIENTRY IntUseFontOutlinesA( HDC hDC, DWORD first, DWORD count, DWORD listBase,
FLOAT chordalDeviation, FLOAT extrusion, INT format,
GLYPHMETRICSFLOAT *glyphMetricsFloatArray );
BOOL APIENTRY IntUseFontOutlinesW( HDC hDC, DWORD first, DWORD count, DWORD listBase,
FLOAT chordalDeviation, FLOAT extrusion, INT format,
GLYPHMETRICSFLOAT *glyphMetricsFloatArray );
/* empty gl functions from gl.c */
int WINAPI glEmptyFunc0( void );
int WINAPI glEmptyFunc4( long );
int WINAPI glEmptyFunc8( long, long );
int WINAPI glEmptyFunc12( long, long, long );
int WINAPI glEmptyFunc16( long, long, long, long );
int WINAPI glEmptyFunc20( long, long, long, long, long );
int WINAPI glEmptyFunc24( long, long, long, long, long, long );
int WINAPI glEmptyFunc28( long, long, long, long, long, long, long );
int WINAPI glEmptyFunc32( long, long, long, long, long, long, long, long );
int WINAPI glEmptyFunc36( long, long, long, long, long, long, long, long,
long );
int WINAPI glEmptyFunc40( long, long, long, long, long, long, long, long,
long, long );
int WINAPI glEmptyFunc44( long, long, long, long, long, long, long, long,
long, long, long );
int WINAPI glEmptyFunc48( long, long, long, long, long, long, long, long,
long, long, long, long );
int WINAPI glEmptyFunc52( long, long, long, long, long, long, long, long,
long, long, long, long, long );
int WINAPI glEmptyFunc56( long, long, long, long, long, long, long, long,
long, long, long, long, long, long );
#ifdef OPENGL32_GL_FUNC_PROTOTYPES
#define X(func,ret,typeargs,args,icdidx,tebidx,stack) ret WINAPI func typeargs;
GLFUNCS_MACRO
#undef X
#endif /* OPENGL32_GL_FUNC_PROTOTYPES */
#ifdef __cplusplus
}; /* extern "C" */
#endif /* __cplusplus */
#endif /* OPENGL32_PRIVATE_H */
/* EOF */

View file

@ -0,0 +1,369 @@
@ stub GlmfBeginGlsBlock
@ stub GlmfCloseMetaFile
@ stub GlmfEndGlsBlock
@ stub GlmfEndPlayback
@ stub GlmfInitPlayback
@ stub GlmfPlayGlsRecord
@ stdcall glAccum( long long )
@ stdcall glAlphaFunc( long long )
@ stdcall glAreTexturesResident( long ptr ptr )
@ stdcall glArrayElement( long )
@ stdcall glBegin( long )
@ stdcall glBindTexture( long long )
@ stdcall glBitmap( long long long long long long ptr )
@ stdcall glBlendFunc( long long )
@ stdcall glCallList( long )
@ stdcall glCallLists( long long ptr )
@ stdcall glClear( long )
@ stdcall glClearAccum( long long long long )
@ stdcall glClearColor( long long long long )
@ stdcall glClearDepth( double )
@ stdcall glClearIndex( long )
@ stdcall glClearStencil( long )
@ stdcall glClipPlane( long ptr )
@ stdcall glColor3b( long long long )
@ stdcall glColor3bv( ptr )
@ stdcall glColor3d( double double double )
@ stdcall glColor3dv( ptr )
@ stdcall glColor3f( long long long )
@ stdcall glColor3fv( ptr )
@ stdcall glColor3i( long long long )
@ stdcall glColor3iv( ptr )
@ stdcall glColor3s( long long long )
@ stdcall glColor3sv( ptr )
@ stdcall glColor3ub( long long long )
@ stdcall glColor3ubv( ptr )
@ stdcall glColor3ui( long long long )
@ stdcall glColor3uiv( ptr )
@ stdcall glColor3us( long long long )
@ stdcall glColor3usv( ptr )
@ stdcall glColor4b( long long long long )
@ stdcall glColor4bv( ptr )
@ stdcall glColor4d( double double double double )
@ stdcall glColor4dv( ptr )
@ stdcall glColor4f( long long long long )
@ stdcall glColor4fv( ptr )
@ stdcall glColor4i( long long long long )
@ stdcall glColor4iv( ptr )
@ stdcall glColor4s( long long long long )
@ stdcall glColor4sv( ptr )
@ stdcall glColor4ub( long long long long )
@ stdcall glColor4ubv( ptr )
@ stdcall glColor4ui( long long long long )
@ stdcall glColor4uiv( ptr )
@ stdcall glColor4us( long long long long )
@ stdcall glColor4usv( ptr )
@ stdcall glColorMask( long long long long )
@ stdcall glColorMaterial( long long )
@ stdcall glColorPointer( long long long ptr )
@ stdcall glCopyPixels( long long long long long )
@ stdcall glCopyTexImage1D( long long long long long long long )
@ stdcall glCopyTexImage2D( long long long long long long long long )
@ stdcall glCopyTexSubImage1D( long long long long long long )
@ stdcall glCopyTexSubImage2D( long long long long long long long long )
@ stdcall glCullFace( long )
@ stdcall glDebugEntry(long long)
@ stdcall glDeleteLists( long long )
@ stdcall glDeleteTextures( long ptr )
@ stdcall glDepthFunc( long )
@ stdcall glDepthMask( long )
@ stdcall glDepthRange( double double )
@ stdcall glDisable( long )
@ stdcall glDisableClientState( long )
@ stdcall glDrawArrays( long long long )
@ stdcall glDrawBuffer( long )
@ stdcall glDrawElements( long long long ptr )
@ stdcall glDrawPixels( long long long long ptr )
@ stdcall glEdgeFlag( long )
@ stdcall glEdgeFlagPointer( long ptr )
@ stdcall glEdgeFlagv( ptr )
@ stdcall glEnable( long )
@ stdcall glEnableClientState( long )
@ stdcall glEnd( )
@ stdcall glEndList( )
@ stdcall glEvalCoord1d( double )
@ stdcall glEvalCoord1dv( ptr )
@ stdcall glEvalCoord1f( long )
@ stdcall glEvalCoord1fv( ptr )
@ stdcall glEvalCoord2d( double double )
@ stdcall glEvalCoord2dv( ptr )
@ stdcall glEvalCoord2f( long long )
@ stdcall glEvalCoord2fv( ptr )
@ stdcall glEvalMesh1( long long long )
@ stdcall glEvalMesh2( long long long long long )
@ stdcall glEvalPoint1( long )
@ stdcall glEvalPoint2( long long )
@ stdcall glFeedbackBuffer( long long ptr )
@ stdcall glFinish( )
@ stdcall glFlush( )
@ stdcall glFogf( long long )
@ stdcall glFogfv( long ptr )
@ stdcall glFogi( long long )
@ stdcall glFogiv( long ptr )
@ stdcall glFrontFace( long )
@ stdcall glFrustum( double double double double double double )
@ stdcall glGenLists( long )
@ stdcall glGenTextures( long ptr )
@ stdcall glGetBooleanv( long ptr )
@ stdcall glGetClipPlane( long ptr )
@ stdcall glGetDoublev( long ptr )
@ stdcall glGetError( )
@ stdcall glGetFloatv( long ptr )
@ stdcall glGetIntegerv( long ptr )
@ stdcall glGetLightfv( long long ptr )
@ stdcall glGetLightiv( long long ptr )
@ stdcall glGetMapdv( long long ptr )
@ stdcall glGetMapfv( long long ptr )
@ stdcall glGetMapiv( long long ptr )
@ stdcall glGetMaterialfv( long long ptr )
@ stdcall glGetMaterialiv( long long ptr )
@ stdcall glGetPixelMapfv( long ptr )
@ stdcall glGetPixelMapuiv( long ptr )
@ stdcall glGetPixelMapusv( long ptr )
@ stdcall glGetPointerv( long ptr )
@ stdcall glGetPolygonStipple( ptr )
@ stdcall glGetString( long )
@ stdcall glGetTexEnvfv( long long ptr )
@ stdcall glGetTexEnviv( long long ptr )
@ stdcall glGetTexGendv( long long ptr )
@ stdcall glGetTexGenfv( long long ptr )
@ stdcall glGetTexGeniv( long long ptr )
@ stdcall glGetTexImage( long long long long ptr )
@ stdcall glGetTexLevelParameterfv( long long long ptr )
@ stdcall glGetTexLevelParameteriv( long long long ptr )
@ stdcall glGetTexParameterfv( long long ptr )
@ stdcall glGetTexParameteriv( long long ptr )
@ stdcall glHint( long long )
@ stdcall glIndexMask( long )
@ stdcall glIndexPointer( long long ptr )
@ stdcall glIndexd( double )
@ stdcall glIndexdv( ptr )
@ stdcall glIndexf( long )
@ stdcall glIndexfv( ptr )
@ stdcall glIndexi( long )
@ stdcall glIndexiv( ptr )
@ stdcall glIndexs( long )
@ stdcall glIndexsv( ptr )
@ stdcall glIndexub( long )
@ stdcall glIndexubv( ptr )
@ stdcall glInitNames( )
@ stdcall glInterleavedArrays( long long ptr )
@ stdcall glIsEnabled( long )
@ stdcall glIsList( long )
@ stdcall glIsTexture( long )
@ stdcall glLightModelf( long long )
@ stdcall glLightModelfv( long ptr )
@ stdcall glLightModeli( long long )
@ stdcall glLightModeliv( long ptr )
@ stdcall glLightf( long long long )
@ stdcall glLightfv( long long ptr )
@ stdcall glLighti( long long long )
@ stdcall glLightiv( long long ptr )
@ stdcall glLineStipple( long long )
@ stdcall glLineWidth( long )
@ stdcall glListBase( long )
@ stdcall glLoadIdentity( )
@ stdcall glLoadMatrixd( ptr )
@ stdcall glLoadMatrixf( ptr )
@ stdcall glLoadName( long )
@ stdcall glLogicOp( long )
@ stdcall glMap1d( long double double long long ptr )
@ stdcall glMap1f( long long long long long ptr )
@ stdcall glMap2d( long double double long long double double long long ptr )
@ stdcall glMap2f( long long long long long long long long long ptr )
@ stdcall glMapGrid1d( long double double )
@ stdcall glMapGrid1f( long long long )
@ stdcall glMapGrid2d( long double double long double double )
@ stdcall glMapGrid2f( long long long long long long )
@ stdcall glMaterialf( long long long )
@ stdcall glMaterialfv( long long ptr )
@ stdcall glMateriali( long long long )
@ stdcall glMaterialiv( long long ptr )
@ stdcall glMatrixMode( long )
@ stdcall glMultMatrixd( ptr )
@ stdcall glMultMatrixf( ptr )
@ stdcall glNewList( long long )
@ stdcall glNormal3b( long long long )
@ stdcall glNormal3bv( ptr )
@ stdcall glNormal3d( double double double )
@ stdcall glNormal3dv( ptr )
@ stdcall glNormal3f( long long long )
@ stdcall glNormal3fv( ptr )
@ stdcall glNormal3i( long long long )
@ stdcall glNormal3iv( ptr )
@ stdcall glNormal3s( long long long )
@ stdcall glNormal3sv( ptr )
@ stdcall glNormalPointer( long long ptr )
@ stdcall glOrtho( double double double double double double )
@ stdcall glPassThrough( long )
@ stdcall glPixelMapfv( long long ptr )
@ stdcall glPixelMapuiv( long long ptr )
@ stdcall glPixelMapusv( long long ptr )
@ stdcall glPixelStoref( long long )
@ stdcall glPixelStorei( long long )
@ stdcall glPixelTransferf( long long )
@ stdcall glPixelTransferi( long long )
@ stdcall glPixelZoom( long long )
@ stdcall glPointSize( long )
@ stdcall glPolygonMode( long long )
@ stdcall glPolygonOffset( long long )
@ stdcall glPolygonStipple( ptr )
@ stdcall glPopAttrib( )
@ stdcall glPopClientAttrib( )
@ stdcall glPopMatrix( )
@ stdcall glPopName( )
@ stdcall glPrioritizeTextures( long ptr ptr )
@ stdcall glPushAttrib( long )
@ stdcall glPushClientAttrib( long )
@ stdcall glPushMatrix( )
@ stdcall glPushName( long )
@ stdcall glRasterPos2d( double double )
@ stdcall glRasterPos2dv( ptr )
@ stdcall glRasterPos2f( long long )
@ stdcall glRasterPos2fv( ptr )
@ stdcall glRasterPos2i( long long )
@ stdcall glRasterPos2iv( ptr )
@ stdcall glRasterPos2s( long long )
@ stdcall glRasterPos2sv( ptr )
@ stdcall glRasterPos3d( double double double )
@ stdcall glRasterPos3dv( ptr )
@ stdcall glRasterPos3f( long long long )
@ stdcall glRasterPos3fv( ptr )
@ stdcall glRasterPos3i( long long long )
@ stdcall glRasterPos3iv( ptr )
@ stdcall glRasterPos3s( long long long )
@ stdcall glRasterPos3sv( ptr )
@ stdcall glRasterPos4d( double double double double )
@ stdcall glRasterPos4dv( ptr )
@ stdcall glRasterPos4f( long long long long )
@ stdcall glRasterPos4fv( ptr )
@ stdcall glRasterPos4i( long long long long )
@ stdcall glRasterPos4iv( ptr )
@ stdcall glRasterPos4s( long long long long )
@ stdcall glRasterPos4sv( ptr )
@ stdcall glReadBuffer( long )
@ stdcall glReadPixels( long long long long long long ptr )
@ stdcall glRectd( double double double double )
@ stdcall glRectdv( ptr ptr )
@ stdcall glRectf( long long long long )
@ stdcall glRectfv( ptr ptr )
@ stdcall glRecti( long long long long )
@ stdcall glRectiv( ptr ptr )
@ stdcall glRects( long long long long )
@ stdcall glRectsv( ptr ptr )
@ stdcall glRenderMode( long )
@ stdcall glRotated( double double double double )
@ stdcall glRotatef( long long long long )
@ stdcall glScaled( double double double )
@ stdcall glScalef( long long long )
@ stdcall glScissor( long long long long )
@ stdcall glSelectBuffer( long ptr )
@ stdcall glShadeModel( long )
@ stdcall glStencilFunc( long long long )
@ stdcall glStencilMask( long )
@ stdcall glStencilOp( long long long )
@ stdcall glTexCoord1d( double )
@ stdcall glTexCoord1dv( ptr )
@ stdcall glTexCoord1f( long )
@ stdcall glTexCoord1fv( ptr )
@ stdcall glTexCoord1i( long )
@ stdcall glTexCoord1iv( ptr )
@ stdcall glTexCoord1s( long )
@ stdcall glTexCoord1sv( ptr )
@ stdcall glTexCoord2d( double double )
@ stdcall glTexCoord2dv( ptr )
@ stdcall glTexCoord2f( long long )
@ stdcall glTexCoord2fv( ptr )
@ stdcall glTexCoord2i( long long )
@ stdcall glTexCoord2iv( ptr )
@ stdcall glTexCoord2s( long long )
@ stdcall glTexCoord2sv( ptr )
@ stdcall glTexCoord3d( double double double )
@ stdcall glTexCoord3dv( ptr )
@ stdcall glTexCoord3f( long long long )
@ stdcall glTexCoord3fv( ptr )
@ stdcall glTexCoord3i( long long long )
@ stdcall glTexCoord3iv( ptr )
@ stdcall glTexCoord3s( long long long )
@ stdcall glTexCoord3sv( ptr )
@ stdcall glTexCoord4d( double double double double )
@ stdcall glTexCoord4dv( ptr )
@ stdcall glTexCoord4f( long long long long )
@ stdcall glTexCoord4fv( ptr )
@ stdcall glTexCoord4i( long long long long )
@ stdcall glTexCoord4iv( ptr )
@ stdcall glTexCoord4s( long long long long )
@ stdcall glTexCoord4sv( ptr )
@ stdcall glTexCoordPointer( long long long ptr )
@ stdcall glTexEnvf( long long long )
@ stdcall glTexEnvfv( long long ptr )
@ stdcall glTexEnvi( long long long )
@ stdcall glTexEnviv( long long ptr )
@ stdcall glTexGend( long long double )
@ stdcall glTexGendv( long long ptr )
@ stdcall glTexGenf( long long long )
@ stdcall glTexGenfv( long long ptr )
@ stdcall glTexGeni( long long long )
@ stdcall glTexGeniv( long long ptr )
@ stdcall glTexImage1D( long long long long long long long ptr )
@ stdcall glTexImage2D( long long long long long long long long ptr )
@ stdcall glTexParameterf( long long long )
@ stdcall glTexParameterfv( long long ptr )
@ stdcall glTexParameteri( long long long )
@ stdcall glTexParameteriv( long long ptr )
@ stdcall glTexSubImage1D( long long long long long long ptr )
@ stdcall glTexSubImage2D( long long long long long long long long ptr )
@ stdcall glTranslated( double double double )
@ stdcall glTranslatef( long long long )
@ stdcall glVertex2d( double double )
@ stdcall glVertex2dv( ptr )
@ stdcall glVertex2f( long long )
@ stdcall glVertex2fv( ptr )
@ stdcall glVertex2i( long long )
@ stdcall glVertex2iv( ptr )
@ stdcall glVertex2s( long long )
@ stdcall glVertex2sv( ptr )
@ stdcall glVertex3d( double double double )
@ stdcall glVertex3dv( ptr )
@ stdcall glVertex3f( long long long )
@ stdcall glVertex3fv( ptr )
@ stdcall glVertex3i( long long long )
@ stdcall glVertex3iv( ptr )
@ stdcall glVertex3s( long long long )
@ stdcall glVertex3sv( ptr )
@ stdcall glVertex4d( double double double double )
@ stdcall glVertex4dv( ptr )
@ stdcall glVertex4f( long long long long )
@ stdcall glVertex4fv( ptr )
@ stdcall glVertex4i( long long long long )
@ stdcall glVertex4iv( ptr )
@ stdcall glVertex4s( long long long long )
@ stdcall glVertex4sv( ptr )
@ stdcall glVertexPointer( long long long ptr )
@ stdcall glViewport( long long long long )
@ stdcall wglChoosePixelFormat(long ptr) rosglChoosePixelFormat
@ stdcall wglCopyContext(long long long) rosglCopyContext
@ stdcall wglCreateContext(long) rosglCreateContext
@ stdcall wglCreateLayerContext(long long) rosglCreateLayerContext
@ stdcall wglDeleteContext(long) rosglDeleteContext
@ stdcall wglDescribeLayerPlane(long long long long ptr) rosglDescribeLayerPlane
@ stdcall wglDescribePixelFormat(long long long ptr) rosglDescribePixelFormat
@ stdcall wglGetCurrentContext() rosglGetCurrentContext
@ stdcall wglGetCurrentDC() rosglGetCurrentDC
@ stdcall wglGetDefaultProcAddress(ptr) rosglGetDefaultProcAddress
@ stdcall wglGetLayerPaletteEntries(long long long long ptr) rosglGetLayerPaletteEntries
@ stdcall wglGetPixelFormat(long) rosglGetPixelFormat
@ stdcall wglGetProcAddress(str) rosglGetProcAddress
@ stdcall wglMakeCurrent(long long) rosglMakeCurrent
@ stdcall wglRealizeLayerPalette(long long long) rosglRealizeLayerPalette
@ stdcall wglSetLayerPaletteEntries(long long long long ptr) rosglSetLayerPaletteEntries
@ stdcall wglSetPixelFormat(long long ptr) rosglSetPixelFormat
@ stdcall wglShareLists(long long) rosglShareLists
@ stdcall wglSwapBuffers(long) rosglSwapBuffers
@ stdcall wglSwapLayerBuffers(long long) rosglSwapLayerBuffers
@ stub wglSwapMultipleBuffers
@ stdcall wglUseFontBitmapsA(long long long long)
@ stdcall wglUseFontBitmapsW(long long long long)
@ stdcall wglUseFontOutlinesA(long long long long long long long ptr)
@ stdcall wglUseFontOutlinesW(long long long long long long long ptr)

1248
dll/opengl/opengl32/wgl.c Normal file

File diff suppressed because it is too large Load diff