PageRenderTime 32ms CodeModel.GetById 7ms app.highlight 21ms RepoModel.GetById 1ms app.codeStats 0ms

/binding/opengl/glu.d

http://github.com/wilkie/djehuty
D | 339 lines | 193 code | 101 blank | 45 comment | 0 complexity | 38ce4ef1124d2ef0cdb5d590122e32fe MD5 | raw file
  1/*
  2 * glu.d
  3 *
  4 * This module contains bindings for opengl and was adapted from GLU.h
  5 *
  6 * Author: Dave Wilkinson
  7 *
  8 */
  9
 10module binding.opengl.glu;
 11
 12import binding.opengl.gl;
 13
 14// The functions supported by opengl
 15
 16extern (System) {
 17	extern(C) struct GLUnurbs;
 18	extern(C) struct GLUquadric;
 19	extern(C) struct GLUtesselator;
 20
 21	/****           Backwards compatibility for old tesselator           ****/
 22
 23	void  gluBeginPolygon(GLUtesselator *tess);
 24	void  gluNextContour(GLUtesselator *tess, GLenum type);
 25	void  gluEndPolygon(GLUtesselator *tess);
 26
 27	GLubyte * gluErrorString(GLenum errCode);
 28	 //wchar_t*  gluErrorUnicodeStringEXT (
 29	 //   GLenum   errCode);
 30	GLubyte * gluGetString(GLenum name);
 31	void  gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);
 32	void  gluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
 33	void  gluPickMatrix(GLdouble x, GLdouble y, GLdouble width, GLdouble height, GLint *viewport);
 34	void  gluLookAt(GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx, GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy, GLdouble upz);
 35	int  gluProject(GLdouble objx, GLdouble objy, GLdouble objz, GLdouble *modelMatrix, GLdouble *projMatrix, GLint *viewport, GLdouble *winx, GLdouble *winy, GLdouble *winz);
 36	int  gluUnProject(GLdouble winx, GLdouble winy, GLdouble winz, GLdouble *modelMatrix, GLdouble *projMatrix, GLint *viewport, GLdouble *objx, GLdouble *objy, GLdouble *objz);
 37
 38	int  gluScaleImage(GLenum format, GLint widthin, GLint heightin, GLenum typein, void *datain, GLint widthout, GLint heightout, GLenum typeout, void *dataout);
 39
 40	int  gluBuild1DMipmaps(GLenum target, GLint components, GLint width, GLenum format, GLenum type, void *data);
 41	int  gluBuild2DMipmaps(GLenum target, GLint components, GLint width, GLint height, GLenum format, GLenum type, void *data);
 42}
 43
 44extern (System):
 45
 46/* backwards compatibility: */
 47
 48
 49
 50/* backwards compatibility: */
 51alias GLUnurbs GLUnurbsObj;
 52alias GLUquadric GLUquadricObj;
 53alias GLUtesselator GLUtesselatorObj;
 54alias GLUtesselator GLUtriangulatorObj;
 55
 56
 57
 58GLUquadric * gluNewQuadric();
 59void  gluDeleteQuadric(GLUquadric *state);
 60
 61void  gluQuadricNormals(GLUquadric *quadObject, GLenum normals);
 62
 63void  gluQuadricTexture(GLUquadric *quadObject, GLboolean textureCoords);
 64
 65void  gluQuadricOrientation(GLUquadric *quadObject, GLenum orientation);
 66
 67void  gluQuadricDrawStyle(GLUquadric *quadObject, GLenum drawStyle);
 68
 69void  gluCylinder(GLUquadric *qobj, GLdouble baseRadius, GLdouble topRadius, GLdouble height, GLint slices, GLint stacks);
 70
 71void  gluDisk(GLUquadric *qobj, GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops);
 72
 73void  gluPartialDisk(GLUquadric *qobj, GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops, GLdouble startAngle, GLdouble sweepAngle);
 74
 75void  gluSphere(GLUquadric *qobj, GLdouble radius, GLint slices, GLint stacks);
 76
 77void  gluQuadricCallback(GLUquadric *qobj, GLenum which, void function()fn);
 78
 79GLUtesselator * gluNewTess();
 80
 81void  gluDeleteTess(GLUtesselator *tess);
 82
 83void  gluTessBeginPolygon(GLUtesselator *tess, void *polygon_data);
 84
 85void  gluTessBeginContour(GLUtesselator *tess);
 86
 87void  gluTessVertex(GLUtesselator *tess, GLdouble *coords, void *data);
 88
 89void  gluTessEndContour(GLUtesselator *tess);
 90
 91void  gluTessEndPolygon(GLUtesselator *tess);
 92
 93void  gluTessProperty(GLUtesselator *tess, GLenum which, GLdouble value);
 94
 95void  gluTessNormal(GLUtesselator *tess, GLdouble x, GLdouble y, GLdouble z);
 96
 97void  gluTessCallback(GLUtesselator *tess, GLenum which, void function()fn);
 98
 99void  gluGetTessProperty(GLUtesselator *tess, GLenum which, GLdouble *value);
100
101GLUnurbs * gluNewNurbsRenderer();
102
103void  gluDeleteNurbsRenderer(GLUnurbs *nobj);
104
105void  gluBeginSurface(GLUnurbs *nobj);
106
107void  gluBeginCurve(GLUnurbs *nobj);
108
109void  gluEndCurve(GLUnurbs *nobj);
110
111void  gluEndSurface(GLUnurbs *nobj);
112
113void  gluBeginTrim(GLUnurbs *nobj);
114
115void  gluEndTrim(GLUnurbs *nobj);
116
117void  gluPwlCurve(GLUnurbs *nobj, GLint count, GLfloat *array, GLint stride, GLenum type);
118
119void  gluNurbsCurve(GLUnurbs *nobj, GLint nknots, GLfloat *knot, GLint stride, GLfloat *ctlarray, GLint order, GLenum type);
120
121void  gluNurbsSurface(GLUnurbs *nobj, GLint sknot_count, float *sknot, GLint tknot_count, GLfloat *tknot, GLint s_stride, GLint t_stride, GLfloat *ctlarray, GLint sorder, GLint torder, GLenum type);
122
123void  gluLoadSamplingMatrices(GLUnurbs *nobj, GLfloat *modelMatrix, GLfloat *projMatrix, GLint *viewport);
124
125void  gluNurbsProperty(GLUnurbs *nobj, GLenum property, GLfloat value);
126
127void  gluGetNurbsProperty(GLUnurbs *nobj, GLenum property, GLfloat *value);
128
129void  gluNurbsCallback(GLUnurbs *nobj, GLenum which, void  function()fn);
130
131
132/****           Callback function prototypes    ****/
133
134/* gluQuadricCallback */
135alias void  function(GLenum )GLUquadricErrorProc;
136
137/* gluTessCallback */
138alias void  function(GLenum )GLUtessBeginProc;
139alias void  function(GLboolean )GLUtessEdgeFlagProc;
140alias void  function(void *)GLUtessVertexProc;
141alias void  function()GLUtessEndProc;
142alias void  function(GLenum )GLUtessErrorProc;
143alias void  function(GLdouble *, void **, GLfloat *, void **)GLUtessCombineProc;
144alias void  function(GLenum , void *)GLUtessBeginDataProc;
145alias void  function(GLboolean , void *)GLUtessEdgeFlagDataProc;
146alias void  function(void *, void *)GLUtessVertexDataProc;
147alias void  function(void *)GLUtessEndDataProc;
148alias void  function(GLenum , void *)GLUtessErrorDataProc;
149alias void  function(GLdouble *, void **, GLfloat *, void **, void *)GLUtessCombineDataProc;
150
151/* gluNurbsCallback */
152alias void  function(GLenum )GLUnurbsErrorProc;
153
154
155/****           Generic ants               ****/
156
157/* Version */
158const GLU_VERSION_1_1 = 1;
159
160const GLU_VERSION_1_2 = 1;
161/* Errors: (return value 0 = no error) */
162const GLU_INVALID_ENUM = 100900;
163const GLU_INVALID_VALUE = 100901;
164const GLU_OUT_OF_MEMORY = 100902;
165
166const GLU_INCOMPATIBLE_GL_VERSION = 100903;
167/* StringName */
168const GLU_VERSION = 100800;
169
170const GLU_EXTENSIONS = 100801;
171/* Boolean */
172alias GL_TRUE GLU_TRUE;
173
174alias GL_FALSE GLU_FALSE;
175
176/****           Quadric ants               ****/
177
178/* QuadricNormal */
179const GLU_SMOOTH = 100000;
180const GLU_FLAT = 100001;
181
182const GLU_NONE = 100002;
183/* QuadricDrawStyle */
184const GLU_POINT = 100010;
185const GLU_LINE = 100011;
186const GLU_FILL = 100012;
187
188const GLU_SILHOUETTE = 100013;
189/* QuadricOrientation */
190const GLU_OUTSIDE = 100020;
191
192const GLU_INSIDE = 100021;
193/* Callback types: */
194/*      GLU_ERROR               100103 */
195
196
197/****           Tesselation ants           ****/
198
199
200const GLU_TESS_MAX_COORD = 1.0e150;
201/* TessProperty */
202const GLU_TESS_WINDING_RULE = 100140;
203const GLU_TESS_BOUNDARY_ONLY = 100141;
204
205const GLU_TESS_TOLERANCE = 100142;
206/* TessWinding */
207const GLU_TESS_WINDING_ODD = 100130;
208const GLU_TESS_WINDING_NONZERO = 100131;
209const GLU_TESS_WINDING_POSITIVE = 100132;
210const GLU_TESS_WINDING_NEGATIVE = 100133;
211
212const GLU_TESS_WINDING_ABS_GEQ_TWO = 100134;
213/* TessCallback */
214const GLU_TESS_BEGIN = 100100;
215const GLU_TESS_VERTEX = 100101;
216const GLU_TESS_END = 100102;
217const GLU_TESS_ERROR = 100103;
218const GLU_TESS_EDGE_FLAG = 100104;
219
220const GLU_TESS_COMBINE = 100105;
221
222
223
224const GLU_TESS_BEGIN_DATA = 100106;
225
226const GLU_TESS_VERTEX_DATA = 100107;
227const GLU_TESS_END_DATA = 100108;
228
229const GLU_TESS_ERROR_DATA = 100109;
230
231const GLU_TESS_EDGE_FLAG_DATA = 100110;
232
233const GLU_TESS_COMBINE_DATA = 100111;
234
235
236
237
238/* TessError */
239const GLU_TESS_ERROR1 = 100151;
240const GLU_TESS_ERROR2 = 100152;
241const GLU_TESS_ERROR3 = 100153;
242const GLU_TESS_ERROR4 = 100154;
243const GLU_TESS_ERROR5 = 100155;
244const GLU_TESS_ERROR6 = 100156;
245const GLU_TESS_ERROR7 = 100157;
246
247const GLU_TESS_ERROR8 = 100158;
248alias GLU_TESS_ERROR1 GLU_TESS_MISSING_BEGIN_POLYGON;
249alias GLU_TESS_ERROR2 GLU_TESS_MISSING_BEGIN_CONTOUR;
250alias GLU_TESS_ERROR3 GLU_TESS_MISSING_END_POLYGON;
251alias GLU_TESS_ERROR4 GLU_TESS_MISSING_END_CONTOUR;
252alias GLU_TESS_ERROR5 GLU_TESS_COORD_TOO_LARGE;
253
254alias GLU_TESS_ERROR6 GLU_TESS_NEED_COMBINE_;
255/****           NURBS ants                 ****/
256
257/* NurbsProperty */
258const GLU_AUTO_LOAD_MATRIX = 100200;
259const GLU_CULLING = 100201;
260const GLU_SAMPLING_TOLERANCE = 100203;
261const GLU_DISPLAY_MODE = 100204;
262const GLU_PARAMETRIC_TOLERANCE = 100202;
263const GLU_SAMPLING_METHOD = 100205;
264const GLU_U_STEP = 100206;
265
266const GLU_V_STEP = 100207;
267/* NurbsSampling */
268const GLU_PATH_LENGTH = 100215;
269const GLU_PARAMETRIC_ERROR = 100216;
270
271const GLU_DOMAIN_DISTANCE = 100217;
272
273/* NurbsTrim */
274const GLU_MAP1_TRIM_2 = 100210;
275
276const GLU_MAP1_TRIM_3 = 100211;
277/* NurbsDisplay */
278/*      GLU_FILL                100012 */
279const GLU_OUTLINE_POLYGON = 100240;
280
281const GLU_OUTLINE_PATCH = 100241;
282/* NurbsCallback */
283/*      GLU_ERROR               100103 */
284
285/* NurbsErrors */
286const GLU_NURBS_ERROR1 = 100251;
287const GLU_NURBS_ERROR2 = 100252;
288const GLU_NURBS_ERROR3 = 100253;
289const GLU_NURBS_ERROR4 = 100254;
290const GLU_NURBS_ERROR5 = 100255;
291const GLU_NURBS_ERROR6 = 100256;
292const GLU_NURBS_ERROR7 = 100257;
293const GLU_NURBS_ERROR8 = 100258;
294const GLU_NURBS_ERROR9 = 100259;
295const GLU_NURBS_ERROR10 = 100260;
296const GLU_NURBS_ERROR11 = 100261;
297const GLU_NURBS_ERROR12 = 100262;
298const GLU_NURBS_ERROR13 = 100263;
299const GLU_NURBS_ERROR14 = 100264;
300const GLU_NURBS_ERROR15 = 100265;
301const GLU_NURBS_ERROR16 = 100266;
302const GLU_NURBS_ERROR17 = 100267;
303const GLU_NURBS_ERROR18 = 100268;
304const GLU_NURBS_ERROR19 = 100269;
305const GLU_NURBS_ERROR20 = 100270;
306const GLU_NURBS_ERROR21 = 100271;
307const GLU_NURBS_ERROR22 = 100272;
308const GLU_NURBS_ERROR23 = 100273;
309const GLU_NURBS_ERROR24 = 100274;
310const GLU_NURBS_ERROR25 = 100275;
311const GLU_NURBS_ERROR26 = 100276;
312const GLU_NURBS_ERROR27 = 100277;
313const GLU_NURBS_ERROR28 = 100278;
314const GLU_NURBS_ERROR29 = 100279;
315const GLU_NURBS_ERROR30 = 100280;
316const GLU_NURBS_ERROR31 = 100281;
317const GLU_NURBS_ERROR32 = 100282;
318const GLU_NURBS_ERROR33 = 100283;
319const GLU_NURBS_ERROR34 = 100284;
320const GLU_NURBS_ERROR35 = 100285;
321const GLU_NURBS_ERROR36 = 100286;
322
323const GLU_NURBS_ERROR37 = 100287;
324
325/* Contours types -- obsolete! */
326const GLU_CW = 100120;
327const GLU_CCW = 100121;
328const GLU_INTERIOR = 100122;
329const GLU_EXTERIOR = 100123;
330
331const GLU_UNKNOWN = 100124;
332/* Names without "TESS_" prefix */
333alias GLU_TESS_BEGIN GLU_BEGIN;
334alias GLU_TESS_VERTEX GLU_VERTEX;
335alias GLU_TESS_END GLU_END;
336alias GLU_TESS_ERROR GLU_ERROR;
337
338alias GLU_TESS_EDGE_FLAG GLU_EDGE_FLAG;
339