version0.7.10

This commit is contained in:
Andreas Rumpf 2009-06-08 08:06:25 +02:00
commit 4d4b3b1c04
193 changed files with 9099 additions and 17637 deletions

1432
lib/wrappers/opengl/gl.nim Normal file

File diff suppressed because it is too large Load diff

1548
lib/wrappers/opengl/gl.pp Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

3857
lib/wrappers/opengl/glext.pp Normal file

File diff suppressed because it is too large Load diff

311
lib/wrappers/opengl/glu.nim Normal file
View file

@ -0,0 +1,311 @@
#
#
# Adaption of the delphi3d.net OpenGL units to FreePascal
# Sebastian Guenther (sg@freepascal.org) in 2002
# These units are free to use
#******************************************************************************
# Converted to Delphi by Tom Nuydens (tom@delphi3d.net)
# For the latest updates, visit Delphi3D: http://www.delphi3d.net
#******************************************************************************
import
GL
when defined(windows):
const dllname = "glu32.dll"
elif defined(macosx):
const dllname = "/System/Library/Frameworks/OpenGL.framework/Libraries/libGLU.dylib"
else:
const dllname = "libGLU.so.1"
type
TViewPortArray* = array[0..3, TGLint]
T16dArray* = array[0..15, TGLdouble]
TCallBack* = proc ()
T3dArray* = array[0..2, TGLdouble]
T4pArray* = array[0..3, Pointer]
T4fArray* = array[0..3, TGLfloat]
PPointer* = ptr Pointer
type
GLUnurbs*{.final.} = object
PGLUnurbs* = ptr GLUnurbs
GLUquadric*{.final.} = object
PGLUquadric* = ptr GLUquadric
GLUtesselator*{.final.} = object
PGLUtesselator* = ptr GLUtesselator # backwards compatibility:
GLUnurbsObj* = GLUnurbs
PGLUnurbsObj* = PGLUnurbs
GLUquadricObj* = GLUquadric
PGLUquadricObj* = PGLUquadric
GLUtesselatorObj* = GLUtesselator
PGLUtesselatorObj* = PGLUtesselator
GLUtriangulatorObj* = GLUtesselator
PGLUtriangulatorObj* = PGLUtesselator
TGLUnurbs* = GLUnurbs
TGLUquadric* = GLUquadric
TGLUtesselator* = GLUtesselator
TGLUnurbsObj* = GLUnurbsObj
TGLUquadricObj* = GLUquadricObj
TGLUtesselatorObj* = GLUtesselatorObj
TGLUtriangulatorObj* = GLUtriangulatorObj
proc gluErrorString*(errCode: TGLenum): cstring{.dynlib: dllname, importc.}
proc gluErrorUnicodeStringEXT*(errCode: TGLenum): ptr int16{.dynlib: dllname,
importc.}
proc gluGetString*(name: TGLenum): cstring{.dynlib: dllname, importc.}
proc gluOrtho2D*(left, right, bottom, top: TGLdouble){.dynlib: dllname, importc.}
proc gluPerspective*(fovy, aspect, zNear, zFar: TGLdouble){.dynlib: dllname,
importc.}
proc gluPickMatrix*(x, y, width, height: TGLdouble, viewport: var TViewPortArray){.
dynlib: dllname, importc.}
proc gluLookAt*(eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz: TGLdouble){.
dynlib: dllname, importc.}
proc gluProject*(objx, objy, objz: TGLdouble,
modelMatrix, projMatrix: var T16dArray,
viewport: var TViewPortArray, winx, winy, winz: PGLdouble): int{.
dynlib: dllname, importc.}
proc gluUnProject*(winx, winy, winz: TGLdouble,
modelMatrix, projMatrix: var T16dArray,
viewport: var TViewPortArray, objx, objy, objz: PGLdouble): int{.
dynlib: dllname, importc.}
proc gluScaleImage*(format: TGLenum, widthin, heightin: TGLint, typein: TGLenum,
datain: Pointer, widthout, heightout: TGLint,
typeout: TGLenum, dataout: Pointer): int{.dynlib: dllname,
importc.}
proc gluBuild1DMipmaps*(target: TGLenum, components, width: TGLint,
format, atype: TGLenum, data: Pointer): int{.
dynlib: dllname, importc.}
proc gluBuild2DMipmaps*(target: TGLenum, components, width, height: TGLint,
format, atype: TGLenum, data: Pointer): int{.
dynlib: dllname, importc.}
proc gluNewQuadric*(): PGLUquadric{.dynlib: dllname, importc.}
proc gluDeleteQuadric*(state: PGLUquadric){.dynlib: dllname, importc.}
proc gluQuadricNormals*(quadObject: PGLUquadric, normals: TGLenum){.
dynlib: dllname, importc.}
proc gluQuadricTexture*(quadObject: PGLUquadric, textureCoords: TGLboolean){.
dynlib: dllname, importc.}
proc gluQuadricOrientation*(quadObject: PGLUquadric, orientation: TGLenum){.
dynlib: dllname, importc.}
proc gluQuadricDrawStyle*(quadObject: PGLUquadric, drawStyle: TGLenum){.
dynlib: dllname, importc.}
proc gluCylinder*(qobj: PGLUquadric, baseRadius, topRadius, height: TGLdouble,
slices, stacks: TGLint){.dynlib: dllname, importc.}
proc gluDisk*(qobj: PGLUquadric, innerRadius, outerRadius: TGLdouble,
slices, loops: TGLint){.dynlib: dllname, importc.}
proc gluPartialDisk*(qobj: PGLUquadric, innerRadius, outerRadius: TGLdouble,
slices, loops: TGLint, startAngle, sweepAngle: TGLdouble){.
dynlib: dllname, importc.}
proc gluSphere*(qobj: PGLuquadric, radius: TGLdouble, slices, stacks: TGLint){.
dynlib: dllname, importc.}
proc gluQuadricCallback*(qobj: PGLUquadric, which: TGLenum, fn: TCallBack){.
dynlib: dllname, importc.}
proc gluNewTess*(): PGLUtesselator{.dynlib: dllname, importc.}
proc gluDeleteTess*(tess: PGLUtesselator){.dynlib: dllname, importc.}
proc gluTessBeginPolygon*(tess: PGLUtesselator, polygon_data: Pointer){.
dynlib: dllname, importc.}
proc gluTessBeginContour*(tess: PGLUtesselator){.dynlib: dllname, importc.}
proc gluTessVertex*(tess: PGLUtesselator, coords: var T3dArray, data: Pointer){.
dynlib: dllname, importc.}
proc gluTessEndContour*(tess: PGLUtesselator){.dynlib: dllname, importc.}
proc gluTessEndPolygon*(tess: PGLUtesselator){.dynlib: dllname, importc.}
proc gluTessProperty*(tess: PGLUtesselator, which: TGLenum, value: TGLdouble){.
dynlib: dllname, importc.}
proc gluTessNormal*(tess: PGLUtesselator, x, y, z: TGLdouble){.dynlib: dllname,
importc.}
proc gluTessCallback*(tess: PGLUtesselator, which: TGLenum, fn: TCallBack){.
dynlib: dllname, importc.}
proc gluGetTessProperty*(tess: PGLUtesselator, which: TGLenum, value: PGLdouble){.
dynlib: dllname, importc.}
proc gluNewNurbsRenderer*(): PGLUnurbs{.dynlib: dllname, importc.}
proc gluDeleteNurbsRenderer*(nobj: PGLUnurbs){.dynlib: dllname, importc.}
proc gluBeginSurface*(nobj: PGLUnurbs){.dynlib: dllname, importc.}
proc gluBeginCurve*(nobj: PGLUnurbs){.dynlib: dllname, importc.}
proc gluEndCurve*(nobj: PGLUnurbs){.dynlib: dllname, importc.}
proc gluEndSurface*(nobj: PGLUnurbs){.dynlib: dllname, importc.}
proc gluBeginTrim*(nobj: PGLUnurbs){.dynlib: dllname, importc.}
proc gluEndTrim*(nobj: PGLUnurbs){.dynlib: dllname, importc.}
proc gluPwlCurve*(nobj: PGLUnurbs, count: TGLint, aarray: PGLfloat,
stride: TGLint, atype: TGLenum){.dynlib: dllname, importc.}
proc gluNurbsCurve*(nobj: PGLUnurbs, nknots: TGLint, knot: PGLfloat,
stride: TGLint, ctlarray: PGLfloat, order: TGLint,
atype: TGLenum){.dynlib: dllname, importc.}
proc gluNurbsSurface*(nobj: PGLUnurbs, sknot_count: TGLint, sknot: PGLfloat,
tknot_count: TGLint, tknot: PGLfloat,
s_stride, t_stride: TGLint, ctlarray: PGLfloat,
sorder, torder: TGLint, atype: TGLenum){.dynlib: dllname,
importc.}
proc gluLoadSamplingMatrices*(nobj: PGLUnurbs,
modelMatrix, projMatrix: var T16dArray,
viewport: var TViewPortArray){.dynlib: dllname,
importc.}
proc gluNurbsProperty*(nobj: PGLUnurbs, aproperty: TGLenum, value: TGLfloat){.
dynlib: dllname, importc.}
proc gluGetNurbsProperty*(nobj: PGLUnurbs, aproperty: TGLenum, value: PGLfloat){.
dynlib: dllname, importc.}
proc gluNurbsCallback*(nobj: PGLUnurbs, which: TGLenum, fn: TCallBack){.
dynlib: dllname, importc.}
#*** Callback function prototypes ***
type # gluQuadricCallback
GLUquadricErrorProc* = proc (p: TGLenum) # gluTessCallback
GLUtessBeginProc* = proc (p: TGLenum)
GLUtessEdgeFlagProc* = proc (p: TGLboolean)
GLUtessVertexProc* = proc (p: Pointer)
GLUtessEndProc* = proc ()
GLUtessErrorProc* = proc (p: TGLenum)
GLUtessCombineProc* = proc (p1: var T3dArray, p2: T4pArray, p3: T4fArray,
p4: PPointer)
GLUtessBeginDataProc* = proc (p1: TGLenum, p2: Pointer)
GLUtessEdgeFlagDataProc* = proc (p1: TGLboolean, p2: Pointer)
GLUtessVertexDataProc* = proc (p1, p2: Pointer)
GLUtessEndDataProc* = proc (p: Pointer)
GLUtessErrorDataProc* = proc (p1: TGLenum, p2: Pointer)
GLUtessCombineDataProc* = proc (p1: var T3dArray, p2: var T4pArray,
p3: var T4fArray, p4: PPointer, p5: Pointer) #
# gluNurbsCallback
GLUnurbsErrorProc* = proc (p: TGLenum) #*** Generic constants ****/
const # Version
GLU_VERSION_1_1* = 1
GLU_VERSION_1_2* = 1 # Errors: (return value 0 = no error)
GLU_INVALID_ENUM* = 100900
GLU_INVALID_VALUE* = 100901
GLU_OUT_OF_MEMORY* = 100902
GLU_INCOMPATIBLE_GL_VERSION* = 100903 # StringName
GLU_VERSION* = 100800
GLU_EXTENSIONS* = 100801 # Boolean
GLU_TRUE* = GL_TRUE
GLU_FALSE* = GL_FALSE #*** Quadric constants ****/
# QuadricNormal
GLU_SMOOTH* = 100000
GLU_FLAT* = 100001
GLU_NONE* = 100002 # QuadricDrawStyle
GLU_POINT* = 100010
GLU_LINE* = 100011
GLU_FILL* = 100012
GLU_SILHOUETTE* = 100013 # QuadricOrientation
GLU_OUTSIDE* = 100020
GLU_INSIDE* = 100021 # Callback types:
# GLU_ERROR = 100103;
#*** Tesselation constants ****/
GLU_TESS_MAX_COORD* = 1.00000e+150 # TessProperty
GLU_TESS_WINDING_RULE* = 100140
GLU_TESS_BOUNDARY_ONLY* = 100141
GLU_TESS_TOLERANCE* = 100142 # TessWinding
GLU_TESS_WINDING_ODD* = 100130
GLU_TESS_WINDING_NONZERO* = 100131
GLU_TESS_WINDING_POSITIVE* = 100132
GLU_TESS_WINDING_NEGATIVE* = 100133
GLU_TESS_WINDING_ABS_GEQ_TWO* = 100134 # TessCallback
GLU_TESS_BEGIN* = 100100 # void (CALLBACK*)(TGLenum type)
constGLU_TESS_VERTEX* = 100101 # void (CALLBACK*)(void *data)
GLU_TESS_END* = 100102 # void (CALLBACK*)(void)
GLU_TESS_ERROR* = 100103 # void (CALLBACK*)(TGLenum errno)
GLU_TESS_EDGE_FLAG* = 100104 # void (CALLBACK*)(TGLboolean boundaryEdge)
GLU_TESS_COMBINE* = 100105 # void (CALLBACK*)(TGLdouble coords[3],
# void *data[4],
# TGLfloat weight[4],
# void **dataOut)
GLU_TESS_BEGIN_DATA* = 100106 # void (CALLBACK*)(TGLenum type,
# void *polygon_data)
GLU_TESS_VERTEX_DATA* = 100107 # void (CALLBACK*)(void *data,
# void *polygon_data)
GLU_TESS_END_DATA* = 100108 # void (CALLBACK*)(void *polygon_data)
GLU_TESS_ERROR_DATA* = 100109 # void (CALLBACK*)(TGLenum errno,
# void *polygon_data)
GLU_TESS_EDGE_FLAG_DATA* = 100110 # void (CALLBACK*)(TGLboolean boundaryEdge,
# void *polygon_data)
GLU_TESS_COMBINE_DATA* = 100111 # void (CALLBACK*)(TGLdouble coords[3],
# void *data[4],
# TGLfloat weight[4],
# void **dataOut,
# void *polygon_data)
# TessError
GLU_TESS_ERROR1* = 100151
GLU_TESS_ERROR2* = 100152
GLU_TESS_ERROR3* = 100153
GLU_TESS_ERROR4* = 100154
GLU_TESS_ERROR5* = 100155
GLU_TESS_ERROR6* = 100156
GLU_TESS_ERROR7* = 100157
GLU_TESS_ERROR8* = 100158
GLU_TESS_MISSING_BEGIN_POLYGON* = GLU_TESS_ERROR1
GLU_TESS_MISSING_BEGIN_CONTOUR* = GLU_TESS_ERROR2
GLU_TESS_MISSING_END_POLYGON* = GLU_TESS_ERROR3
GLU_TESS_MISSING_END_CONTOUR* = GLU_TESS_ERROR4
GLU_TESS_COORD_TOO_LARGE* = GLU_TESS_ERROR5
GLU_TESS_NEED_COMBINE_CALLBACK* = GLU_TESS_ERROR6 #*** NURBS constants ****/
# NurbsProperty
GLU_AUTO_LOAD_MATRIX* = 100200
GLU_CULLING* = 100201
GLU_SAMPLING_TOLERANCE* = 100203
GLU_DISPLAY_MODE* = 100204
GLU_PARAMETRIC_TOLERANCE* = 100202
GLU_SAMPLING_METHOD* = 100205
GLU_U_STEP* = 100206
GLU_V_STEP* = 100207 # NurbsSampling
GLU_PATH_LENGTH* = 100215
GLU_PARAMETRIC_ERROR* = 100216
GLU_DOMAIN_DISTANCE* = 100217 # NurbsTrim
GLU_MAP1_TRIM_2* = 100210
GLU_MAP1_TRIM_3* = 100211 # NurbsDisplay
# GLU_FILL = 100012;
GLU_OUTLINE_POLYGON* = 100240
GLU_OUTLINE_PATCH* = 100241 # NurbsCallback
# GLU_ERROR = 100103;
# NurbsErrors
GLU_NURBS_ERROR1* = 100251
GLU_NURBS_ERROR2* = 100252
GLU_NURBS_ERROR3* = 100253
GLU_NURBS_ERROR4* = 100254
GLU_NURBS_ERROR5* = 100255
GLU_NURBS_ERROR6* = 100256
GLU_NURBS_ERROR7* = 100257
GLU_NURBS_ERROR8* = 100258
GLU_NURBS_ERROR9* = 100259
GLU_NURBS_ERROR10* = 100260
GLU_NURBS_ERROR11* = 100261
GLU_NURBS_ERROR12* = 100262
GLU_NURBS_ERROR13* = 100263
GLU_NURBS_ERROR14* = 100264
GLU_NURBS_ERROR15* = 100265
GLU_NURBS_ERROR16* = 100266
GLU_NURBS_ERROR17* = 100267
GLU_NURBS_ERROR18* = 100268
GLU_NURBS_ERROR19* = 100269
GLU_NURBS_ERROR20* = 100270
GLU_NURBS_ERROR21* = 100271
GLU_NURBS_ERROR22* = 100272
GLU_NURBS_ERROR23* = 100273
GLU_NURBS_ERROR24* = 100274
GLU_NURBS_ERROR25* = 100275
GLU_NURBS_ERROR26* = 100276
GLU_NURBS_ERROR27* = 100277
GLU_NURBS_ERROR28* = 100278
GLU_NURBS_ERROR29* = 100279
GLU_NURBS_ERROR30* = 100280
GLU_NURBS_ERROR31* = 100281
GLU_NURBS_ERROR32* = 100282
GLU_NURBS_ERROR33* = 100283
GLU_NURBS_ERROR34* = 100284
GLU_NURBS_ERROR35* = 100285
GLU_NURBS_ERROR36* = 100286
GLU_NURBS_ERROR37* = 100287 #*** Backwards compatibility for old tesselator ****/
proc gluBeginPolygon*(tess: PGLUtesselator){.dynlib: dllname, importc.}
proc gluNextContour*(tess: PGLUtesselator, atype: TGLenum){.dynlib: dllname,
importc.}
proc gluEndPolygon*(tess: PGLUtesselator){.dynlib: dllname, importc.}
const # Contours types -- obsolete!
GLU_CW* = 100120
GLU_CCW* = 100121
GLU_INTERIOR* = 100122
GLU_EXTERIOR* = 100123
GLU_UNKNOWN* = 100124 # Names without "TESS_" prefix
GLU_BEGIN* = GLU_TESS_BEGIN
GLU_VERTEX* = constGLU_TESS_VERTEX
GLU_END* = GLU_TESS_END
GLU_ERROR* = GLU_TESS_ERROR
GLU_EDGE_FLAG* = GLU_TESS_EDGE_FLAG
# implementation

368
lib/wrappers/opengl/glu.pp Normal file
View file

@ -0,0 +1,368 @@
{
Adaption of the delphi3d.net OpenGL units to FreePascal
Sebastian Guenther (sg@freepascal.org) in 2002
These units are free to use
}
{*++ BUILD Version: 0004 // Increment this if a change has global effects
Copyright (c) 1985-95, Microsoft Corporation
Module Name:
glu.h
Abstract:
Procedure declarations, constant definitions and macros for the OpenGL
Utility Library.
--*}
{*
** Copyright 1991-1993, Silicon Graphics, Inc.
** All Rights Reserved.
**
** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
** the contents of this file may not be disclosed to third parties, copied or
** duplicated in any form, in whole or in part, without the prior written
** permission of Silicon Graphics, Inc.
**
** RESTRICTED RIGHTS LEGEND:
** Use, duplication or disclosure by the Government is subject to restrictions
** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
** rights reserved under the Copyright Laws of the United States.
*}
{*
** Return the error string associated with a particular error code.
** This will return 0 for an invalid error code.
**
** The generic function prototype that can be compiled for ANSI or Unicode
** is defined as follows:
**
** LPCTSTR APIENTRY gluErrorStringWIN (GLenum errCode);
*}
{******************************************************************************}
{ Converted to Delphi by Tom Nuydens (tom@delphi3d.net) }
{ For the latest updates, visit Delphi3D: http://www.delphi3d.net }
{******************************************************************************}
unit GLu;
interface
uses
GL;
const
dllname = 'glu32.dll';
dylibname = '/System/Library/Frameworks/OpenGL.framework/Libraries/libGLU.dylib';
libname = 'libGLU.so.1';
type
TViewPortArray = array [0..3] of GLint;
T16dArray = array [0..15] of GLdouble;
TCallBack = procedure;
T3dArray = array [0..2] of GLdouble;
T4pArray = array [0..3] of Pointer;
T4fArray = array [0..3] of GLfloat;
PPointer = ^Pointer;
type
GLUnurbs = record end; PGLUnurbs = ^GLUnurbs;
GLUquadric = record end; PGLUquadric = ^GLUquadric;
GLUtesselator = record end; PGLUtesselator = ^GLUtesselator;
// backwards compatibility:
GLUnurbsObj = GLUnurbs; PGLUnurbsObj = PGLUnurbs;
GLUquadricObj = GLUquadric; PGLUquadricObj = PGLUquadric;
GLUtesselatorObj = GLUtesselator; PGLUtesselatorObj = PGLUtesselator;
GLUtriangulatorObj = GLUtesselator; PGLUtriangulatorObj = PGLUtesselator;
TGLUnurbs = GLUnurbs;
TGLUquadric = GLUquadric;
TGLUtesselator = GLUtesselator;
TGLUnurbsObj = GLUnurbsObj;
TGLUquadricObj = GLUquadricObj;
TGLUtesselatorObj = GLUtesselatorObj;
TGLUtriangulatorObj = GLUtriangulatorObj;
function gluErrorString(errCode: GLenum): PChar; external dllname;
function gluErrorUnicodeStringEXT(errCode: GLenum): PWideChar; external dllname;
function gluGetString(name: GLenum): PChar; external dllname;
procedure gluOrtho2D(left,right, bottom, top: GLdouble); external dllname;
procedure gluPerspective(fovy, aspect, zNear, zFar: GLdouble); external dllname;
procedure gluPickMatrix(x, y, width, height: GLdouble; var viewport: TViewPortArray); external dllname;
procedure gluLookAt(eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz: GLdouble); external dllname;
function gluProject(objx, objy, objz: GLdouble; var modelMatrix, projMatrix: T16dArray; var viewport: TViewPortArray; winx, winy, winz: PGLdouble): Integer; external dllname;
function gluUnProject(winx, winy, winz: GLdouble; var modelMatrix, projMatrix: T16dArray; var viewport: TViewPortArray; objx, objy, objz: PGLdouble): Integer; external dllname;
function gluScaleImage(format: GLenum; widthin, heightin: GLint; typein: GLenum; const datain: Pointer; widthout, heightout: GLint; typeout: GLenum; dataout: Pointer): Integer; external dllname;
function gluBuild1DMipmaps(target: GLenum; components, width: GLint; format, atype: GLenum; const data: Pointer): Integer; external dllname;
function gluBuild2DMipmaps(target: GLenum; components, width, height: GLint; format, atype: GLenum; const data: Pointer): Integer; external dllname;
function gluNewQuadric: PGLUquadric; external dllname;
procedure gluDeleteQuadric(state: PGLUquadric); external dllname;
procedure gluQuadricNormals(quadObject: PGLUquadric; normals: GLenum); external dllname;
procedure gluQuadricTexture(quadObject: PGLUquadric; textureCoords: GLboolean); external dllname;
procedure gluQuadricOrientation(quadObject: PGLUquadric; orientation: GLenum); external dllname;
procedure gluQuadricDrawStyle(quadObject: PGLUquadric; drawStyle: GLenum); external dllname;
procedure gluCylinder(qobj: PGLUquadric; baseRadius, topRadius, height: GLdouble; slices, stacks: GLint); external dllname;
procedure gluDisk(qobj: PGLUquadric; innerRadius, outerRadius: GLdouble; slices, loops: GLint); external dllname;
procedure gluPartialDisk(qobj: PGLUquadric; innerRadius, outerRadius: GLdouble; slices, loops: GLint; startAngle, sweepAngle: GLdouble); external dllname;
procedure gluSphere(qobj: PGLuquadric; radius: GLdouble; slices, stacks: GLint); external dllname;
procedure gluQuadricCallback(qobj: PGLUquadric; which: GLenum; fn: TCallBack); external dllname;
function gluNewTess: PGLUtesselator; external dllname;
procedure gluDeleteTess(tess: PGLUtesselator); external dllname;
procedure gluTessBeginPolygon(tess: PGLUtesselator; polygon_data: Pointer); external dllname;
procedure gluTessBeginContour(tess: PGLUtesselator); external dllname;
procedure gluTessVertex(tess: PGLUtesselator; var coords: T3dArray; data: Pointer); external dllname;
procedure gluTessEndContour(tess: PGLUtesselator); external dllname;
procedure gluTessEndPolygon(tess: PGLUtesselator); external dllname;
procedure gluTessProperty(tess: PGLUtesselator; which: GLenum; value: GLdouble); external dllname;
procedure gluTessNormal(tess: PGLUtesselator; x, y, z: GLdouble); external dllname;
procedure gluTessCallback(tess: PGLUtesselator; which: GLenum;fn: TCallBack); external dllname;
procedure gluGetTessProperty(tess: PGLUtesselator; which: GLenum; value: PGLdouble); external dllname;
function gluNewNurbsRenderer: PGLUnurbs; external dllname;
procedure gluDeleteNurbsRenderer(nobj: PGLUnurbs); external dllname;
procedure gluBeginSurface(nobj: PGLUnurbs); external dllname;
procedure gluBeginCurve(nobj: PGLUnurbs); external dllname;
procedure gluEndCurve(nobj: PGLUnurbs); external dllname;
procedure gluEndSurface(nobj: PGLUnurbs); external dllname;
procedure gluBeginTrim(nobj: PGLUnurbs); external dllname;
procedure gluEndTrim(nobj: PGLUnurbs); external dllname;
procedure gluPwlCurve(nobj: PGLUnurbs; count: GLint; aarray: PGLfloat; stride: GLint; atype: GLenum); external dllname;
procedure gluNurbsCurve(nobj: PGLUnurbs; nknots: GLint; knot: PGLfloat; stride: GLint; ctlarray: PGLfloat; order: GLint; atype: GLenum); external dllname;
procedure gluNurbsSurface(nobj: PGLUnurbs; sknot_count: GLint; sknot: PGLfloat; tknot_count: GLint; tknot: PGLfloat; s_stride, t_stride: GLint; ctlarray: PGLfloat; sorder, torder: GLint; atype: GLenum); external dllname;
procedure gluLoadSamplingMatrices(nobj: PGLUnurbs; var modelMatrix, projMatrix: T16dArray; var viewport: TViewPortArray); external dllname;
procedure gluNurbsProperty(nobj: PGLUnurbs; aproperty: GLenum; value: GLfloat); external dllname;
procedure gluGetNurbsProperty(nobj: PGLUnurbs; aproperty: GLenum; value: PGLfloat); external dllname;
procedure gluNurbsCallback(nobj: PGLUnurbs; which: GLenum; fn: TCallBack); external dllname;
(**** Callback function prototypes ****)
type
// gluQuadricCallback
GLUquadricErrorProc = procedure(p: GLenum);
// gluTessCallback
GLUtessBeginProc = procedure(p: GLenum);
GLUtessEdgeFlagProc = procedure(p: GLboolean);
GLUtessVertexProc = procedure(p: Pointer);
GLUtessEndProc = procedure;
GLUtessErrorProc = procedure(p: GLenum);
GLUtessCombineProc = procedure(var p1: T3dArray; p2: T4pArray; p3: T4fArray; p4: PPointer);
GLUtessBeginDataProc = procedure(p1: GLenum; p2: Pointer);
GLUtessEdgeFlagDataProc = procedure(p1: GLboolean; p2: Pointer);
GLUtessVertexDataProc = procedure(p1, p2: Pointer);
GLUtessEndDataProc = procedure(p: Pointer);
GLUtessErrorDataProc = procedure(p1: GLenum; p2: Pointer);
GLUtessCombineDataProc = procedure(var p1: T3dArray; var p2: T4pArray; var p3: T4fArray;
p4: PPointer; p5: Pointer);
// gluNurbsCallback
GLUnurbsErrorProc = procedure(p: GLenum);
//*** Generic constants ****/
const
// Version
GLU_VERSION_1_1 = 1;
GLU_VERSION_1_2 = 1;
// Errors: (return value 0 = no error)
GLU_INVALID_ENUM = 100900;
GLU_INVALID_VALUE = 100901;
GLU_OUT_OF_MEMORY = 100902;
GLU_INCOMPATIBLE_GL_VERSION = 100903;
// StringName
GLU_VERSION = 100800;
GLU_EXTENSIONS = 100801;
// Boolean
GLU_TRUE = GL_TRUE;
GLU_FALSE = GL_FALSE;
//*** Quadric constants ****/
// QuadricNormal
GLU_SMOOTH = 100000;
GLU_FLAT = 100001;
GLU_NONE = 100002;
// QuadricDrawStyle
GLU_POINT = 100010;
GLU_LINE = 100011;
GLU_FILL = 100012;
GLU_SILHOUETTE = 100013;
// QuadricOrientation
GLU_OUTSIDE = 100020;
GLU_INSIDE = 100021;
// Callback types:
// GLU_ERROR = 100103;
//*** Tesselation constants ****/
GLU_TESS_MAX_COORD = 1.0e150;
// TessProperty
GLU_TESS_WINDING_RULE = 100140;
GLU_TESS_BOUNDARY_ONLY = 100141;
GLU_TESS_TOLERANCE = 100142;
// TessWinding
GLU_TESS_WINDING_ODD = 100130;
GLU_TESS_WINDING_NONZERO = 100131;
GLU_TESS_WINDING_POSITIVE = 100132;
GLU_TESS_WINDING_NEGATIVE = 100133;
GLU_TESS_WINDING_ABS_GEQ_TWO = 100134;
// TessCallback
GLU_TESS_BEGIN = 100100; // void (CALLBACK*)(GLenum type)
GLU_TESS_VERTEX = 100101; // void (CALLBACK*)(void *data)
GLU_TESS_END = 100102; // void (CALLBACK*)(void)
GLU_TESS_ERROR = 100103; // void (CALLBACK*)(GLenum errno)
GLU_TESS_EDGE_FLAG = 100104; // void (CALLBACK*)(GLboolean boundaryEdge)
GLU_TESS_COMBINE = 100105; { void (CALLBACK*)(GLdouble coords[3],
void *data[4],
GLfloat weight[4],
void **dataOut) }
GLU_TESS_BEGIN_DATA = 100106; { void (CALLBACK*)(GLenum type,
void *polygon_data) }
GLU_TESS_VERTEX_DATA = 100107; { void (CALLBACK*)(void *data,
void *polygon_data) }
GLU_TESS_END_DATA = 100108; // void (CALLBACK*)(void *polygon_data)
GLU_TESS_ERROR_DATA = 100109; { void (CALLBACK*)(GLenum errno,
void *polygon_data) }
GLU_TESS_EDGE_FLAG_DATA = 100110; { void (CALLBACK*)(GLboolean boundaryEdge,
void *polygon_data) }
GLU_TESS_COMBINE_DATA = 100111; { void (CALLBACK*)(GLdouble coords[3],
void *data[4],
GLfloat weight[4],
void **dataOut,
void *polygon_data) }
// TessError
GLU_TESS_ERROR1 = 100151;
GLU_TESS_ERROR2 = 100152;
GLU_TESS_ERROR3 = 100153;
GLU_TESS_ERROR4 = 100154;
GLU_TESS_ERROR5 = 100155;
GLU_TESS_ERROR6 = 100156;
GLU_TESS_ERROR7 = 100157;
GLU_TESS_ERROR8 = 100158;
GLU_TESS_MISSING_BEGIN_POLYGON = GLU_TESS_ERROR1;
GLU_TESS_MISSING_BEGIN_CONTOUR = GLU_TESS_ERROR2;
GLU_TESS_MISSING_END_POLYGON = GLU_TESS_ERROR3;
GLU_TESS_MISSING_END_CONTOUR = GLU_TESS_ERROR4;
GLU_TESS_COORD_TOO_LARGE = GLU_TESS_ERROR5;
GLU_TESS_NEED_COMBINE_CALLBACK = GLU_TESS_ERROR6;
//*** NURBS constants ****/
// NurbsProperty
GLU_AUTO_LOAD_MATRIX = 100200;
GLU_CULLING = 100201;
GLU_SAMPLING_TOLERANCE = 100203;
GLU_DISPLAY_MODE = 100204;
GLU_PARAMETRIC_TOLERANCE = 100202;
GLU_SAMPLING_METHOD = 100205;
GLU_U_STEP = 100206;
GLU_V_STEP = 100207;
// NurbsSampling
GLU_PATH_LENGTH = 100215;
GLU_PARAMETRIC_ERROR = 100216;
GLU_DOMAIN_DISTANCE = 100217;
// NurbsTrim
GLU_MAP1_TRIM_2 = 100210;
GLU_MAP1_TRIM_3 = 100211;
// NurbsDisplay
// GLU_FILL = 100012;
GLU_OUTLINE_POLYGON = 100240;
GLU_OUTLINE_PATCH = 100241;
// NurbsCallback
// GLU_ERROR = 100103;
// NurbsErrors
GLU_NURBS_ERROR1 = 100251;
GLU_NURBS_ERROR2 = 100252;
GLU_NURBS_ERROR3 = 100253;
GLU_NURBS_ERROR4 = 100254;
GLU_NURBS_ERROR5 = 100255;
GLU_NURBS_ERROR6 = 100256;
GLU_NURBS_ERROR7 = 100257;
GLU_NURBS_ERROR8 = 100258;
GLU_NURBS_ERROR9 = 100259;
GLU_NURBS_ERROR10 = 100260;
GLU_NURBS_ERROR11 = 100261;
GLU_NURBS_ERROR12 = 100262;
GLU_NURBS_ERROR13 = 100263;
GLU_NURBS_ERROR14 = 100264;
GLU_NURBS_ERROR15 = 100265;
GLU_NURBS_ERROR16 = 100266;
GLU_NURBS_ERROR17 = 100267;
GLU_NURBS_ERROR18 = 100268;
GLU_NURBS_ERROR19 = 100269;
GLU_NURBS_ERROR20 = 100270;
GLU_NURBS_ERROR21 = 100271;
GLU_NURBS_ERROR22 = 100272;
GLU_NURBS_ERROR23 = 100273;
GLU_NURBS_ERROR24 = 100274;
GLU_NURBS_ERROR25 = 100275;
GLU_NURBS_ERROR26 = 100276;
GLU_NURBS_ERROR27 = 100277;
GLU_NURBS_ERROR28 = 100278;
GLU_NURBS_ERROR29 = 100279;
GLU_NURBS_ERROR30 = 100280;
GLU_NURBS_ERROR31 = 100281;
GLU_NURBS_ERROR32 = 100282;
GLU_NURBS_ERROR33 = 100283;
GLU_NURBS_ERROR34 = 100284;
GLU_NURBS_ERROR35 = 100285;
GLU_NURBS_ERROR36 = 100286;
GLU_NURBS_ERROR37 = 100287;
//*** Backwards compatibility for old tesselator ****/
procedure gluBeginPolygon(tess: PGLUtesselator); external dllname;
procedure gluNextContour(tess: PGLUtesselator; atype: GLenum); external dllname;
procedure gluEndPolygon(tess: PGLUtesselator); external dllname;
const
// Contours types -- obsolete!
GLU_CW = 100120;
GLU_CCW = 100121;
GLU_INTERIOR = 100122;
GLU_EXTERIOR = 100123;
GLU_UNKNOWN = 100124;
// Names without "TESS_" prefix
GLU_BEGIN = GLU_TESS_BEGIN;
GLU_VERTEX = GLU_TESS_VERTEX;
GLU_END = GLU_TESS_END;
GLU_ERROR = GLU_TESS_ERROR;
GLU_EDGE_FLAG = GLU_TESS_EDGE_FLAG;
implementation
end.

View file

@ -0,0 +1,378 @@
#
#
# Adaption of the delphi3d.net OpenGL units to FreePascal
# Sebastian Guenther (sg@freepascal.org) in 2002
# These units are free to use
#
# Copyright (c) Mark J. Kilgard, 1994, 1995, 1996.
# This program is freely distributable without licensing fees and is
# provided without guarantee or warrantee expressed or implied. This
# program is -not- in the public domain.
#******************************************************************************
# Converted to Delphi by Tom Nuydens (tom@delphi3d.net)
# Contributions by Igor Karpov (glygrik@hotbox.ru)
# For the latest updates, visit Delphi3D: http://www.delphi3d.net
#******************************************************************************
import
GL
when defined(windows):
const dllname = "glut32.dll"
elif defined(macosx):
const dllname = "/System/Library/Frameworks/GLUT.framework/GLUT"
else:
const dllname = "libglut.so.3"
type
PInteger* = ptr int
PPChar* = ptr cstring
TGlutVoidCallback* = proc (){.cdecl.}
TGlut1IntCallback* = proc (value: cint){.cdecl.}
TGlut2IntCallback* = proc (v1, v2: cint){.cdecl.}
TGlut3IntCallback* = proc (v1, v2, v3: cint){.cdecl.}
TGlut4IntCallback* = proc (v1, v2, v3, v4: cint){.cdecl.}
TGlut1Char2IntCallback* = proc (c: int8, v1, v2: cint){.cdecl.}
TGlut1UInt3IntCallback* = proc (u, v1, v2, v3: cint){.cdecl.}
const
GLUT_API_VERSION* = 3
GLUT_XLIB_IMPLEMENTATION* = 12 # Display mode bit masks.
GLUT_RGB* = 0
GLUT_RGBA* = GLUT_RGB
GLUT_INDEX* = 1
GLUT_SINGLE* = 0
GLUT_DOUBLE* = 2
GLUT_ACCUM* = 4
GLUT_ALPHA* = 8
GLUT_DEPTH* = 16
GLUT_STENCIL* = 32
GLUT_MULTISAMPLE* = 128
GLUT_STEREO* = 256
GLUT_LUMINANCE* = 512 # Mouse buttons.
GLUT_LEFT_BUTTON* = 0
GLUT_MIDDLE_BUTTON* = 1
GLUT_RIGHT_BUTTON* = 2 # Mouse button state.
GLUT_DOWN* = 0
GLUT_UP* = 1 # function keys
GLUT_KEY_F1* = 1
GLUT_KEY_F2* = 2
GLUT_KEY_F3* = 3
GLUT_KEY_F4* = 4
GLUT_KEY_F5* = 5
GLUT_KEY_F6* = 6
GLUT_KEY_F7* = 7
GLUT_KEY_F8* = 8
GLUT_KEY_F9* = 9
GLUT_KEY_F10* = 10
GLUT_KEY_F11* = 11
GLUT_KEY_F12* = 12 # directional keys
GLUT_KEY_LEFT* = 100
GLUT_KEY_UP* = 101
GLUT_KEY_RIGHT* = 102
GLUT_KEY_DOWN* = 103
GLUT_KEY_PAGE_UP* = 104
GLUT_KEY_PAGE_DOWN* = 105
GLUT_KEY_HOME* = 106
GLUT_KEY_END* = 107
GLUT_KEY_INSERT* = 108 # Entry/exit state.
GLUT_LEFT* = 0
GLUT_ENTERED* = 1 # Menu usage state.
GLUT_MENU_NOT_IN_USE* = 0
GLUT_MENU_IN_USE* = 1 # Visibility state.
GLUT_NOT_VISIBLE* = 0
GLUT_VISIBLE* = 1 # Window status state.
GLUT_HIDDEN* = 0
GLUT_FULLY_RETAINED* = 1
GLUT_PARTIALLY_RETAINED* = 2
GLUT_FULLY_COVERED* = 3 # Color index component selection values.
GLUT_RED* = 0
GLUT_GREEN* = 1
GLUT_BLUE* = 2 # Layers for use.
GLUT_NORMAL* = 0
GLUT_OVERLAY* = 1
when defined(Windows):
const # Stroke font constants (use these in GLUT program).
GLUT_STROKE_ROMAN* = cast[Pointer](0)
GLUT_STROKE_MONO_ROMAN* = cast[Pointer](1) # Bitmap font constants (use these in GLUT program).
GLUT_BITMAP_9_BY_15* = cast[Pointer](2)
GLUT_BITMAP_8_BY_13* = cast[Pointer](3)
GLUT_BITMAP_TIMES_ROMAN_10* = cast[Pointer](4)
GLUT_BITMAP_TIMES_ROMAN_24* = cast[Pointer](5)
GLUT_BITMAP_HELVETICA_10* = cast[Pointer](6)
GLUT_BITMAP_HELVETICA_12* = cast[Pointer](7)
GLUT_BITMAP_HELVETICA_18* = cast[Pointer](8)
else:
var # Stroke font constants (use these in GLUT program).
GLUT_STROKE_ROMAN*: Pointer
GLUT_STROKE_MONO_ROMAN*: Pointer # Bitmap font constants (use these in GLUT program).
GLUT_BITMAP_9_BY_15*: Pointer
GLUT_BITMAP_8_BY_13*: Pointer
GLUT_BITMAP_TIMES_ROMAN_10*: Pointer
GLUT_BITMAP_TIMES_ROMAN_24*: Pointer
GLUT_BITMAP_HELVETICA_10*: Pointer
GLUT_BITMAP_HELVETICA_12*: Pointer
GLUT_BITMAP_HELVETICA_18*: Pointer
const # glutGet parameters.
GLUT_WINDOW_X* = 100
GLUT_WINDOW_Y* = 101
GLUT_WINDOW_WIDTH* = 102
GLUT_WINDOW_HEIGHT* = 103
GLUT_WINDOW_BUFFER_SIZE* = 104
GLUT_WINDOW_STENCIL_SIZE* = 105
GLUT_WINDOW_DEPTH_SIZE* = 106
GLUT_WINDOW_RED_SIZE* = 107
GLUT_WINDOW_GREEN_SIZE* = 108
GLUT_WINDOW_BLUE_SIZE* = 109
GLUT_WINDOW_ALPHA_SIZE* = 110
GLUT_WINDOW_ACCUM_RED_SIZE* = 111
GLUT_WINDOW_ACCUM_GREEN_SIZE* = 112
GLUT_WINDOW_ACCUM_BLUE_SIZE* = 113
GLUT_WINDOW_ACCUM_ALPHA_SIZE* = 114
GLUT_WINDOW_DOUBLEBUFFER* = 115
GLUT_WINDOW_RGBA* = 116
GLUT_WINDOW_PARENT* = 117
GLUT_WINDOW_NUM_CHILDREN* = 118
GLUT_WINDOW_COLORMAP_SIZE* = 119
GLUT_WINDOW_NUM_SAMPLES* = 120
GLUT_WINDOW_STEREO* = 121
GLUT_WINDOW_CURSOR* = 122
GLUT_SCREEN_WIDTH* = 200
GLUT_SCREEN_HEIGHT* = 201
GLUT_SCREEN_WIDTH_MM* = 202
GLUT_SCREEN_HEIGHT_MM* = 203
GLUT_MENU_NUM_ITEMS* = 300
GLUT_DISPLAY_MODE_POSSIBLE* = 400
GLUT_INIT_WINDOW_X* = 500
GLUT_INIT_WINDOW_Y* = 501
GLUT_INIT_WINDOW_WIDTH* = 502
GLUT_INIT_WINDOW_HEIGHT* = 503
constGLUT_INIT_DISPLAY_MODE* = 504
GLUT_ELAPSED_TIME* = 700
GLUT_WINDOW_FORMAT_ID* = 123 # glutDeviceGet parameters.
GLUT_HAS_KEYBOARD* = 600
GLUT_HAS_MOUSE* = 601
GLUT_HAS_SPACEBALL* = 602
GLUT_HAS_DIAL_AND_BUTTON_BOX* = 603
GLUT_HAS_TABLET* = 604
GLUT_NUM_MOUSE_BUTTONS* = 605
GLUT_NUM_SPACEBALL_BUTTONS* = 606
GLUT_NUM_BUTTON_BOX_BUTTONS* = 607
GLUT_NUM_DIALS* = 608
GLUT_NUM_TABLET_BUTTONS* = 609
GLUT_DEVICE_IGNORE_KEY_REPEAT* = 610
GLUT_DEVICE_KEY_REPEAT* = 611
GLUT_HAS_JOYSTICK* = 612
GLUT_OWNS_JOYSTICK* = 613
GLUT_JOYSTICK_BUTTONS* = 614
GLUT_JOYSTICK_AXES* = 615
GLUT_JOYSTICK_POLL_RATE* = 616 # glutLayerGet parameters.
GLUT_OVERLAY_POSSIBLE* = 800
GLUT_LAYER_IN_USE* = 801
GLUT_HAS_OVERLAY* = 802
GLUT_TRANSPARENT_INDEX* = 803
GLUT_NORMAL_DAMAGED* = 804
GLUT_OVERLAY_DAMAGED* = 805 # glutVideoResizeGet parameters.
GLUT_VIDEO_RESIZE_POSSIBLE* = 900
GLUT_VIDEO_RESIZE_IN_USE* = 901
GLUT_VIDEO_RESIZE_X_DELTA* = 902
GLUT_VIDEO_RESIZE_Y_DELTA* = 903
GLUT_VIDEO_RESIZE_WIDTH_DELTA* = 904
GLUT_VIDEO_RESIZE_HEIGHT_DELTA* = 905
GLUT_VIDEO_RESIZE_X* = 906
GLUT_VIDEO_RESIZE_Y* = 907
GLUT_VIDEO_RESIZE_WIDTH* = 908
GLUT_VIDEO_RESIZE_HEIGHT* = 909 # glutGetModifiers return mask.
GLUT_ACTIVE_SHIFT* = 1
GLUT_ACTIVE_CTRL* = 2
GLUT_ACTIVE_ALT* = 4 # glutSetCursor parameters.
# Basic arrows.
GLUT_CURSOR_RIGHT_ARROW* = 0
GLUT_CURSOR_LEFT_ARROW* = 1 # Symbolic cursor shapes.
GLUT_CURSOR_INFO* = 2
GLUT_CURSOR_DESTROY* = 3
GLUT_CURSOR_HELP* = 4
GLUT_CURSOR_CYCLE* = 5
GLUT_CURSOR_SPRAY* = 6
GLUT_CURSOR_WAIT* = 7
GLUT_CURSOR_TEXT* = 8
GLUT_CURSOR_CROSSHAIR* = 9 # Directional cursors.
GLUT_CURSOR_UP_DOWN* = 10
GLUT_CURSOR_LEFT_RIGHT* = 11 # Sizing cursors.
GLUT_CURSOR_TOP_SIDE* = 12
GLUT_CURSOR_BOTTOM_SIDE* = 13
GLUT_CURSOR_LEFT_SIDE* = 14
GLUT_CURSOR_RIGHT_SIDE* = 15
GLUT_CURSOR_TOP_LEFT_CORNER* = 16
GLUT_CURSOR_TOP_RIGHT_CORNER* = 17
GLUT_CURSOR_BOTTOM_RIGHT_CORNER* = 18
GLUT_CURSOR_BOTTOM_LEFT_CORNER* = 19 # Inherit from parent window.
GLUT_CURSOR_INHERIT* = 100 # Blank cursor.
GLUT_CURSOR_NONE* = 101 # Fullscreen crosshair (if available).
GLUT_CURSOR_FULL_CROSSHAIR* = 102 # GLUT device control sub-API.
# glutSetKeyRepeat modes.
GLUT_KEY_REPEAT_OFF* = 0
GLUT_KEY_REPEAT_ON* = 1
GLUT_KEY_REPEAT_DEFAULT* = 2 # Joystick button masks.
GLUT_JOYSTICK_BUTTON_A* = 1
GLUT_JOYSTICK_BUTTON_B* = 2
GLUT_JOYSTICK_BUTTON_C* = 4
GLUT_JOYSTICK_BUTTON_D* = 8 # GLUT game mode sub-API.
# glutGameModeGet.
GLUT_GAME_MODE_ACTIVE* = 0
GLUT_GAME_MODE_POSSIBLE* = 1
GLUT_GAME_MODE_WIDTH* = 2
GLUT_GAME_MODE_HEIGHT* = 3
GLUT_GAME_MODE_PIXEL_DEPTH* = 4
GLUT_GAME_MODE_REFRESH_RATE* = 5
GLUT_GAME_MODE_DISPLAY_CHANGED* = 6 # GLUT initialization sub-API.
proc glutInit*(argcp: PInteger, argv: PPChar){.dynlib: dllname, importc.}
proc glutInitDisplayMode*(mode: int16){.dynlib: dllname, importc.}
proc glutInitDisplayString*(str: cstring){.dynlib: dllname, importc.}
proc glutInitWindowPosition*(x, y: int){.dynlib: dllname, importc.}
proc glutInitWindowSize*(width, height: int){.dynlib: dllname, importc.}
proc glutMainLoop*(){.dynlib: dllname, importc.}
# GLUT window sub-API.
proc glutCreateWindow*(title: cstring): int{.dynlib: dllname, importc.}
proc glutCreateSubWindow*(win, x, y, width, height: int): int{.dynlib: dllname,
importc.}
proc glutDestroyWindow*(win: int){.dynlib: dllname, importc.}
proc glutPostRedisplay*(){.dynlib: dllname, importc.}
proc glutPostWindowRedisplay*(win: int){.dynlib: dllname, importc.}
proc glutSwapBuffers*(){.dynlib: dllname, importc.}
proc glutGetWindow*(): int{.dynlib: dllname, importc.}
proc glutSetWindow*(win: int){.dynlib: dllname, importc.}
proc glutSetWindowTitle*(title: cstring){.dynlib: dllname, importc.}
proc glutSetIconTitle*(title: cstring){.dynlib: dllname, importc.}
proc glutPositionWindow*(x, y: int){.dynlib: dllname, importc.}
proc glutReshapeWindow*(width, height: int){.dynlib: dllname, importc.}
proc glutPopWindow*(){.dynlib: dllname, importc.}
proc glutPushWindow*(){.dynlib: dllname, importc.}
proc glutIconifyWindow*(){.dynlib: dllname, importc.}
proc glutShowWindow*(){.dynlib: dllname, importc.}
proc glutHideWindow*(){.dynlib: dllname, importc.}
proc glutFullScreen*(){.dynlib: dllname, importc.}
proc glutSetCursor*(cursor: int){.dynlib: dllname, importc.}
proc glutWarpPointer*(x, y: int){.dynlib: dllname, importc.}
# GLUT overlay sub-API.
proc glutEstablishOverlay*(){.dynlib: dllname, importc.}
proc glutRemoveOverlay*(){.dynlib: dllname, importc.}
proc glutUseLayer*(layer: TGLenum){.dynlib: dllname, importc.}
proc glutPostOverlayRedisplay*(){.dynlib: dllname, importc.}
proc glutPostWindowOverlayRedisplay*(win: int){.dynlib: dllname, importc.}
proc glutShowOverlay*(){.dynlib: dllname, importc.}
proc glutHideOverlay*(){.dynlib: dllname, importc.}
# GLUT menu sub-API.
proc glutCreateMenu*(callback: TGlut1IntCallback): int{.dynlib: dllname, importc.}
proc glutDestroyMenu*(menu: int){.dynlib: dllname, importc.}
proc glutGetMenu*(): int{.dynlib: dllname, importc.}
proc glutSetMenu*(menu: int){.dynlib: dllname, importc.}
proc glutAddMenuEntry*(caption: cstring, value: int){.dynlib: dllname, importc.}
proc glutAddSubMenu*(caption: cstring, submenu: int){.dynlib: dllname, importc.}
proc glutChangeToMenuEntry*(item: int, caption: cstring, value: int){.
dynlib: dllname, importc.}
proc glutChangeToSubMenu*(item: int, caption: cstring, submenu: int){.
dynlib: dllname, importc.}
proc glutRemoveMenuItem*(item: int){.dynlib: dllname, importc.}
proc glutAttachMenu*(button: int){.dynlib: dllname, importc.}
proc glutDetachMenu*(button: int){.dynlib: dllname, importc.}
# GLUT window callback sub-API.
proc glutDisplayFunc*(f: TGlutVoidCallback){.dynlib: dllname, importc.}
proc glutReshapeFunc*(f: TGlut2IntCallback){.dynlib: dllname, importc.}
proc glutKeyboardFunc*(f: TGlut1Char2IntCallback){.dynlib: dllname, importc.}
proc glutMouseFunc*(f: TGlut4IntCallback){.dynlib: dllname, importc.}
proc glutMotionFunc*(f: TGlut2IntCallback){.dynlib: dllname, importc.}
proc glutPassiveMotionFunc*(f: TGlut2IntCallback){.dynlib: dllname, importc.}
proc glutEntryFunc*(f: TGlut1IntCallback){.dynlib: dllname, importc.}
proc glutVisibilityFunc*(f: TGlut1IntCallback){.dynlib: dllname, importc.}
proc glutIdleFunc*(f: TGlutVoidCallback){.dynlib: dllname, importc.}
proc glutTimerFunc*(millis: int16, f: TGlut1IntCallback, value: int){.
dynlib: dllname, importc.}
proc glutMenuStateFunc*(f: TGlut1IntCallback){.dynlib: dllname, importc.}
proc glutSpecialFunc*(f: TGlut3IntCallback){.dynlib: dllname, importc.}
proc glutSpaceballMotionFunc*(f: TGlut3IntCallback){.dynlib: dllname, importc.}
proc glutSpaceballRotateFunc*(f: TGlut3IntCallback){.dynlib: dllname, importc.}
proc glutSpaceballButtonFunc*(f: TGlut2IntCallback){.dynlib: dllname, importc.}
proc glutButtonBoxFunc*(f: TGlut2IntCallback){.dynlib: dllname, importc.}
proc glutDialsFunc*(f: TGlut2IntCallback){.dynlib: dllname, importc.}
proc glutTabletMotionFunc*(f: TGlut2IntCallback){.dynlib: dllname, importc.}
proc glutTabletButtonFunc*(f: TGlut4IntCallback){.dynlib: dllname, importc.}
proc glutMenuStatusFunc*(f: TGlut3IntCallback){.dynlib: dllname, importc.}
proc glutOverlayDisplayFunc*(f: TGlutVoidCallback){.dynlib: dllname, importc.}
proc glutWindowStatusFunc*(f: TGlut1IntCallback){.dynlib: dllname, importc.}
proc glutKeyboardUpFunc*(f: TGlut1Char2IntCallback){.dynlib: dllname, importc.}
proc glutSpecialUpFunc*(f: TGlut3IntCallback){.dynlib: dllname, importc.}
proc glutJoystickFunc*(f: TGlut1UInt3IntCallback, pollInterval: int){.
dynlib: dllname, importc.}
# GLUT color index sub-API.
proc glutSetColor*(cell: int, red, green, blue: TGLfloat){.dynlib: dllname,
importc.}
proc glutGetColor*(ndx, component: int): TGLfloat{.dynlib: dllname, importc.}
proc glutCopyColormap*(win: int){.dynlib: dllname, importc.}
# GLUT state retrieval sub-API.
proc glutGet*(t: TGLenum): int{.dynlib: dllname, importc.}
proc glutDeviceGet*(t: TGLenum): int{.dynlib: dllname, importc.}
# GLUT extension support sub-API
proc glutExtensionSupported*(name: cstring): int{.dynlib: dllname, importc.}
proc glutGetModifiers*(): int{.dynlib: dllname, importc.}
proc glutLayerGet*(t: TGLenum): int{.dynlib: dllname, importc.}
# GLUT font sub-API
proc glutBitmapCharacter*(font: pointer, character: int){.dynlib: dllname,
importc.}
proc glutBitmapWidth*(font: pointer, character: int): int{.dynlib: dllname,
importc.}
proc glutStrokeCharacter*(font: pointer, character: int){.dynlib: dllname,
importc.}
proc glutStrokeWidth*(font: pointer, character: int): int{.dynlib: dllname,
importc.}
proc glutBitmapLength*(font: pointer, str: cstring): int{.dynlib: dllname,
importc.}
proc glutStrokeLength*(font: pointer, str: cstring): int{.dynlib: dllname,
importc.}
# GLUT pre-built models sub-API
proc glutWireSphere*(radius: TGLdouble, slices, stacks: TGLint){.dynlib: dllname,
importc.}
proc glutSolidSphere*(radius: TGLdouble, slices, stacks: TGLint){.dynlib: dllname,
importc.}
proc glutWireCone*(base, height: TGLdouble, slices, stacks: TGLint){.
dynlib: dllname, importc.}
proc glutSolidCone*(base, height: TGLdouble, slices, stacks: TGLint){.
dynlib: dllname, importc.}
proc glutWireCube*(size: TGLdouble){.dynlib: dllname, importc.}
proc glutSolidCube*(size: TGLdouble){.dynlib: dllname, importc.}
proc glutWireTorus*(innerRadius, outerRadius: TGLdouble, sides, rings: TGLint){.
dynlib: dllname, importc.}
proc glutSolidTorus*(innerRadius, outerRadius: TGLdouble, sides, rings: TGLint){.
dynlib: dllname, importc.}
proc glutWireDodecahedron*(){.dynlib: dllname, importc.}
proc glutSolidDodecahedron*(){.dynlib: dllname, importc.}
proc glutWireTeapot*(size: TGLdouble){.dynlib: dllname, importc.}
proc glutSolidTeapot*(size: TGLdouble){.dynlib: dllname, importc.}
proc glutWireOctahedron*(){.dynlib: dllname, importc.}
proc glutSolidOctahedron*(){.dynlib: dllname, importc.}
proc glutWireTetrahedron*(){.dynlib: dllname, importc.}
proc glutSolidTetrahedron*(){.dynlib: dllname, importc.}
proc glutWireIcosahedron*(){.dynlib: dllname, importc.}
proc glutSolidIcosahedron*(){.dynlib: dllname, importc.}
# GLUT video resize sub-API.
proc glutVideoResizeGet*(param: TGLenum): int{.dynlib: dllname, importc.}
proc glutSetupVideoResizing*(){.dynlib: dllname, importc.}
proc glutStopVideoResizing*(){.dynlib: dllname, importc.}
proc glutVideoResize*(x, y, width, height: int){.dynlib: dllname, importc.}
proc glutVideoPan*(x, y, width, height: int){.dynlib: dllname, importc.}
# GLUT debugging sub-API.
proc glutReportErrors*(){.dynlib: dllname, importc.}
# GLUT device control sub-API.
proc glutIgnoreKeyRepeat*(ignore: int){.dynlib: dllname, importc.}
proc glutSetKeyRepeat*(repeatMode: int){.dynlib: dllname, importc.}
proc glutForceJoystickFunc*(){.dynlib: dllname, importc.}
# GLUT game mode sub-API.
#example glutGameModeString('1280x1024:32@75');
proc glutGameModeString*(AString: cstring){.dynlib: dllname, importc.}
proc glutEnterGameMode*(): int{.dynlib: dllname, importc.}
proc glutLeaveGameMode*(){.dynlib: dllname, importc.}
proc glutGameModeGet*(mode: TGLenum): int{.dynlib: dllname, importc.}
# implementation

436
lib/wrappers/opengl/glut.pp Normal file
View file

@ -0,0 +1,436 @@
{
Adaption of the delphi3d.net OpenGL units to FreePascal
Sebastian Guenther (sg@freepascal.org) in 2002
These units are free to use
}
unit Glut;
// Copyright (c) Mark J. Kilgard, 1994, 1995, 1996. */
(* This program is freely distributable without licensing fees and is
provided without guarantee or warrantee expressed or implied. This
program is -not- in the public domain. *)
{******************************************************************************}
{ Converted to Delphi by Tom Nuydens (tom@delphi3d.net) }
{ Contributions by Igor Karpov (glygrik@hotbox.ru) }
{ For the latest updates, visit Delphi3D: http://www.delphi3d.net }
{******************************************************************************}
interface
uses
GL;
const
dllname = 'glut32.dll';
dynlibname = '/System/Library/Frameworks/GLUT.framework/GLUT';
libname = 'libglut.so.3';
type
PInteger = ^Integer;
PPChar = ^PChar;
TGlutVoidCallback = procedure; cdecl;
TGlut1IntCallback = procedure(value: Integer); cdecl;
TGlut2IntCallback = procedure(v1, v2: Integer); cdecl;
TGlut3IntCallback = procedure(v1, v2, v3: Integer); cdecl;
TGlut4IntCallback = procedure(v1, v2, v3, v4: Integer); cdecl;
TGlut1Char2IntCallback = procedure(c: Byte; v1, v2: Integer); cdecl;
TGlut1UInt3IntCallback = procedure(u: Cardinal; v1, v2, v3: Integer); cdecl;
const
GLUT_API_VERSION = 3;
GLUT_XLIB_IMPLEMENTATION = 12;
// Display mode bit masks.
GLUT_RGB = 0;
GLUT_RGBA = GLUT_RGB;
GLUT_INDEX = 1;
GLUT_SINGLE = 0;
GLUT_DOUBLE = 2;
GLUT_ACCUM = 4;
GLUT_ALPHA = 8;
GLUT_DEPTH = 16;
GLUT_STENCIL = 32;
GLUT_MULTISAMPLE = 128;
GLUT_STEREO = 256;
GLUT_LUMINANCE = 512;
// Mouse buttons.
GLUT_LEFT_BUTTON = 0;
GLUT_MIDDLE_BUTTON = 1;
GLUT_RIGHT_BUTTON = 2;
// Mouse button state.
GLUT_DOWN = 0;
GLUT_UP = 1;
// function keys
GLUT_KEY_F1 = 1;
GLUT_KEY_F2 = 2;
GLUT_KEY_F3 = 3;
GLUT_KEY_F4 = 4;
GLUT_KEY_F5 = 5;
GLUT_KEY_F6 = 6;
GLUT_KEY_F7 = 7;
GLUT_KEY_F8 = 8;
GLUT_KEY_F9 = 9;
GLUT_KEY_F10 = 10;
GLUT_KEY_F11 = 11;
GLUT_KEY_F12 = 12;
// directional keys
GLUT_KEY_LEFT = 100;
GLUT_KEY_UP = 101;
GLUT_KEY_RIGHT = 102;
GLUT_KEY_DOWN = 103;
GLUT_KEY_PAGE_UP = 104;
GLUT_KEY_PAGE_DOWN = 105;
GLUT_KEY_HOME = 106;
GLUT_KEY_END = 107;
GLUT_KEY_INSERT = 108;
// Entry/exit state.
GLUT_LEFT = 0;
GLUT_ENTERED = 1;
// Menu usage state.
GLUT_MENU_NOT_IN_USE = 0;
GLUT_MENU_IN_USE = 1;
// Visibility state.
GLUT_NOT_VISIBLE = 0;
GLUT_VISIBLE = 1;
// Window status state.
GLUT_HIDDEN = 0;
GLUT_FULLY_RETAINED = 1;
GLUT_PARTIALLY_RETAINED = 2;
GLUT_FULLY_COVERED = 3;
// Color index component selection values.
GLUT_RED = 0;
GLUT_GREEN = 1;
GLUT_BLUE = 2;
// Layers for use.
GLUT_NORMAL = 0;
GLUT_OVERLAY = 1;
{$ifdef Windows}
const
// Stroke font constants (use these in GLUT program).
GLUT_STROKE_ROMAN = Pointer(0);
GLUT_STROKE_MONO_ROMAN = Pointer(1);
// Bitmap font constants (use these in GLUT program).
GLUT_BITMAP_9_BY_15 = Pointer(2);
GLUT_BITMAP_8_BY_13 = Pointer(3);
GLUT_BITMAP_TIMES_ROMAN_10 = Pointer(4);
GLUT_BITMAP_TIMES_ROMAN_24 = Pointer(5);
GLUT_BITMAP_HELVETICA_10 = Pointer(6);
GLUT_BITMAP_HELVETICA_12 = Pointer(7);
GLUT_BITMAP_HELVETICA_18 = Pointer(8);
{$else Windows}
var
// Stroke font constants (use these in GLUT program).
GLUT_STROKE_ROMAN : Pointer;
GLUT_STROKE_MONO_ROMAN : Pointer;
// Bitmap font constants (use these in GLUT program).
GLUT_BITMAP_9_BY_15 : Pointer;
GLUT_BITMAP_8_BY_13 : Pointer;
GLUT_BITMAP_TIMES_ROMAN_10 : Pointer;
GLUT_BITMAP_TIMES_ROMAN_24 : Pointer;
GLUT_BITMAP_HELVETICA_10 : Pointer;
GLUT_BITMAP_HELVETICA_12 : Pointer;
GLUT_BITMAP_HELVETICA_18 : Pointer;
{$endif Windows}
const
// glutGet parameters.
GLUT_WINDOW_X = 100;
GLUT_WINDOW_Y = 101;
GLUT_WINDOW_WIDTH = 102;
GLUT_WINDOW_HEIGHT = 103;
GLUT_WINDOW_BUFFER_SIZE = 104;
GLUT_WINDOW_STENCIL_SIZE = 105;
GLUT_WINDOW_DEPTH_SIZE = 106;
GLUT_WINDOW_RED_SIZE = 107;
GLUT_WINDOW_GREEN_SIZE = 108;
GLUT_WINDOW_BLUE_SIZE = 109;
GLUT_WINDOW_ALPHA_SIZE = 110;
GLUT_WINDOW_ACCUM_RED_SIZE = 111;
GLUT_WINDOW_ACCUM_GREEN_SIZE = 112;
GLUT_WINDOW_ACCUM_BLUE_SIZE = 113;
GLUT_WINDOW_ACCUM_ALPHA_SIZE = 114;
GLUT_WINDOW_DOUBLEBUFFER = 115;
GLUT_WINDOW_RGBA = 116;
GLUT_WINDOW_PARENT = 117;
GLUT_WINDOW_NUM_CHILDREN = 118;
GLUT_WINDOW_COLORMAP_SIZE = 119;
GLUT_WINDOW_NUM_SAMPLES = 120;
GLUT_WINDOW_STEREO = 121;
GLUT_WINDOW_CURSOR = 122;
GLUT_SCREEN_WIDTH = 200;
GLUT_SCREEN_HEIGHT = 201;
GLUT_SCREEN_WIDTH_MM = 202;
GLUT_SCREEN_HEIGHT_MM = 203;
GLUT_MENU_NUM_ITEMS = 300;
GLUT_DISPLAY_MODE_POSSIBLE = 400;
GLUT_INIT_WINDOW_X = 500;
GLUT_INIT_WINDOW_Y = 501;
GLUT_INIT_WINDOW_WIDTH = 502;
GLUT_INIT_WINDOW_HEIGHT = 503;
GLUT_INIT_DISPLAY_MODE = 504;
GLUT_ELAPSED_TIME = 700;
GLUT_WINDOW_FORMAT_ID = 123;
// glutDeviceGet parameters.
GLUT_HAS_KEYBOARD = 600;
GLUT_HAS_MOUSE = 601;
GLUT_HAS_SPACEBALL = 602;
GLUT_HAS_DIAL_AND_BUTTON_BOX = 603;
GLUT_HAS_TABLET = 604;
GLUT_NUM_MOUSE_BUTTONS = 605;
GLUT_NUM_SPACEBALL_BUTTONS = 606;
GLUT_NUM_BUTTON_BOX_BUTTONS = 607;
GLUT_NUM_DIALS = 608;
GLUT_NUM_TABLET_BUTTONS = 609;
GLUT_DEVICE_IGNORE_KEY_REPEAT = 610;
GLUT_DEVICE_KEY_REPEAT = 611;
GLUT_HAS_JOYSTICK = 612;
GLUT_OWNS_JOYSTICK = 613;
GLUT_JOYSTICK_BUTTONS = 614;
GLUT_JOYSTICK_AXES = 615;
GLUT_JOYSTICK_POLL_RATE = 616;
// glutLayerGet parameters.
GLUT_OVERLAY_POSSIBLE = 800;
GLUT_LAYER_IN_USE = 801;
GLUT_HAS_OVERLAY = 802;
GLUT_TRANSPARENT_INDEX = 803;
GLUT_NORMAL_DAMAGED = 804;
GLUT_OVERLAY_DAMAGED = 805;
// glutVideoResizeGet parameters.
GLUT_VIDEO_RESIZE_POSSIBLE = 900;
GLUT_VIDEO_RESIZE_IN_USE = 901;
GLUT_VIDEO_RESIZE_X_DELTA = 902;
GLUT_VIDEO_RESIZE_Y_DELTA = 903;
GLUT_VIDEO_RESIZE_WIDTH_DELTA = 904;
GLUT_VIDEO_RESIZE_HEIGHT_DELTA = 905;
GLUT_VIDEO_RESIZE_X = 906;
GLUT_VIDEO_RESIZE_Y = 907;
GLUT_VIDEO_RESIZE_WIDTH = 908;
GLUT_VIDEO_RESIZE_HEIGHT = 909;
// glutGetModifiers return mask.
GLUT_ACTIVE_SHIFT = 1;
GLUT_ACTIVE_CTRL = 2;
GLUT_ACTIVE_ALT = 4;
// glutSetCursor parameters.
// Basic arrows.
GLUT_CURSOR_RIGHT_ARROW = 0;
GLUT_CURSOR_LEFT_ARROW = 1;
// Symbolic cursor shapes.
GLUT_CURSOR_INFO = 2;
GLUT_CURSOR_DESTROY = 3;
GLUT_CURSOR_HELP = 4;
GLUT_CURSOR_CYCLE = 5;
GLUT_CURSOR_SPRAY = 6;
GLUT_CURSOR_WAIT = 7;
GLUT_CURSOR_TEXT = 8;
GLUT_CURSOR_CROSSHAIR = 9;
// Directional cursors.
GLUT_CURSOR_UP_DOWN = 10;
GLUT_CURSOR_LEFT_RIGHT = 11;
// Sizing cursors.
GLUT_CURSOR_TOP_SIDE = 12;
GLUT_CURSOR_BOTTOM_SIDE = 13;
GLUT_CURSOR_LEFT_SIDE = 14;
GLUT_CURSOR_RIGHT_SIDE = 15;
GLUT_CURSOR_TOP_LEFT_CORNER = 16;
GLUT_CURSOR_TOP_RIGHT_CORNER = 17;
GLUT_CURSOR_BOTTOM_RIGHT_CORNER = 18;
GLUT_CURSOR_BOTTOM_LEFT_CORNER = 19;
// Inherit from parent window.
GLUT_CURSOR_INHERIT = 100;
// Blank cursor.
GLUT_CURSOR_NONE = 101;
// Fullscreen crosshair (if available).
GLUT_CURSOR_FULL_CROSSHAIR = 102;
// GLUT device control sub-API.
// glutSetKeyRepeat modes.
GLUT_KEY_REPEAT_OFF = 0;
GLUT_KEY_REPEAT_ON = 1;
GLUT_KEY_REPEAT_DEFAULT = 2;
// Joystick button masks.
GLUT_JOYSTICK_BUTTON_A = 1;
GLUT_JOYSTICK_BUTTON_B = 2;
GLUT_JOYSTICK_BUTTON_C = 4;
GLUT_JOYSTICK_BUTTON_D = 8;
// GLUT game mode sub-API.
// glutGameModeGet.
GLUT_GAME_MODE_ACTIVE = 0;
GLUT_GAME_MODE_POSSIBLE = 1;
GLUT_GAME_MODE_WIDTH = 2;
GLUT_GAME_MODE_HEIGHT = 3;
GLUT_GAME_MODE_PIXEL_DEPTH = 4;
GLUT_GAME_MODE_REFRESH_RATE = 5;
GLUT_GAME_MODE_DISPLAY_CHANGED = 6;
// GLUT initialization sub-API.
procedure glutInit(argcp: PInteger; argv: PPChar); external dllname;
procedure glutInitDisplayMode(mode: Word); external dllname;
procedure glutInitDisplayString(const str: PChar); external dllname;
procedure glutInitWindowPosition(x, y: Integer); external dllname;
procedure glutInitWindowSize(width, height: Integer); external dllname;
procedure glutMainLoop; external dllname;
// GLUT window sub-API.
function glutCreateWindow(const title: PChar): Integer; external dllname;
function glutCreateSubWindow(win, x, y, width, height: Integer): Integer; external dllname;
procedure glutDestroyWindow(win: Integer); external dllname;
procedure glutPostRedisplay; external dllname;
procedure glutPostWindowRedisplay(win: Integer); external dllname;
procedure glutSwapBuffers; external dllname;
function glutGetWindow: Integer; external dllname;
procedure glutSetWindow(win: Integer); external dllname;
procedure glutSetWindowTitle(const title: PChar); external dllname;
procedure glutSetIconTitle(const title: PChar); external dllname;
procedure glutPositionWindow(x, y: Integer); external dllname;
procedure glutReshapeWindow(width, height: Integer); external dllname;
procedure glutPopWindow; external dllname;
procedure glutPushWindow; external dllname;
procedure glutIconifyWindow; external dllname;
procedure glutShowWindow; external dllname;
procedure glutHideWindow; external dllname;
procedure glutFullScreen; external dllname;
procedure glutSetCursor(cursor: Integer); external dllname;
procedure glutWarpPointer(x, y: Integer); external dllname;
// GLUT overlay sub-API.
procedure glutEstablishOverlay; external dllname;
procedure glutRemoveOverlay; external dllname;
procedure glutUseLayer(layer: GLenum); external dllname;
procedure glutPostOverlayRedisplay; external dllname;
procedure glutPostWindowOverlayRedisplay(win: Integer); external dllname;
procedure glutShowOverlay; external dllname;
procedure glutHideOverlay; external dllname;
// GLUT menu sub-API.
function glutCreateMenu(callback: TGlut1IntCallback): Integer; external dllname;
procedure glutDestroyMenu(menu: Integer); external dllname;
function glutGetMenu: Integer; external dllname;
procedure glutSetMenu(menu: Integer); external dllname;
procedure glutAddMenuEntry(const caption: PChar; value: Integer); external dllname;
procedure glutAddSubMenu(const caption: PChar; submenu: Integer); external dllname;
procedure glutChangeToMenuEntry(item: Integer; const caption: PChar; value: Integer); external dllname;
procedure glutChangeToSubMenu(item: Integer; const caption: PChar; submenu: Integer); external dllname;
procedure glutRemoveMenuItem(item: Integer); external dllname;
procedure glutAttachMenu(button: Integer); external dllname;
procedure glutDetachMenu(button: Integer); external dllname;
// GLUT window callback sub-API.
procedure glutDisplayFunc(f: TGlutVoidCallback); external dllname;
procedure glutReshapeFunc(f: TGlut2IntCallback); external dllname;
procedure glutKeyboardFunc(f: TGlut1Char2IntCallback); external dllname;
procedure glutMouseFunc(f: TGlut4IntCallback); external dllname;
procedure glutMotionFunc(f: TGlut2IntCallback); external dllname;
procedure glutPassiveMotionFunc(f: TGlut2IntCallback); external dllname;
procedure glutEntryFunc(f: TGlut1IntCallback); external dllname;
procedure glutVisibilityFunc(f: TGlut1IntCallback); external dllname;
procedure glutIdleFunc(f: TGlutVoidCallback); external dllname;
procedure glutTimerFunc(millis: Word; f: TGlut1IntCallback; value: Integer); external dllname;
procedure glutMenuStateFunc(f: TGlut1IntCallback); external dllname;
procedure glutSpecialFunc(f: TGlut3IntCallback); external dllname;
procedure glutSpaceballMotionFunc(f: TGlut3IntCallback); external dllname;
procedure glutSpaceballRotateFunc(f: TGlut3IntCallback); external dllname;
procedure glutSpaceballButtonFunc(f: TGlut2IntCallback); external dllname;
procedure glutButtonBoxFunc(f: TGlut2IntCallback); external dllname;
procedure glutDialsFunc(f: TGlut2IntCallback); external dllname;
procedure glutTabletMotionFunc(f: TGlut2IntCallback); external dllname;
procedure glutTabletButtonFunc(f: TGlut4IntCallback); external dllname;
procedure glutMenuStatusFunc(f: TGlut3IntCallback); external dllname;
procedure glutOverlayDisplayFunc(f:TGlutVoidCallback); external dllname;
procedure glutWindowStatusFunc(f: TGlut1IntCallback); external dllname;
procedure glutKeyboardUpFunc(f: TGlut1Char2IntCallback); external dllname;
procedure glutSpecialUpFunc(f: TGlut3IntCallback); external dllname;
procedure glutJoystickFunc(f: TGlut1UInt3IntCallback; pollInterval: Integer); external dllname;
// GLUT color index sub-API.
procedure glutSetColor(cell: Integer; red, green, blue: GLfloat); external dllname;
function glutGetColor(ndx, component: Integer): GLfloat; external dllname;
procedure glutCopyColormap(win: Integer); external dllname;
// GLUT state retrieval sub-API.
function glutGet(t: GLenum): Integer; external dllname;
function glutDeviceGet(t: GLenum): Integer; external dllname;
// GLUT extension support sub-API
function glutExtensionSupported(const name: PChar): Integer; external dllname;
function glutGetModifiers: Integer; external dllname;
function glutLayerGet(t: GLenum): Integer; external dllname;
// GLUT font sub-API
procedure glutBitmapCharacter(font : pointer; character: Integer); external dllname;
function glutBitmapWidth(font : pointer; character: Integer): Integer; external dllname;
procedure glutStrokeCharacter(font : pointer; character: Integer); external dllname;
function glutStrokeWidth(font : pointer; character: Integer): Integer; external dllname;
function glutBitmapLength(font: pointer; const str: PChar): Integer; external dllname;
function glutStrokeLength(font: pointer; const str: PChar): Integer; external dllname;
// GLUT pre-built models sub-API
procedure glutWireSphere(radius: GLdouble; slices, stacks: GLint); external dllname;
procedure glutSolidSphere(radius: GLdouble; slices, stacks: GLint); external dllname;
procedure glutWireCone(base, height: GLdouble; slices, stacks: GLint); external dllname;
procedure glutSolidCone(base, height: GLdouble; slices, stacks: GLint); external dllname;
procedure glutWireCube(size: GLdouble); external dllname;
procedure glutSolidCube(size: GLdouble); external dllname;
procedure glutWireTorus(innerRadius, outerRadius: GLdouble; sides, rings: GLint); external dllname;
procedure glutSolidTorus(innerRadius, outerRadius: GLdouble; sides, rings: GLint); external dllname;
procedure glutWireDodecahedron; external dllname;
procedure glutSolidDodecahedron; external dllname;
procedure glutWireTeapot(size: GLdouble); external dllname;
procedure glutSolidTeapot(size: GLdouble); external dllname;
procedure glutWireOctahedron; external dllname;
procedure glutSolidOctahedron; external dllname;
procedure glutWireTetrahedron; external dllname;
procedure glutSolidTetrahedron; external dllname;
procedure glutWireIcosahedron; external dllname;
procedure glutSolidIcosahedron; external dllname;
// GLUT video resize sub-API.
function glutVideoResizeGet(param: GLenum): Integer; external dllname;
procedure glutSetupVideoResizing; external dllname;
procedure glutStopVideoResizing; external dllname;
procedure glutVideoResize(x, y, width, height: Integer); external dllname;
procedure glutVideoPan(x, y, width, height: Integer); external dllname;
// GLUT debugging sub-API.
procedure glutReportErrors; external dllname;
// GLUT device control sub-API.
procedure glutIgnoreKeyRepeat(ignore: Integer); external dllname;
procedure glutSetKeyRepeat(repeatMode: Integer); external dllname;
procedure glutForceJoystickFunc; external dllname;
// GLUT game mode sub-API.
//example glutGameModeString('1280x1024:32@75');
procedure glutGameModeString (const AString : PChar); external dllname;
function glutEnterGameMode : integer; external dllname;
procedure glutLeaveGameMode; external dllname;
function glutGameModeGet (mode : GLenum) : integer; external dllname;
implementation
end.

148
lib/wrappers/opengl/glx.nim Normal file
View file

@ -0,0 +1,148 @@
#
#
# Translation of the Mesa GLX headers for FreePascal
# Copyright (C) 1999 Sebastian Guenther
#
#
# Mesa 3-D graphics library
# Version: 3.0
# Copyright (C) 1995-1998 Brian Paul
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 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
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
import
X, XLib, XUtil, gl
when defined(windows):
const dllname = "GL.dll"
elif defined(macosx):
const dllname = "/usr/X11R6/lib/libGL.dylib"
else:
const dllname = "libGL.so"
const
GLX_USE_GL* = 1
GLX_BUFFER_SIZE* = 2
GLX_LEVEL* = 3
GLX_RGBA* = 4
GLX_DOUBLEBUFFER* = 5
GLX_STEREO* = 6
GLX_AUX_BUFFERS* = 7
GLX_RED_SIZE* = 8
GLX_GREEN_SIZE* = 9
GLX_BLUE_SIZE* = 10
GLX_ALPHA_SIZE* = 11
GLX_DEPTH_SIZE* = 12
GLX_STENCIL_SIZE* = 13
GLX_ACCUM_RED_SIZE* = 14
GLX_ACCUM_GREEN_SIZE* = 15
GLX_ACCUM_BLUE_SIZE* = 16
GLX_ACCUM_ALPHA_SIZE* = 17 # GLX_EXT_visual_info extension
GLX_X_VISUAL_TYPE_EXT* = 0x00000022
GLX_TRANSPARENT_TYPE_EXT* = 0x00000023
GLX_TRANSPARENT_INDEX_VALUE_EXT* = 0x00000024
GLX_TRANSPARENT_RED_VALUE_EXT* = 0x00000025
GLX_TRANSPARENT_GREEN_VALUE_EXT* = 0x00000026
GLX_TRANSPARENT_BLUE_VALUE_EXT* = 0x00000027
GLX_TRANSPARENT_ALPHA_VALUE_EXT* = 0x00000028 # Error codes returned by glXGetConfig:
GLX_BAD_SCREEN* = 1
GLX_BAD_ATTRIBUTE* = 2
GLX_NO_EXTENSION* = 3
GLX_BAD_VISUAL* = 4
GLX_BAD_CONTEXT* = 5
GLX_BAD_VALUE* = 6
GLX_BAD_ENUM* = 7 # GLX 1.1 and later:
GLX_VENDOR* = 1
GLX_VERSION* = 2
GLX_EXTENSIONS* = 3 # GLX_visual_info extension
GLX_TRUE_COLOR_EXT* = 0x00008002
GLX_DIRECT_COLOR_EXT* = 0x00008003
GLX_PSEUDO_COLOR_EXT* = 0x00008004
GLX_STATIC_COLOR_EXT* = 0x00008005
GLX_GRAY_SCALE_EXT* = 0x00008006
GLX_STATIC_GRAY_EXT* = 0x00008007
GLX_NONE_EXT* = 0x00008000
GLX_TRANSPARENT_RGB_EXT* = 0x00008008
GLX_TRANSPARENT_INDEX_EXT* = 0x00008009
type # From XLib:
XPixmap* = TXID
XFont* = TXID
XColormap* = TXID
GLXContext* = Pointer
GLXPixmap* = TXID
GLXDrawable* = TXID
GLXContextID* = TXID
TXPixmap* = XPixmap
TXFont* = XFont
TXColormap* = XColormap
TGLXContext* = GLXContext
TGLXPixmap* = GLXPixmap
TGLXDrawable* = GLXDrawable
TGLXContextID* = GLXContextID
proc glXChooseVisual*(dpy: PDisplay, screen: int, attribList: ptr int32): PXVisualInfo{.
cdecl, dynlib: dllname, importc.}
proc glXCreateContext*(dpy: PDisplay, vis: PXVisualInfo, shareList: GLXContext,
direct: bool): GLXContext{.cdecl, dynlib: dllname,
importc.}
proc glXDestroyContext*(dpy: PDisplay, ctx: GLXContext){.cdecl, dynlib: dllname,
importc.}
proc glXMakeCurrent*(dpy: PDisplay, drawable: GLXDrawable, ctx: GLXContext): bool{.
cdecl, dynlib: dllname, importc.}
proc glXCopyContext*(dpy: PDisplay, src, dst: GLXContext, mask: int32){.cdecl,
dynlib: dllname, importc.}
proc glXSwapBuffers*(dpy: PDisplay, drawable: GLXDrawable){.cdecl,
dynlib: dllname, importc.}
proc glXCreateGLXPixmap*(dpy: PDisplay, visual: PXVisualInfo, pixmap: XPixmap): GLXPixmap{.
cdecl, dynlib: dllname, importc.}
proc glXDestroyGLXPixmap*(dpy: PDisplay, pixmap: GLXPixmap){.cdecl,
dynlib: dllname, importc.}
proc glXQueryExtension*(dpy: PDisplay, errorb, event: var int): bool{.cdecl,
dynlib: dllname, importc.}
proc glXQueryVersion*(dpy: PDisplay, maj, min: var int): bool{.cdecl,
dynlib: dllname, importc.}
proc glXIsDirect*(dpy: PDisplay, ctx: GLXContext): bool{.cdecl, dynlib: dllname,
importc.}
proc glXGetConfig*(dpy: PDisplay, visual: PXVisualInfo, attrib: int,
value: var int): int{.cdecl, dynlib: dllname, importc.}
proc glXGetCurrentContext*(): GLXContext{.cdecl, dynlib: dllname, importc.}
proc glXGetCurrentDrawable*(): GLXDrawable{.cdecl, dynlib: dllname, importc.}
proc glXWaitGL*(){.cdecl, dynlib: dllname, importc.}
proc glXWaitX*(){.cdecl, dynlib: dllname, importc.}
proc glXUseXFont*(font: XFont, first, count, list: int){.cdecl, dynlib: dllname,
importc.}
# GLX 1.1 and later
proc glXQueryExtensionsString*(dpy: PDisplay, screen: int): cstring{.cdecl,
dynlib: dllname, importc.}
proc glXQueryServerString*(dpy: PDisplay, screen, name: int): cstring{.cdecl,
dynlib: dllname, importc.}
proc glXGetClientString*(dpy: PDisplay, name: int): cstring{.cdecl,
dynlib: dllname, importc.}
# Mesa GLX Extensions
proc glXCreateGLXPixmapMESA*(dpy: PDisplay, visual: PXVisualInfo,
pixmap: XPixmap, cmap: XColormap): GLXPixmap{.
cdecl, dynlib: dllname, importc.}
proc glXReleaseBufferMESA*(dpy: PDisplay, d: GLXDrawable): bool{.cdecl,
dynlib: dllname, importc.}
proc glXCopySubBufferMESA*(dpy: PDisplay, drawbale: GLXDrawable,
x, y, width, height: int){.cdecl, dynlib: dllname,
importc.}
proc glXGetVideoSyncSGI*(counter: var int32): int{.cdecl, dynlib: dllname,
importc.}
proc glXWaitVideoSyncSGI*(divisor, remainder: int, count: var int32): int{.
cdecl, dynlib: dllname, importc.}
# implementation

156
lib/wrappers/opengl/glx.pp Normal file
View file

@ -0,0 +1,156 @@
{
Translation of the Mesa GLX headers for FreePascal
Copyright (C) 1999 Sebastian Guenther
Mesa 3-D graphics library
Version: 3.0
Copyright (C) 1995-1998 Brian Paul
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
}
unit GLX;
interface
{$IFDEF Unix}
uses
X, XLib, XUtil, gl;
{$DEFINE HasGLX} // Activate GLX stuff
{$ELSE}
{$MESSAGE Unsupported platform.}
{$ENDIF}
{$IFNDEF HasGLX}
{$MESSAGE GLX not present on this platform.}
{$ENDIF}
const
dylibname = '/usr/X11R6/lib/libGL.dylib';
// =======================================================
// GLX consts, types and functions
// =======================================================
// Tokens for glXChooseVisual and glXGetConfig:
const
GLX_USE_GL = 1;
GLX_BUFFER_SIZE = 2;
GLX_LEVEL = 3;
GLX_RGBA = 4;
GLX_DOUBLEBUFFER = 5;
GLX_STEREO = 6;
GLX_AUX_BUFFERS = 7;
GLX_RED_SIZE = 8;
GLX_GREEN_SIZE = 9;
GLX_BLUE_SIZE = 10;
GLX_ALPHA_SIZE = 11;
GLX_DEPTH_SIZE = 12;
GLX_STENCIL_SIZE = 13;
GLX_ACCUM_RED_SIZE = 14;
GLX_ACCUM_GREEN_SIZE = 15;
GLX_ACCUM_BLUE_SIZE = 16;
GLX_ACCUM_ALPHA_SIZE = 17;
// GLX_EXT_visual_info extension
GLX_X_VISUAL_TYPE_EXT = $22;
GLX_TRANSPARENT_TYPE_EXT = $23;
GLX_TRANSPARENT_INDEX_VALUE_EXT = $24;
GLX_TRANSPARENT_RED_VALUE_EXT = $25;
GLX_TRANSPARENT_GREEN_VALUE_EXT = $26;
GLX_TRANSPARENT_BLUE_VALUE_EXT = $27;
GLX_TRANSPARENT_ALPHA_VALUE_EXT = $28;
// Error codes returned by glXGetConfig:
GLX_BAD_SCREEN = 1;
GLX_BAD_ATTRIBUTE = 2;
GLX_NO_EXTENSION = 3;
GLX_BAD_VISUAL = 4;
GLX_BAD_CONTEXT = 5;
GLX_BAD_VALUE = 6;
GLX_BAD_ENUM = 7;
// GLX 1.1 and later:
GLX_VENDOR = 1;
GLX_VERSION = 2;
GLX_EXTENSIONS = 3;
// GLX_visual_info extension
GLX_TRUE_COLOR_EXT = $8002;
GLX_DIRECT_COLOR_EXT = $8003;
GLX_PSEUDO_COLOR_EXT = $8004;
GLX_STATIC_COLOR_EXT = $8005;
GLX_GRAY_SCALE_EXT = $8006;
GLX_STATIC_GRAY_EXT = $8007;
GLX_NONE_EXT = $8000;
GLX_TRANSPARENT_RGB_EXT = $8008;
GLX_TRANSPARENT_INDEX_EXT = $8009;
type
// From XLib:
XPixmap = TXID;
XFont = TXID;
XColormap = TXID;
GLXContext = Pointer;
GLXPixmap = TXID;
GLXDrawable = TXID;
GLXContextID = TXID;
TXPixmap = XPixmap;
TXFont = XFont;
TXColormap = XColormap;
TGLXContext = GLXContext;
TGLXPixmap = GLXPixmap;
TGLXDrawable = GLXDrawable;
TGLXContextID = GLXContextID;
function glXChooseVisual(dpy: PDisplay; screen: Integer; attribList: PInteger): PXVisualInfo; cdecl; external dllname;
function glXCreateContext(dpy: PDisplay; vis: PXVisualInfo; shareList: GLXContext; direct: Boolean): GLXContext; cdecl; external dllname;
procedure glXDestroyContext(dpy: PDisplay; ctx: GLXContext); cdecl; external dllname;
function glXMakeCurrent(dpy: PDisplay; drawable: GLXDrawable; ctx: GLXContext): Boolean; cdecl; external dllname;
procedure glXCopyContext(dpy: PDisplay; src, dst: GLXContext; mask: LongWord); cdecl; external dllname;
procedure glXSwapBuffers(dpy: PDisplay; drawable: GLXDrawable); cdecl; external dllname;
function glXCreateGLXPixmap(dpy: PDisplay; visual: PXVisualInfo; pixmap: XPixmap): GLXPixmap; cdecl; external dllname;
procedure glXDestroyGLXPixmap(dpy: PDisplay; pixmap: GLXPixmap); cdecl; external dllname;
function glXQueryExtension(dpy: PDisplay; var errorb, event: Integer): Boolean; cdecl; external dllname;
function glXQueryVersion(dpy: PDisplay; var maj, min: Integer): Boolean; cdecl; external dllname;
function glXIsDirect(dpy: PDisplay; ctx: GLXContext): Boolean; cdecl; external dllname;
function glXGetConfig(dpy: PDisplay; visual: PXVisualInfo; attrib: Integer; var value: Integer): Integer; cdecl; external dllname;
function glXGetCurrentContext: GLXContext; cdecl; external dllname;
function glXGetCurrentDrawable: GLXDrawable; cdecl; external dllname;
procedure glXWaitGL; cdecl; external dllname;
procedure glXWaitX; cdecl; external dllname;
procedure glXUseXFont(font: XFont; first, count, list: Integer); cdecl; external dllname;
// GLX 1.1 and later
function glXQueryExtensionsString(dpy: PDisplay; screen: Integer): PChar; cdecl; external dllname;
function glXQueryServerString(dpy: PDisplay; screen, name: Integer): PChar; cdecl; external dllname;
function glXGetClientString(dpy: PDisplay; name: Integer): PChar; cdecl; external dllname;
// Mesa GLX Extensions
function glXCreateGLXPixmapMESA(dpy: PDisplay; visual: PXVisualInfo; pixmap: XPixmap; cmap: XColormap): GLXPixmap; cdecl; external dllname;
function glXReleaseBufferMESA(dpy: PDisplay; d: GLXDrawable): Boolean; cdecl; external dllname;
procedure glXCopySubBufferMESA(dpy: PDisplay; drawbale: GLXDrawable; x, y, width, height: Integer); cdecl; external dllname;
function glXGetVideoSyncSGI(var counter: LongWord): Integer; cdecl; external dllname;
function glXWaitVideoSyncSGI(divisor, remainder: Integer; var count: LongWord): Integer; cdecl; external dllname;
implementation
end.

View file

@ -0,0 +1,348 @@
import
gl, windows
proc wglGetExtensionsStringARB*(hdc: HDC): cstring{.dynlib: dllname, importc.}
const
WGL_FRONT_COLOR_BUFFER_BIT_ARB* = 0x00000001
WGL_BACK_COLOR_BUFFER_BIT_ARB* = 0x00000002
WGL_DEPTH_BUFFER_BIT_ARB* = 0x00000004
WGL_STENCIL_BUFFER_BIT_ARB* = 0x00000008
proc WinChoosePixelFormat*(DC: HDC, p2: PPixelFormatDescriptor): int{.
dynlib: "gdi32", importc: "ChoosePixelFormat".}
proc wglCreateBufferRegionARB*(hDC: HDC, iLayerPlane: TGLint, uType: TGLuint): THandle{.
dynlib: dllname, importc.}
proc wglDeleteBufferRegionARB*(hRegion: THandle){.dynlib: dllname, importc.}
proc wglSaveBufferRegionARB*(hRegion: THandle, x: TGLint, y: TGLint,
width: TGLint, height: TGLint): BOOL{.
dynlib: dllname, importc.}
proc wglRestoreBufferRegionARB*(hRegion: THandle, x: TGLint, y: TGLint,
width: TGLint, height: TGLint, xSrc: TGLint,
ySrc: TGLint): BOOL{.dynlib: dllname, importc.}
proc wglAllocateMemoryNV*(size: TGLsizei, readFrequency: TGLfloat,
writeFrequency: TGLfloat, priority: TGLfloat): PGLvoid{.
dynlib: dllname, importc.}
proc wglFreeMemoryNV*(pointer: PGLvoid){.dynlib: dllname, importc.}
const
WGL_IMAGE_BUFFER_MIN_ACCESS_I3D* = 0x00000001
WGL_IMAGE_BUFFER_LOCK_I3D* = 0x00000002
proc wglCreateImageBufferI3D*(hDC: HDC, dwSize: DWORD, uFlags: UINT): PGLvoid{.
dynlib: dllname, importc.}
proc wglDestroyImageBufferI3D*(hDC: HDC, pAddress: PGLvoid): BOOL{.
dynlib: dllname, importc.}
proc wglAssociateImageBufferEventsI3D*(hdc: HDC, pEvent: PHandle,
pAddress: PGLvoid, pSize: PDWORD,
count: UINT): BOOL{.dynlib: dllname,
importc.}
proc wglReleaseImageBufferEventsI3D*(hdc: HDC, pAddress: PGLvoid, count: UINT): BOOL{.
dynlib: dllname, importc.}
proc wglEnableFrameLockI3D*(): BOOL{.dynlib: dllname, importc.}
proc wglDisableFrameLockI3D*(): BOOL{.dynlib: dllname, importc.}
proc wglIsEnabledFrameLockI3D*(pFlag: PBOOL): BOOL{.dynlib: dllname, importc.}
proc wglQueryFrameLockMasterI3D*(pFlag: PBOOL): BOOL{.dynlib: dllname, importc.}
proc wglGetFrameUsageI3D*(pUsage: PGLfloat): BOOL{.dynlib: dllname, importc.}
proc wglBeginFrameTrackingI3D*(): BOOL{.dynlib: dllname, importc.}
proc wglEndFrameTrackingI3D*(): BOOL{.dynlib: dllname, importc.}
proc wglQueryFrameTrackingI3D*(pFrameCount: PDWORD, pMissedFrames: PDWORD,
pLastMissedUsage: PGLfloat): BOOL{.
dynlib: dllname, importc.}
const
WGL_NUMBER_PIXEL_FORMATS_ARB* = 0x00002000
WGL_DRAW_TO_WINDOW_ARB* = 0x00002001
WGL_DRAW_TO_BITMAP_ARB* = 0x00002002
WGL_ACCELERATION_ARB* = 0x00002003
WGL_NEED_PALETTE_ARB* = 0x00002004
WGL_NEED_SYSTEM_PALETTE_ARB* = 0x00002005
WGL_SWAP_LAYER_BUFFERS_ARB* = 0x00002006
WGL_SWAP_METHOD_ARB* = 0x00002007
WGL_NUMBER_OVERLAYS_ARB* = 0x00002008
WGL_NUMBER_UNDERLAYS_ARB* = 0x00002009
WGL_TRANSPARENT_ARB* = 0x0000200A
WGL_TRANSPARENT_RED_VALUE_ARB* = 0x00002037
WGL_TRANSPARENT_GREEN_VALUE_ARB* = 0x00002038
WGL_TRANSPARENT_BLUE_VALUE_ARB* = 0x00002039
WGL_TRANSPARENT_ALPHA_VALUE_ARB* = 0x0000203A
WGL_TRANSPARENT_INDEX_VALUE_ARB* = 0x0000203B
WGL_SHARE_DEPTH_ARB* = 0x0000200C
WGL_SHARE_STENCIL_ARB* = 0x0000200D
WGL_SHARE_ACCUM_ARB* = 0x0000200E
WGL_SUPPORT_GDI_ARB* = 0x0000200F
WGL_SUPPORT_OPENGL_ARB* = 0x00002010
WGL_DOUBLE_BUFFER_ARB* = 0x00002011
WGL_STEREO_ARB* = 0x00002012
WGL_PIXEL_TYPE_ARB* = 0x00002013
WGL_COLOR_BITS_ARB* = 0x00002014
WGL_RED_BITS_ARB* = 0x00002015
WGL_RED_SHIFT_ARB* = 0x00002016
WGL_GREEN_BITS_ARB* = 0x00002017
WGL_GREEN_SHIFT_ARB* = 0x00002018
WGL_BLUE_BITS_ARB* = 0x00002019
WGL_BLUE_SHIFT_ARB* = 0x0000201A
WGL_ALPHA_BITS_ARB* = 0x0000201B
WGL_ALPHA_SHIFT_ARB* = 0x0000201C
WGL_ACCUM_BITS_ARB* = 0x0000201D
WGL_ACCUM_RED_BITS_ARB* = 0x0000201E
WGL_ACCUM_GREEN_BITS_ARB* = 0x0000201F
WGL_ACCUM_BLUE_BITS_ARB* = 0x00002020
WGL_ACCUM_ALPHA_BITS_ARB* = 0x00002021
WGL_DEPTH_BITS_ARB* = 0x00002022
WGL_STENCIL_BITS_ARB* = 0x00002023
WGL_AUX_BUFFERS_ARB* = 0x00002024
WGL_NO_ACCELERATION_ARB* = 0x00002025
WGL_GENERIC_ACCELERATION_ARB* = 0x00002026
WGL_FULL_ACCELERATION_ARB* = 0x00002027
WGL_SWAP_EXCHANGE_ARB* = 0x00002028
WGL_SWAP_COPY_ARB* = 0x00002029
WGL_SWAP_UNDEFINED_ARB* = 0x0000202A
WGL_TYPE_RGBA_ARB* = 0x0000202B
WGL_TYPE_COLORINDEX_ARB* = 0x0000202C
proc wglGetPixelFormatAttribivARB*(hdc: HDC, iPixelFormat: TGLint,
iLayerPlane: TGLint, nAttributes: TGLuint,
piAttributes: PGLint, piValues: PGLint): BOOL{.
dynlib: dllname, importc.}
proc wglGetPixelFormatAttribfvARB*(hdc: HDC, iPixelFormat: TGLint,
iLayerPlane: TGLint, nAttributes: TGLuint,
piAttributes: PGLint, pfValues: PGLfloat): BOOL{.
dynlib: dllname, importc.}
proc wglChoosePixelFormatARB*(hdc: HDC, piAttribIList: PGLint,
pfAttribFList: PGLfloat, nMaxFormats: TGLuint,
piFormats: PGLint, nNumFormats: PGLuint): BOOL{.
dynlib: dllname, importc.}
const
WGL_ERROR_INVALID_PIXEL_TYPE_ARB* = 0x00002043
WGL_ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB* = 0x00002054
proc wglMakeContextCurrentARB*(hDrawDC: HDC, hReadDC: HDC, hglrc: HGLRC): BOOL{.
dynlib: dllname, importc.}
proc wglGetCurrentReadDCARB*(): HDC{.dynlib: dllname, importc.}
const
WGL_DRAW_TO_PBUFFER_ARB* = 0x0000202D # WGL_DRAW_TO_PBUFFER_ARB { already defined }
WGL_MAX_PBUFFER_PIXELS_ARB* = 0x0000202E
WGL_MAX_PBUFFER_WIDTH_ARB* = 0x0000202F
WGL_MAX_PBUFFER_HEIGHT_ARB* = 0x00002030
WGL_PBUFFER_LARGEST_ARB* = 0x00002033
WGL_PBUFFER_WIDTH_ARB* = 0x00002034
WGL_PBUFFER_HEIGHT_ARB* = 0x00002035
WGL_PBUFFER_LOST_ARB* = 0x00002036
proc wglCreatePbufferARB*(hDC: HDC, iPixelFormat: TGLint, iWidth: TGLint,
iHeight: TGLint, piAttribList: PGLint): THandle{.
dynlib: dllname, importc.}
proc wglGetPbufferDCARB*(hPbuffer: THandle): HDC{.dynlib: dllname, importc.}
proc wglReleasePbufferDCARB*(hPbuffer: THandle, hDC: HDC): TGLint{.
dynlib: dllname, importc.}
proc wglDestroyPbufferARB*(hPbuffer: THandle): BOOL{.dynlib: dllname, importc.}
proc wglQueryPbufferARB*(hPbuffer: THandle, iAttribute: TGLint, piValue: PGLint): BOOL{.
dynlib: dllname, importc.}
proc wglSwapIntervalEXT*(interval: TGLint): BOOL{.dynlib: dllname, importc.}
proc wglGetSwapIntervalEXT*(): TGLint{.dynlib: dllname, importc.}
const
WGL_BIND_TO_TEXTURE_RGB_ARB* = 0x00002070
WGL_BIND_TO_TEXTURE_RGBA_ARB* = 0x00002071
WGL_TEXTURE_FORMAT_ARB* = 0x00002072
WGL_TEXTURE_TARGET_ARB* = 0x00002073
WGL_MIPMAP_TEXTURE_ARB* = 0x00002074
WGL_TEXTURE_RGB_ARB* = 0x00002075
WGL_TEXTURE_RGBA_ARB* = 0x00002076
WGL_NO_TEXTURE_ARB* = 0x00002077
WGL_TEXTURE_CUBE_MAP_ARB* = 0x00002078
WGL_TEXTURE_1D_ARB* = 0x00002079
WGL_TEXTURE_2D_ARB* = 0x0000207A # WGL_NO_TEXTURE_ARB { already defined }
WGL_MIPMAP_LEVEL_ARB* = 0x0000207B
WGL_CUBE_MAP_FACE_ARB* = 0x0000207C
WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB* = 0x0000207D
WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB* = 0x0000207E
WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB* = 0x0000207F
WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB* = 0x00002080
WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB* = 0x00002081
WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB* = 0x00002082
WGL_FRONT_LEFT_ARB* = 0x00002083
WGL_FRONT_RIGHT_ARB* = 0x00002084
WGL_BACK_LEFT_ARB* = 0x00002085
WGL_BACK_RIGHT_ARB* = 0x00002086
WGL_AUX0_ARB* = 0x00002087
WGL_AUX1_ARB* = 0x00002088
WGL_AUX2_ARB* = 0x00002089
WGL_AUX3_ARB* = 0x0000208A
WGL_AUX4_ARB* = 0x0000208B
WGL_AUX5_ARB* = 0x0000208C
WGL_AUX6_ARB* = 0x0000208D
WGL_AUX7_ARB* = 0x0000208E
WGL_AUX8_ARB* = 0x0000208F
WGL_AUX9_ARB* = 0x00002090
proc wglBindTexImageARB*(hPbuffer: THandle, iBuffer: TGLint): BOOL{.
dynlib: dllname, importc.}
proc wglReleaseTexImageARB*(hPbuffer: THandle, iBuffer: TGLint): BOOL{.
dynlib: dllname, importc.}
proc wglSetPbufferAttribARB*(hPbuffer: THandle, piAttribList: PGLint): BOOL{.
dynlib: dllname, importc.}
proc wglGetExtensionsStringEXT*(): cstring{.dynlib: dllname, importc.}
proc wglMakeContextCurrentEXT*(hDrawDC: HDC, hReadDC: HDC, hglrc: HGLRC): BOOL{.
dynlib: dllname, importc.}
proc wglGetCurrentReadDCEXT*(): HDC{.dynlib: dllname, importc.}
const
WGL_DRAW_TO_PBUFFER_EXT* = 0x0000202D
WGL_MAX_PBUFFER_PIXELS_EXT* = 0x0000202E
WGL_MAX_PBUFFER_WIDTH_EXT* = 0x0000202F
WGL_MAX_PBUFFER_HEIGHT_EXT* = 0x00002030
WGL_OPTIMAL_PBUFFER_WIDTH_EXT* = 0x00002031
WGL_OPTIMAL_PBUFFER_HEIGHT_EXT* = 0x00002032
WGL_PBUFFER_LARGEST_EXT* = 0x00002033
WGL_PBUFFER_WIDTH_EXT* = 0x00002034
WGL_PBUFFER_HEIGHT_EXT* = 0x00002035
proc wglCreatePbufferEXT*(hDC: HDC, iPixelFormat: TGLint, iWidth: TGLint,
iHeight: TGLint, piAttribList: PGLint): THandle{.
dynlib: dllname, importc.}
proc wglGetPbufferDCEXT*(hPbuffer: THandle): HDC{.dynlib: dllname, importc.}
proc wglReleasePbufferDCEXT*(hPbuffer: THandle, hDC: HDC): TGLint{.
dynlib: dllname, importc.}
proc wglDestroyPbufferEXT*(hPbuffer: THandle): BOOL{.dynlib: dllname, importc.}
proc wglQueryPbufferEXT*(hPbuffer: THandle, iAttribute: TGLint, piValue: PGLint): BOOL{.
dynlib: dllname, importc.}
const
WGL_NUMBER_PIXEL_FORMATS_EXT* = 0x00002000
WGL_DRAW_TO_WINDOW_EXT* = 0x00002001
WGL_DRAW_TO_BITMAP_EXT* = 0x00002002
WGL_ACCELERATION_EXT* = 0x00002003
WGL_NEED_PALETTE_EXT* = 0x00002004
WGL_NEED_SYSTEM_PALETTE_EXT* = 0x00002005
WGL_SWAP_LAYER_BUFFERS_EXT* = 0x00002006
WGL_SWAP_METHOD_EXT* = 0x00002007
WGL_NUMBER_OVERLAYS_EXT* = 0x00002008
WGL_NUMBER_UNDERLAYS_EXT* = 0x00002009
WGL_TRANSPARENT_EXT* = 0x0000200A
WGL_TRANSPARENT_VALUE_EXT* = 0x0000200B
WGL_SHARE_DEPTH_EXT* = 0x0000200C
WGL_SHARE_STENCIL_EXT* = 0x0000200D
WGL_SHARE_ACCUM_EXT* = 0x0000200E
WGL_SUPPORT_GDI_EXT* = 0x0000200F
WGL_SUPPORT_OPENGL_EXT* = 0x00002010
WGL_DOUBLE_BUFFER_EXT* = 0x00002011
WGL_STEREO_EXT* = 0x00002012
WGL_PIXEL_TYPE_EXT* = 0x00002013
WGL_COLOR_BITS_EXT* = 0x00002014
WGL_RED_BITS_EXT* = 0x00002015
WGL_RED_SHIFT_EXT* = 0x00002016
WGL_GREEN_BITS_EXT* = 0x00002017
WGL_GREEN_SHIFT_EXT* = 0x00002018
WGL_BLUE_BITS_EXT* = 0x00002019
WGL_BLUE_SHIFT_EXT* = 0x0000201A
WGL_ALPHA_BITS_EXT* = 0x0000201B
WGL_ALPHA_SHIFT_EXT* = 0x0000201C
WGL_ACCUM_BITS_EXT* = 0x0000201D
WGL_ACCUM_RED_BITS_EXT* = 0x0000201E
WGL_ACCUM_GREEN_BITS_EXT* = 0x0000201F
WGL_ACCUM_BLUE_BITS_EXT* = 0x00002020
WGL_ACCUM_ALPHA_BITS_EXT* = 0x00002021
WGL_DEPTH_BITS_EXT* = 0x00002022
WGL_STENCIL_BITS_EXT* = 0x00002023
WGL_AUX_BUFFERS_EXT* = 0x00002024
WGL_NO_ACCELERATION_EXT* = 0x00002025
WGL_GENERIC_ACCELERATION_EXT* = 0x00002026
WGL_FULL_ACCELERATION_EXT* = 0x00002027
WGL_SWAP_EXCHANGE_EXT* = 0x00002028
WGL_SWAP_COPY_EXT* = 0x00002029
WGL_SWAP_UNDEFINED_EXT* = 0x0000202A
WGL_TYPE_RGBA_EXT* = 0x0000202B
WGL_TYPE_COLORINDEX_EXT* = 0x0000202C
proc wglGetPixelFormatAttribivEXT*(hdc: HDC, iPixelFormat: TGLint,
iLayerPlane: TGLint, nAttributes: TGLuint,
piAttributes: PGLint, piValues: PGLint): BOOL{.
dynlib: dllname, importc.}
proc wglGetPixelFormatAttribfvEXT*(hdc: HDC, iPixelFormat: TGLint,
iLayerPlane: TGLint, nAttributes: TGLuint,
piAttributes: PGLint, pfValues: PGLfloat): BOOL{.
dynlib: dllname, importc.}
proc wglChoosePixelFormatEXT*(hdc: HDC, piAttribIList: PGLint,
pfAttribFList: PGLfloat, nMaxFormats: TGLuint,
piFormats: PGLint, nNumFormats: PGLuint): BOOL{.
dynlib: dllname, importc.}
const
WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D* = 0x00002050
WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D* = 0x00002051
WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D* = 0x00002052
WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D* = 0x00002053
proc wglGetDigitalVideoParametersI3D*(hDC: HDC, iAttribute: TGLint,
piValue: PGLint): BOOL{.dynlib: dllname,
importc.}
proc wglSetDigitalVideoParametersI3D*(hDC: HDC, iAttribute: TGLint,
piValue: PGLint): BOOL{.dynlib: dllname,
importc.}
const
WGL_GAMMA_TABLE_SIZE_I3D* = 0x0000204E
WGL_GAMMA_EXCLUDE_DESKTOP_I3D* = 0x0000204F
proc wglGetGammaTableParametersI3D*(hDC: HDC, iAttribute: TGLint,
piValue: PGLint): BOOL{.dynlib: dllname,
importc.}
proc wglSetGammaTableParametersI3D*(hDC: HDC, iAttribute: TGLint,
piValue: PGLint): BOOL{.dynlib: dllname,
importc.}
proc wglGetGammaTableI3D*(hDC: HDC, iEntries: TGLint, puRed: PGLUSHORT,
puGreen: PGLUSHORT, puBlue: PGLUSHORT): BOOL{.
dynlib: dllname, importc.}
proc wglSetGammaTableI3D*(hDC: HDC, iEntries: TGLint, puRed: PGLUSHORT,
puGreen: PGLUSHORT, puBlue: PGLUSHORT): BOOL{.
dynlib: dllname, importc.}
const
WGL_GENLOCK_SOURCE_MULTIVIEW_I3D* = 0x00002044
WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D* = 0x00002045
WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D* = 0x00002046
WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D* = 0x00002047
WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D* = 0x00002048
WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D* = 0x00002049
WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D* = 0x0000204A
WGL_GENLOCK_SOURCE_EDGE_RISING_I3D* = 0x0000204B
WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D* = 0x0000204C
WGL_FLOAT_COMPONENTS_NV* = 0x000020B0
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV* = 0x000020B1
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV* = 0x000020B2
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV* = 0x000020B3
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV* = 0x000020B4
WGL_TEXTURE_FLOAT_R_NV* = 0x000020B5
WGL_TEXTURE_FLOAT_RG_NV* = 0x000020B6
WGL_TEXTURE_FLOAT_RGB_NV* = 0x000020B7
WGL_TEXTURE_FLOAT_RGBA_NV* = 0x000020B8
proc wglEnableGenlockI3D*(hDC: HDC): BOOL{.dynlib: dllname, importc.}
proc wglDisableGenlockI3D*(hDC: HDC): BOOL{.dynlib: dllname, importc.}
proc wglIsEnabledGenlockI3D*(hDC: HDC, pFlag: PBOOL): BOOL{.dynlib: dllname,
importc.}
proc wglGenlockSourceI3D*(hDC: HDC, uSource: TGLuint): BOOL{.dynlib: dllname,
importc.}
proc wglGetGenlockSourceI3D*(hDC: HDC, uSource: PGLUINT): BOOL{.dynlib: dllname,
importc.}
proc wglGenlockSourceEdgeI3D*(hDC: HDC, uEdge: TGLuint): BOOL{.dynlib: dllname,
importc.}
proc wglGetGenlockSourceEdgeI3D*(hDC: HDC, uEdge: PGLUINT): BOOL{.
dynlib: dllname, importc.}
proc wglGenlockSampleRateI3D*(hDC: HDC, uRate: TGLuint): BOOL{.dynlib: dllname,
importc.}
proc wglGetGenlockSampleRateI3D*(hDC: HDC, uRate: PGLUINT): BOOL{.
dynlib: dllname, importc.}
proc wglGenlockSourceDelayI3D*(hDC: HDC, uDelay: TGLuint): BOOL{.
dynlib: dllname, importc.}
proc wglGetGenlockSourceDelayI3D*(hDC: HDC, uDelay: PGLUINT): BOOL{.
dynlib: dllname, importc.}
proc wglQueryGenlockMaxSourceDelayI3D*(hDC: HDC, uMaxLineDelay: PGLUINT,
uMaxPixelDelay: PGLUINT): BOOL{.
dynlib: dllname, importc.}
const
WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV* = 0x000020A0
WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV* = 0x000020A1
WGL_TEXTURE_RECTANGLE_NV* = 0x000020A2
const
WGL_RGBA_FLOAT_MODE_ATI* = 0x00008820
WGL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI* = 0x00008835
WGL_TYPE_RGBA_FLOAT_ATI* = 0x000021A0
# implementation

View file

@ -0,0 +1,313 @@
unit wingl;
interface
uses gl;
function wglGetExtensionsStringARB(hdc: HDC): Pchar; external dllname;
function Load_WGL_ARB_extensions_string: Boolean; external dllname;
const
WGL_FRONT_COLOR_BUFFER_BIT_ARB = $0001;
WGL_BACK_COLOR_BUFFER_BIT_ARB = $0002;
WGL_DEPTH_BUFFER_BIT_ARB = $0004;
WGL_STENCIL_BUFFER_BIT_ARB = $0008;
function WinChoosePixelFormat(DC: HDC; p2: PPixelFormatDescriptor): Integer; external dllname; external 'gdi32' name 'ChoosePixelFormat';
function wglCreateBufferRegionARB(hDC: HDC; iLayerPlane: TGLint; uType: TGLuint): THandle; external dllname;
procedure wglDeleteBufferRegionARB(hRegion: THandle); external dllname;
function wglSaveBufferRegionARB(hRegion: THandle; x: TGLint; y: TGLint; width: TGLint; height: TGLint): BOOL; external dllname;
function wglRestoreBufferRegionARB(hRegion: THandle; x: TGLint; y: TGLint; width: TGLint; height: TGLint; xSrc: TGLint; ySrc: TGLint): BOOL; external dllname;
function wglAllocateMemoryNV(size: TGLsizei; readFrequency: TGLfloat; writeFrequency: TGLfloat; priority: TGLfloat): PGLvoid; external dllname;
procedure wglFreeMemoryNV(pointer: PGLvoid); external dllname;
const
WGL_IMAGE_BUFFER_MIN_ACCESS_I3D = $0001;
WGL_IMAGE_BUFFER_LOCK_I3D = $0002;
function wglCreateImageBufferI3D(hDC: HDC; dwSize: DWORD; uFlags: UINT): PGLvoid; external dllname;
function wglDestroyImageBufferI3D(hDC: HDC; pAddress: PGLvoid): BOOL; external dllname;
function wglAssociateImageBufferEventsI3D(hdc: HDC; pEvent: PHandle; pAddress: PGLvoid; pSize: PDWORD; count: UINT): BOOL; external dllname;
function wglReleaseImageBufferEventsI3D(hdc: HDC; pAddress: PGLvoid; count: UINT): BOOL; external dllname;
function wglEnableFrameLockI3D(): BOOL; external dllname;
function wglDisableFrameLockI3D(): BOOL; external dllname;
function wglIsEnabledFrameLockI3D(pFlag: PBOOL): BOOL; external dllname;
function wglQueryFrameLockMasterI3D(pFlag: PBOOL): BOOL; external dllname;
function wglGetFrameUsageI3D(pUsage: PGLfloat): BOOL; external dllname;
function wglBeginFrameTrackingI3D(): BOOL; external dllname;
function wglEndFrameTrackingI3D(): BOOL; external dllname;
function wglQueryFrameTrackingI3D(pFrameCount: PDWORD; pMissedFrames: PDWORD; pLastMissedUsage: PGLfloat): BOOL; external dllname;
const
WGL_NUMBER_PIXEL_FORMATS_ARB = $2000;
WGL_DRAW_TO_WINDOW_ARB = $2001;
WGL_DRAW_TO_BITMAP_ARB = $2002;
WGL_ACCELERATION_ARB = $2003;
WGL_NEED_PALETTE_ARB = $2004;
WGL_NEED_SYSTEM_PALETTE_ARB = $2005;
WGL_SWAP_LAYER_BUFFERS_ARB = $2006;
WGL_SWAP_METHOD_ARB = $2007;
WGL_NUMBER_OVERLAYS_ARB = $2008;
WGL_NUMBER_UNDERLAYS_ARB = $2009;
WGL_TRANSPARENT_ARB = $200A;
WGL_TRANSPARENT_RED_VALUE_ARB = $2037;
WGL_TRANSPARENT_GREEN_VALUE_ARB = $2038;
WGL_TRANSPARENT_BLUE_VALUE_ARB = $2039;
WGL_TRANSPARENT_ALPHA_VALUE_ARB = $203A;
WGL_TRANSPARENT_INDEX_VALUE_ARB = $203B;
WGL_SHARE_DEPTH_ARB = $200C;
WGL_SHARE_STENCIL_ARB = $200D;
WGL_SHARE_ACCUM_ARB = $200E;
WGL_SUPPORT_GDI_ARB = $200F;
WGL_SUPPORT_OPENGL_ARB = $2010;
WGL_DOUBLE_BUFFER_ARB = $2011;
WGL_STEREO_ARB = $2012;
WGL_PIXEL_TYPE_ARB = $2013;
WGL_COLOR_BITS_ARB = $2014;
WGL_RED_BITS_ARB = $2015;
WGL_RED_SHIFT_ARB = $2016;
WGL_GREEN_BITS_ARB = $2017;
WGL_GREEN_SHIFT_ARB = $2018;
WGL_BLUE_BITS_ARB = $2019;
WGL_BLUE_SHIFT_ARB = $201A;
WGL_ALPHA_BITS_ARB = $201B;
WGL_ALPHA_SHIFT_ARB = $201C;
WGL_ACCUM_BITS_ARB = $201D;
WGL_ACCUM_RED_BITS_ARB = $201E;
WGL_ACCUM_GREEN_BITS_ARB = $201F;
WGL_ACCUM_BLUE_BITS_ARB = $2020;
WGL_ACCUM_ALPHA_BITS_ARB = $2021;
WGL_DEPTH_BITS_ARB = $2022;
WGL_STENCIL_BITS_ARB = $2023;
WGL_AUX_BUFFERS_ARB = $2024;
WGL_NO_ACCELERATION_ARB = $2025;
WGL_GENERIC_ACCELERATION_ARB = $2026;
WGL_FULL_ACCELERATION_ARB = $2027;
WGL_SWAP_EXCHANGE_ARB = $2028;
WGL_SWAP_COPY_ARB = $2029;
WGL_SWAP_UNDEFINED_ARB = $202A;
WGL_TYPE_RGBA_ARB = $202B;
WGL_TYPE_COLORINDEX_ARB = $202C;
function wglGetPixelFormatAttribivARB(hdc: HDC; iPixelFormat: TGLint; iLayerPlane: TGLint; nAttributes: TGLuint; const piAttributes: PGLint; piValues: PGLint): BOOL; external dllname;
function wglGetPixelFormatAttribfvARB(hdc: HDC; iPixelFormat: TGLint; iLayerPlane: TGLint; nAttributes: TGLuint; const piAttributes: PGLint; pfValues: PGLfloat): BOOL; external dllname;
function wglChoosePixelFormatARB(hdc: HDC; const piAttribIList: PGLint; const pfAttribFList: PGLfloat; nMaxFormats: TGLuint; piFormats: PGLint; nNumFormats: PGLuint): BOOL; external dllname;
const
WGL_ERROR_INVALID_PIXEL_TYPE_ARB = $2043;
WGL_ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB = $2054;
function wglMakeContextCurrentARB(hDrawDC: HDC; hReadDC: HDC; hglrc: HGLRC): BOOL; external dllname;
function wglGetCurrentReadDCARB(): HDC; external dllname;
function Load_WGL_ARB_make_current_read: Boolean;
const
WGL_DRAW_TO_PBUFFER_ARB = $202D;
// WGL_DRAW_TO_PBUFFER_ARB { already defined }
WGL_MAX_PBUFFER_PIXELS_ARB = $202E;
WGL_MAX_PBUFFER_WIDTH_ARB = $202F;
WGL_MAX_PBUFFER_HEIGHT_ARB = $2030;
WGL_PBUFFER_LARGEST_ARB = $2033;
WGL_PBUFFER_WIDTH_ARB = $2034;
WGL_PBUFFER_HEIGHT_ARB = $2035;
WGL_PBUFFER_LOST_ARB = $2036;
function wglCreatePbufferARB(hDC: HDC; iPixelFormat: TGLint; iWidth: TGLint; iHeight: TGLint; const piAttribList: PGLint): THandle; external dllname;
function wglGetPbufferDCARB(hPbuffer: THandle): HDC; external dllname;
function wglReleasePbufferDCARB(hPbuffer: THandle; hDC: HDC): TGLint; external dllname;
function wglDestroyPbufferARB(hPbuffer: THandle): BOOL; external dllname;
function wglQueryPbufferARB(hPbuffer: THandle; iAttribute: TGLint; piValue: PGLint): BOOL; external dllname;
function wglSwapIntervalEXT(interval: TGLint): BOOL; external dllname;
function wglGetSwapIntervalEXT(): TGLint; external dllname;
const
WGL_BIND_TO_TEXTURE_RGB_ARB = $2070;
WGL_BIND_TO_TEXTURE_RGBA_ARB = $2071;
WGL_TEXTURE_FORMAT_ARB = $2072;
WGL_TEXTURE_TARGET_ARB = $2073;
WGL_MIPMAP_TEXTURE_ARB = $2074;
WGL_TEXTURE_RGB_ARB = $2075;
WGL_TEXTURE_RGBA_ARB = $2076;
WGL_NO_TEXTURE_ARB = $2077;
WGL_TEXTURE_CUBE_MAP_ARB = $2078;
WGL_TEXTURE_1D_ARB = $2079;
WGL_TEXTURE_2D_ARB = $207A;
// WGL_NO_TEXTURE_ARB { already defined }
WGL_MIPMAP_LEVEL_ARB = $207B;
WGL_CUBE_MAP_FACE_ARB = $207C;
WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB = $207D;
WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = $207E;
WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = $207F;
WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = $2080;
WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = $2081;
WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = $2082;
WGL_FRONT_LEFT_ARB = $2083;
WGL_FRONT_RIGHT_ARB = $2084;
WGL_BACK_LEFT_ARB = $2085;
WGL_BACK_RIGHT_ARB = $2086;
WGL_AUX0_ARB = $2087;
WGL_AUX1_ARB = $2088;
WGL_AUX2_ARB = $2089;
WGL_AUX3_ARB = $208A;
WGL_AUX4_ARB = $208B;
WGL_AUX5_ARB = $208C;
WGL_AUX6_ARB = $208D;
WGL_AUX7_ARB = $208E;
WGL_AUX8_ARB = $208F;
WGL_AUX9_ARB = $2090;
function wglBindTexImageARB(hPbuffer: THandle; iBuffer: TGLint): BOOL; external dllname;
function wglReleaseTexImageARB(hPbuffer: THandle; iBuffer: TGLint): BOOL; external dllname;
function wglSetPbufferAttribARB(hPbuffer: THandle; const piAttribList: PGLint): BOOL; external dllname;
function wglGetExtensionsStringEXT(): Pchar; external dllname;
function wglMakeContextCurrentEXT(hDrawDC: HDC; hReadDC: HDC; hglrc: HGLRC): BOOL; external dllname;
function wglGetCurrentReadDCEXT(): HDC; external dllname;
const
WGL_DRAW_TO_PBUFFER_EXT = $202D;
WGL_MAX_PBUFFER_PIXELS_EXT = $202E;
WGL_MAX_PBUFFER_WIDTH_EXT = $202F;
WGL_MAX_PBUFFER_HEIGHT_EXT = $2030;
WGL_OPTIMAL_PBUFFER_WIDTH_EXT = $2031;
WGL_OPTIMAL_PBUFFER_HEIGHT_EXT = $2032;
WGL_PBUFFER_LARGEST_EXT = $2033;
WGL_PBUFFER_WIDTH_EXT = $2034;
WGL_PBUFFER_HEIGHT_EXT = $2035;
function wglCreatePbufferEXT(hDC: HDC; iPixelFormat: TGLint; iWidth: TGLint; iHeight: TGLint; const piAttribList: PGLint): THandle; external dllname;
function wglGetPbufferDCEXT(hPbuffer: THandle): HDC; external dllname;
function wglReleasePbufferDCEXT(hPbuffer: THandle; hDC: HDC): TGLint; external dllname;
function wglDestroyPbufferEXT(hPbuffer: THandle): BOOL; external dllname;
function wglQueryPbufferEXT(hPbuffer: THandle; iAttribute: TGLint; piValue: PGLint): BOOL; external dllname;
const
WGL_NUMBER_PIXEL_FORMATS_EXT = $2000;
WGL_DRAW_TO_WINDOW_EXT = $2001;
WGL_DRAW_TO_BITMAP_EXT = $2002;
WGL_ACCELERATION_EXT = $2003;
WGL_NEED_PALETTE_EXT = $2004;
WGL_NEED_SYSTEM_PALETTE_EXT = $2005;
WGL_SWAP_LAYER_BUFFERS_EXT = $2006;
WGL_SWAP_METHOD_EXT = $2007;
WGL_NUMBER_OVERLAYS_EXT = $2008;
WGL_NUMBER_UNDERLAYS_EXT = $2009;
WGL_TRANSPARENT_EXT = $200A;
WGL_TRANSPARENT_VALUE_EXT = $200B;
WGL_SHARE_DEPTH_EXT = $200C;
WGL_SHARE_STENCIL_EXT = $200D;
WGL_SHARE_ACCUM_EXT = $200E;
WGL_SUPPORT_GDI_EXT = $200F;
WGL_SUPPORT_OPENGL_EXT = $2010;
WGL_DOUBLE_BUFFER_EXT = $2011;
WGL_STEREO_EXT = $2012;
WGL_PIXEL_TYPE_EXT = $2013;
WGL_COLOR_BITS_EXT = $2014;
WGL_RED_BITS_EXT = $2015;
WGL_RED_SHIFT_EXT = $2016;
WGL_GREEN_BITS_EXT = $2017;
WGL_GREEN_SHIFT_EXT = $2018;
WGL_BLUE_BITS_EXT = $2019;
WGL_BLUE_SHIFT_EXT = $201A;
WGL_ALPHA_BITS_EXT = $201B;
WGL_ALPHA_SHIFT_EXT = $201C;
WGL_ACCUM_BITS_EXT = $201D;
WGL_ACCUM_RED_BITS_EXT = $201E;
WGL_ACCUM_GREEN_BITS_EXT = $201F;
WGL_ACCUM_BLUE_BITS_EXT = $2020;
WGL_ACCUM_ALPHA_BITS_EXT = $2021;
WGL_DEPTH_BITS_EXT = $2022;
WGL_STENCIL_BITS_EXT = $2023;
WGL_AUX_BUFFERS_EXT = $2024;
WGL_NO_ACCELERATION_EXT = $2025;
WGL_GENERIC_ACCELERATION_EXT = $2026;
WGL_FULL_ACCELERATION_EXT = $2027;
WGL_SWAP_EXCHANGE_EXT = $2028;
WGL_SWAP_COPY_EXT = $2029;
WGL_SWAP_UNDEFINED_EXT = $202A;
WGL_TYPE_RGBA_EXT = $202B;
WGL_TYPE_COLORINDEX_EXT = $202C;
function wglGetPixelFormatAttribivEXT(hdc: HDC; iPixelFormat: TGLint; iLayerPlane: TGLint; nAttributes: TGLuint; piAttributes: PGLint; piValues: PGLint): BOOL; external dllname;
function wglGetPixelFormatAttribfvEXT(hdc: HDC; iPixelFormat: TGLint; iLayerPlane: TGLint; nAttributes: TGLuint; piAttributes: PGLint; pfValues: PGLfloat): BOOL; external dllname;
function wglChoosePixelFormatEXT(hdc: HDC; const piAttribIList: PGLint; const pfAttribFList: PGLfloat; nMaxFormats: TGLuint; piFormats: PGLint; nNumFormats: PGLuint): BOOL; external dllname;
const
WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D = $2050;
WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D = $2051;
WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D = $2052;
WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D = $2053;
function wglGetDigitalVideoParametersI3D(hDC: HDC; iAttribute: TGLint; piValue: PGLint): BOOL; external dllname;
function wglSetDigitalVideoParametersI3D(hDC: HDC; iAttribute: TGLint; const piValue: PGLint): BOOL; external dllname;
const
WGL_GAMMA_TABLE_SIZE_I3D = $204E;
WGL_GAMMA_EXCLUDE_DESKTOP_I3D = $204F;
function wglGetGammaTableParametersI3D(hDC: HDC; iAttribute: TGLint; piValue: PGLint): BOOL; external dllname;
function wglSetGammaTableParametersI3D(hDC: HDC; iAttribute: TGLint; const piValue: PGLint): BOOL; external dllname;
function wglGetGammaTableI3D(hDC: HDC; iEntries: TGLint; puRed: PGLUSHORT; puGreen: PGLUSHORT; puBlue: PGLUSHORT): BOOL; external dllname;
function wglSetGammaTableI3D(hDC: HDC; iEntries: TGLint; const puRed: PGLUSHORT; const puGreen: PGLUSHORT; const puBlue: PGLUSHORT): BOOL; external dllname;
const
WGL_GENLOCK_SOURCE_MULTIVIEW_I3D = $2044;
WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D = $2045;
WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D = $2046;
WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D = $2047;
WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D = $2048;
WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D = $2049;
WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D = $204A;
WGL_GENLOCK_SOURCE_EDGE_RISING_I3D = $204B;
WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D = $204C;
WGL_FLOAT_COMPONENTS_NV = $20B0;
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV = $20B1;
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV = $20B2;
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV = $20B3;
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV = $20B4;
WGL_TEXTURE_FLOAT_R_NV = $20B5;
WGL_TEXTURE_FLOAT_RG_NV = $20B6;
WGL_TEXTURE_FLOAT_RGB_NV = $20B7;
WGL_TEXTURE_FLOAT_RGBA_NV = $20B8;
function wglEnableGenlockI3D(hDC: HDC): BOOL; external dllname;
function wglDisableGenlockI3D(hDC: HDC): BOOL; external dllname;
function wglIsEnabledGenlockI3D(hDC: HDC; pFlag: PBOOL): BOOL; external dllname;
function wglGenlockSourceI3D(hDC: HDC; uSource: TGLuint): BOOL; external dllname;
function wglGetGenlockSourceI3D(hDC: HDC; uSource: PGLUINT): BOOL; external dllname;
function wglGenlockSourceEdgeI3D(hDC: HDC; uEdge: TGLuint): BOOL; external dllname;
function wglGetGenlockSourceEdgeI3D(hDC: HDC; uEdge: PGLUINT): BOOL; external dllname;
function wglGenlockSampleRateI3D(hDC: HDC; uRate: TGLuint): BOOL; external dllname;
function wglGetGenlockSampleRateI3D(hDC: HDC; uRate: PGLUINT): BOOL; external dllname;
function wglGenlockSourceDelayI3D(hDC: HDC; uDelay: TGLuint): BOOL; external dllname;
function wglGetGenlockSourceDelayI3D(hDC: HDC; uDelay: PGLUINT): BOOL; external dllname;
function wglQueryGenlockMaxSourceDelayI3D(hDC: HDC; uMaxLineDelay: PGLUINT; uMaxPixelDelay: PGLUINT): BOOL; external dllname;
const
WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV = $20A0;
WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV = $20A1;
WGL_TEXTURE_RECTANGLE_NV = $20A2;
const
WGL_RGBA_FLOAT_MODE_ATI = $8820;
WGL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI = $8835;
WGL_TYPE_RGBA_FLOAT_ATI = $21A0;
implementation
end.