#ifndef _INC_GLU
#define _INC_GLU

Function gluErrorStringWIN(errCode As GLenum) As PSTR
	gluErrorStringWIN = gluErrorString(errCode) As PSTR
End Function

Declare Function gluErrorString Lib "glu32"  (errCode As GLenum) As *GLubyte
Declare Function gluErrorUnicodeStringEXT Lib "glu32"  (errCode As GLenum) As PWSTR
Declare Function gluGetString Lib "glu32"  (name As GLenum) As *GLubyte

Declare Sub gluOrtho2D Lib "glu32"  (left As GLdouble, right As GLdouble, bottom As GLdouble, top As GLdouble)
Declare Sub gluPerspective Lib "glu32"  (fovy As GLdouble, aspect As GLdouble, zNear As GLdouble, zFar As GLdouble)
Declare Sub gluPickMatrix Lib "glu32"  (x As GLdouble, y As GLdouble, width As GLdouble, height As GLdouble, viewport As *GLint)
Declare Sub gluLookAt Lib "glu32"  (eyex As GLdouble, eyey As GLdouble, eyez As GLdouble, centerx As GLdouble, centery As GLdouble, centerz As GLdouble, upx As GLdouble, upy As GLdouble, upz As GLdouble)
Declare Function gluProject Lib "glu32"  (objx As GLdouble, objy As GLdouble, objz As GLdouble, modelMatrix As *GLdouble, projMatrix As *GLdouble, viewport As *GLint, winx As *GLdouble, winy As *GLdouble, winz As *GLdouble) As Long
Declare Function gluUnProject Lib "glu32"  (winx As GLdouble, winy As GLdouble, winz As GLdouble, modelMatrix As *GLdouble, projMatrix As *GLdouble, viewport As *GLint, objx As *GLdouble, objy As *GLdouble, objz As *GLdouble) As Long
Declare Function gluScaleImage Lib "glu32"  (format As GLenum, widthin As GLint, heightin As GLint, typein As GLenum, datain As VoidPtr, widthout As GLint, heightout As GLint, typeout As GLenum, dataout As VoidPtr) As Long
Declare Function gluBuild1DMipmaps Lib "glu32"  (target As GLenum, components As GLint, width As GLint, format As GLenum, type_ As GLenum, data As VoidPtr) As Long
Declare Function gluBuild2DMipmaps Lib "glu32"  (target As GLenum, components As GLint, width As GLint, height As GLint, format As GLenum, type_ As GLenum, data As VoidPtr) As Long

TypeDef GLUnurbs = VoidPtr
TypeDef GLUquadric = VoidPtr
TypeDef GLUtesselator = VoidPtr

TypeDef  GLUnurbsObj = GLUnurbs
TypeDef  GLUquadricObj = GLUquadric
TypeDef  GLUtesselatorObj = GLUtesselator
TypeDef  GLUtriangulatorObj = GLUtesselator

Declare Function gluNewQuadric Lib "glu32"  () As *GLUquadric
Declare Sub gluDeleteQuadric Lib "glu32"  (state As *GLUquadric)
Declare Sub gluQuadricNormals Lib "glu32"  (quadObject As *GLUquadric, normals As GLenum)
Declare Sub gluQuadricTexture Lib "glu32"  (quadObject As *GLUquadric, textureCoords As GLboolean)
Declare Sub gluQuadricOrientation Lib "glu32"  (quadObject As *GLUquadric, orientation As GLenum)
Declare Sub gluQuadricDrawStyle Lib "glu32"  (quadObject As *GLUquadric, drawStyle As GLenum)
Declare Sub gluCylinder Lib "glu32"  (qobj As *GLUquadric, baseRadius As GLdouble, topRadius As GLdouble, height As GLdouble, slices As GLint, stacks As GLint)
Declare Sub gluDisk Lib "glu32"  (qobj As *GLUquadric, innerRadius As GLdouble, outerRadius As GLdouble, slices As GLint, loops As GLint)
Declare Sub gluPartialDisk Lib "glu32"  (qobj As *GLUquadric, innerRadius As GLdouble, outerRadius As GLdouble, slices As GLint, loops As GLint, startAngle As GLdouble, sweepAngle As GLdouble)
Declare Sub gluSphere Lib "glu32"  (qobj As *GLUquadric, radius As GLdouble, slices As GLint, stacks As GLint)
TypeDef PFN_QUADRICCALLBACK = *Sub()
Declare Sub gluQuadricCallback Lib "glu32"  (qobj As *GLUquadric, which As GLenum, fn As PFN_QUADRICCALLBACK)
Declare Function gluNewTess Lib "glu32" () As *GLUtesselator
Declare Sub gluDeleteTess Lib "glu32" (tess As *GLUtesselator)
Declare Sub gluTessBeginPolygon Lib "glu32" (tess As *GLUtesselator, polygon_data As VoidPtr)
Declare Sub gluTessBeginContour Lib "glu32" (tess As *GLUtesselator)
Declare Sub gluTessVertex Lib "glu32" (tess As *GLUtesselator, coords As *GLdouble, data As VoidPtr)
Declare Sub gluTessEndContour Lib "glu32" (tess As *GLUtesselator)
Declare Sub gluTessEndPolygon Lib "glu32" (tess As *GLUtesselator)
Declare Sub gluTessProperty Lib "glu32" (tess As *GLUtesselator, which As GLenum, value As GLdouble)
Declare Sub gluTessNormal Lib "glu32" (tess As *GLUtesselator, x As GLdouble, y As GLdouble, z As GLdouble)
TypeDef PFN_TESSCALLBACK = *Sub()
Declare Sub gluTessCallback Lib "glu32" (tess As *GLUtesselator, which As GLenum, fn As PFN_TESSCALLBACK)
Declare Sub gluGetTessProperty Lib "glu32" (tess As *GLUtesselator, which As GLenum, value As *GLdouble)
Declare Function gluNewNurbsRenderer Lib "glu32"  () As *GLUnurbs
Declare Sub gluDeleteNurbsRenderer Lib "glu32"  (nobj As *GLUnurbs)
Declare Sub gluBeginSurface Lib "glu32"  (nobj As *GLUnurbs)
Declare Sub gluBeginCurve Lib "glu32"  (nobj As *GLUnurbs)
Declare Sub gluEndCurve Lib "glu32"  (nobj As *GLUnurbs)
Declare Sub gluEndSurface Lib "glu32"  (nobj As *GLUnurbs)
Declare Sub gluBeginTrim Lib "glu32"  (nobj As *GLUnurbs)
Declare Sub gluEndTrim Lib "glu32"  (nobj As *GLUnurbs)
Declare Sub gluPwlCurve Lib "glu32"  (nobj As *GLUnurbs, count As GLint, array As *GLfloat, stride As GLint, type_ As GLenum)
Declare Sub gluNurbsCurve Lib "glu32"  (nobj As *GLUnurbs, nknots As GLint, knot As *GLfloat, stride As GLint, ctlarray As *GLfloat, order As GLint, type_ As GLenum)
Declare Sub gluNurbsSurface Lib "glu32" (nobj As *GLUnurbs, sknot_count As GLint, sknot As *Single, tknot_count As GLint, tknot As *GLfloat, s_stride As GLint, t_stride As GLint, ctlarray As *GLfloat, sorder As GLint, torder As GLint, type_ As GLenum)
Declare Sub gluLoadSamplingMatrices Lib "glu32"  (nobj As *GLUnurbs, modelMatrix As *GLfloat, projMatrix As *GLfloat, viewport As *GLint)
Declare Sub gluNurbsProperty Lib "glu32"  (nobj As *GLUnurbs, property As GLenum, value As GLfloat)
Declare Sub gluGetNurbsProperty Lib "glu32"  (nobj As *GLUnurbs, property As GLenum, value As *GLfloat)
TypeDef PFN_NURBSCALLBACK = *Sub()
Declare Sub gluNurbsCallback Lib "glu32"  (nobj As *GLUnurbs, which As GLenum, fn As PFN_NURBSCALLBACK)

TypeDef GLUquadricErrorProc= *Sub(e As GLenum)
TypeDef GLUtessBeginProc= *Sub(e As GLenum)
TypeDef GLUtessEdgeFlagProc= *Sub(b As GLboolean)
TypeDef GLUtessVertexProc= *Sub(pv As VoidPtr)
TypeDef GLUtessEndProc= *Sub()
TypeDef GLUtessErrorProc= *Sub(e As GLenum)
TypeDef GLUtessCombineProc= *Sub(dbl As *GLdouble, v As *VoidPtr, f As *GLfloat, ppv As VoidPtr)
TypeDef GLUtessBeginDataProc= *Sub(e As GLenum, pv As VoidPtr)
TypeDef GLUtessEdgeFlagDataProc= *Sub(b As GLboolean, pv As VoidPtr)
TypeDef GLUtessVertexDataProc= *Sub(pv As VoidPtr, pv As VoidPtr)
TypeDef GLUtessEndDataProc= *Sub(pv As VoidPtr)
TypeDef GLUtessErrorDataProc= *Sub(e As GLenum, pv As VoidPtr)
TypeDef GLUtessCombineDataProc= *Sub(dbl As GLdouble, v As VoidPtr, f As *GLfloat, ppv As *VoidPtr, ppv As *VoidPtr)
TypeDef GLUnurbsErrorProc= *Sub(e As GLenum)

Const GLU_VERSION_1_1 = 1
Const GLU_VERSION_1_2 = 1

Const GLU_INVALID_ENUM = 100900
Const GLU_INVALID_VALUE = 100901
Const GLU_OUT_OF_MEMORY = 100902
Const GLU_INCOMPATIBLE_GL_VERSION = 100903

Const GLU_VERSION = 100800
Const GLU_EXTENSIONS = 100801

'Const GLU_TRUE = GL_TRUE
'Const GLU_FALSE = GL_FALSE

Const GLU_SMOOTH = 100000
Const GLU_FLAT = 100001
Const GLU_NONE = 100002

Const GLU_POINT = 100010
Const GLU_LINE = 100011
Const GLU_FILL = 100012
Const GLU_SILHOUETTE = 100013

Const GLU_OUTSIDE = 100020
Const GLU_INSIDE = 100021

Const GLU_TESS_MAX_COORD = 1.0e150

Const GLU_TESS_WINDING_RULE = 100140
Const GLU_TESS_BOUNDARY_ONLY = 100141
Const GLU_TESS_TOLERANCE = 100142

Const GLU_TESS_WINDING_ODD = 100130
Const GLU_TESS_WINDING_NONZERO = 100131
Const GLU_TESS_WINDING_POSITIVE = 100132
Const GLU_TESS_WINDING_NEGATIVE = 100133
Const GLU_TESS_WINDING_ABS_GEQ_TWO = 100134

Const GLU_TESS_BEGIN = 100100
Const GLU_TESS_VERTEX = 100101
Const GLU_TESS_END = 100102
Const GLU_TESS_ERROR = 100103
Const GLU_TESS_EDGE_FLAG = 100104
Const GLU_TESS_COMBINE = 100105
Const GLU_TESS_BEGIN_DATA = 100106
Const GLU_TESS_VERTEX_DATA = 100107
Const GLU_TESS_END_DATA = 100108
Const GLU_TESS_ERROR_DATA = 100109
Const GLU_TESS_EDGE_FLAG_DATA = 100110
Const GLU_TESS_COMBINE_DATA = 100111

Const GLU_TESS_ERROR1 = 100151
Const GLU_TESS_ERROR2 = 100152
Const GLU_TESS_ERROR3 = 100153
Const GLU_TESS_ERROR4 = 100154
Const GLU_TESS_ERROR5 = 100155
Const GLU_TESS_ERROR6 = 100156
Const GLU_TESS_ERROR7 = 100157
Const GLU_TESS_ERROR8 = 100158

Const GLU_TESS_MISSING_BEGIN_POLYGON = GLU_TESS_ERROR1
Const GLU_TESS_MISSING_BEGIN_CONTOUR = GLU_TESS_ERROR2
Const GLU_TESS_MISSING_END_POLYGON = GLU_TESS_ERROR3
Const GLU_TESS_MISSING_END_CONTOUR = GLU_TESS_ERROR4
Const GLU_TESS_COORD_TOO_LARGE = GLU_TESS_ERROR5
Const GLU_TESS_NEED_COMBINE_CALLBACK = GLU_TESS_ERROR6

Const GLU_AUTO_LOAD_MATRIX = 100200
Const GLU_CULLING = 100201
Const GLU_SAMPLING_TOLERANCE = 100203
Const GLU_DISPLAY_MODE = 100204
Const GLU_PARAMETRIC_TOLERANCE = 100202
Const GLU_SAMPLING_METHOD = 100205
Const GLU_U_STEP = 100206
Const GLU_V_STEP = 100207

Const GLU_PATH_LENGTH = 100215
Const GLU_PARAMETRIC_ERROR = 100216
Const GLU_DOMAIN_DISTANCE = 100217

Const GLU_MAP1_TRIM_2 = 100210
Const GLU_MAP1_TRIM_3 = 100211

Const GLU_OUTLINE_POLYGON = 100240
Const GLU_OUTLINE_PATCH = 100241

Const GLU_NURBS_ERROR1 = 100251
Const GLU_NURBS_ERROR2 = 100252
Const GLU_NURBS_ERROR3 = 100253
Const GLU_NURBS_ERROR4 = 100254
Const GLU_NURBS_ERROR5 = 100255
Const GLU_NURBS_ERROR6 = 100256
Const GLU_NURBS_ERROR7 = 100257
Const GLU_NURBS_ERROR8 = 100258
Const GLU_NURBS_ERROR9 = 100259
Const GLU_NURBS_ERROR10 = 100260
Const GLU_NURBS_ERROR11 = 100261
Const GLU_NURBS_ERROR12 = 100262
Const GLU_NURBS_ERROR13 = 100263
Const GLU_NURBS_ERROR14 = 100264
Const GLU_NURBS_ERROR15 = 100265
Const GLU_NURBS_ERROR16 = 100266
Const GLU_NURBS_ERROR17 = 100267
Const GLU_NURBS_ERROR18 = 100268
Const GLU_NURBS_ERROR19 = 100269
Const GLU_NURBS_ERROR20 = 100270
Const GLU_NURBS_ERROR21 = 100271
Const GLU_NURBS_ERROR22 = 100272
Const GLU_NURBS_ERROR23 = 100273
Const GLU_NURBS_ERROR24 = 100274
Const GLU_NURBS_ERROR25 = 100275
Const GLU_NURBS_ERROR26 = 100276
Const GLU_NURBS_ERROR27 = 100277
Const GLU_NURBS_ERROR28 = 100278
Const GLU_NURBS_ERROR29 = 100279
Const GLU_NURBS_ERROR30 = 100280
Const GLU_NURBS_ERROR31 = 100281
Const GLU_NURBS_ERROR32 = 100282
Const GLU_NURBS_ERROR33 = 100283
Const GLU_NURBS_ERROR34 = 100284
Const GLU_NURBS_ERROR35 = 100285
Const GLU_NURBS_ERROR36 = 100286
Const GLU_NURBS_ERROR37 = 100287

Declare Sub gluBeginPolygon Lib "glu32" (tess As *GLUtesselator)
Declare Sub gluNextContour Lib "glu32" (tess As *GLUtesselator, type_ As GLenum)
Declare Sub gluEndPolygon Lib "glu32" (tess As *GLUtesselator)

Const GLU_CW = 100120
Const GLU_CCW = 100121
Const GLU_INTERIOR = 100122
Const GLU_EXTERIOR = 100123
Const GLU_UNKNOWN = 100124

Const GLU_BEGIN = GLU_TESS_BEGIN
Const GLU_VERTEX = GLU_TESS_VERTEX
Const GLU_END = GLU_TESS_END
Const GLU_ERROR = GLU_TESS_ERROR
Const GLU_EDGE_FLAG = GLU_TESS_EDGE_FLAG

#endif '_INC_GLU
