40 #ifndef GEOGRAM_GFX_GLUP_GLUP
41 #define GEOGRAM_GFX_GLUP_GLUP
44 #define GLUP_API GEOGRAM_GFX_API
60 typedef float GLUPfloat;
61 typedef double GLUPdouble;
63 typedef unsigned int GLUPuint;
64 typedef int GLUPsizei;
65 typedef unsigned int GLUPenum;
66 typedef unsigned long int GLUPuint64;
67 typedef void GLUPvoid;
68 typedef int GLUPbitfield;
71 GLUP_FALSE=0, GLUP_TRUE = 1
74 typedef unsigned char GLUPboolean;
147 GLUP_VERTEX_COLORS =1,
151 GLUP_INDIRECT_TEXTURING =5,
152 GLUP_VERTEX_NORMALS =6,
154 GLUP_ALPHA_DISCARD =8,
155 GLUP_NORMAL_MAPPING =9,
156 GLUP_PRIMITIVE_FILTERING =10
159 void GLUP_API glupEnable(GLUPtoggle toggle);
160 void GLUP_API glupDisable(GLUPtoggle toggle);
161 GLUPboolean GLUP_API glupIsEnabled(GLUPtoggle toggle);
184 GLUP_TEXTURE_1D_UNIT=0,
185 GLUP_TEXTURE_2D_UNIT=1,
186 GLUP_TEXTURE_3D_UNIT=2,
187 GLUP_TEXTURE_PRIMITIVE_FILTERING_UNIT=3
199 GLUP_TEXTURE_1D_TARGET=0x0DE1,
200 GLUP_TEXTURE_2D_TARGET=0x0DE1,
201 GLUP_TEXTURE_3D_TARGET=0x806F
210 void GLUP_API glupTextureType(GLUPtextureType type);
211 GLUPtextureType GLUP_API glupGetTextureType(
void);
214 GLUP_TEXTURE_REPLACE=0,
215 GLUP_TEXTURE_MODULATE=1,
219 void GLUP_API glupTextureMode(GLUPtextureMode mode);
220 GLUPtextureMode GLUP_API glupGetTextureMode(
void);
239 GLUP_FRONT_AND_BACK_COLOR=3
242 void GLUP_API glupSetColor4fv(GLUPcolor color,
const GLUPfloat* rgba);
243 void GLUP_API glupGetColor4fv(GLUPcolor color,
float* rgba);
245 void GLUP_API glupSetColor3fv(GLUPcolor color,
const GLUPfloat* rgba);
246 void GLUP_API glupSetColor4f(
247 GLUPcolor color, GLUPfloat r, GLUPfloat g, GLUPfloat b, GLUPfloat a
249 void GLUP_API glupSetColor3f(
250 GLUPcolor color, GLUPfloat r, GLUPfloat g, GLUPfloat b
252 void GLUP_API glupSetColor4dv(GLUPcolor color,
const GLUPdouble* rgba);
253 void GLUP_API glupSetColor3dv(GLUPcolor color,
const GLUPdouble* rgba);
254 void GLUP_API glupSetColor4d(
255 GLUPcolor color, GLUPdouble r, GLUPdouble g, GLUPdouble b, GLUPdouble a
257 void GLUP_API glupSetColor3d(
258 GLUPcolor color, GLUPdouble r, GLUPdouble g, GLUPdouble b
261 void GLUP_API glupLightVector3f(GLUPfloat x, GLUPfloat y, GLUPfloat z);
262 void GLUP_API glupLightVector3fv(GLUPfloat* xyz);
263 void GLUP_API glupGetLightVector3fv(GLUPfloat* xyz);
265 void GLUP_API glupSetPointSize(GLUPfloat size);
266 GLUPfloat GLUP_API glupGetPointSize(
void);
268 void GLUP_API glupSetMeshWidth(GLUPint width);
269 GLUPint GLUP_API glupGetMeshWidth(
void);
271 void GLUP_API glupSetCellsShrink(GLUPfloat x);
272 GLUPfloat GLUP_API glupGetCellsShrink(
void);
274 void GLUP_API glupSetAlphaThreshold(GLUPfloat x);
275 GLUPfloat GLUP_API glupGetAlphaThreshold(
void);
277 void GLUP_API glupSetSpecular(GLUPfloat x);
278 GLUPfloat GLUP_API glupGetSpecular(
void);
292 GLUP_PICK_PRIMITIVE=1,
296 void GLUP_API glupPickingMode(GLUPpickingMode mode);
297 GLUPpickingMode GLUP_API glupGetPickingMode(
void);
299 void GLUP_API glupPickingId(GLUPuint64
id);
300 GLUPuint64 GLUP_API glupGetPickingId(
void);
302 void GLUP_API glupBasePickingId(GLUPuint64
id);
303 GLUPuint64 GLUP_API glupGetBasePickingId(
void);
317 GLUP_CLIP_STANDARD=0,
318 GLUP_CLIP_WHOLE_CELLS=1,
319 GLUP_CLIP_STRADDLING_CELLS=2,
320 GLUP_CLIP_SLICE_CELLS=3
367 GLUP_MODELVIEW_MATRIX = 0,
368 GLUP_PROJECTION_MATRIX = 1,
369 GLUP_TEXTURE_MATRIX = 2
372 void GLUP_API glupMatrixMode(GLUPmatrix matrix);
373 GLUPmatrix GLUP_API glupGetMatrixMode(
void);
374 void GLUP_API glupPushMatrix(
void);
375 void GLUP_API glupPopMatrix(
void);
395 void GLUP_API glupLoadIdentity(
void);
396 void GLUP_API glupLoadMatrixf(
const GLUPfloat* M);
397 void GLUP_API glupLoadMatrixd(
const GLUPdouble* M);
398 void GLUP_API glupMultMatrixf(
const GLUPfloat* M);
399 void GLUP_API glupMultMatrixd(
const GLUPdouble* M);
400 void GLUP_API glupTranslatef(GLUPfloat x, GLUPfloat y, GLUPfloat z);
401 void GLUP_API glupTranslated(GLUPdouble x, GLUPdouble y, GLUPdouble z);
402 void GLUP_API glupScalef(GLUPfloat sx, GLUPfloat sy, GLUPfloat sz);
403 void GLUP_API glupScaled(GLUPdouble sx, GLUPdouble sy, GLUPdouble sz);
404 void GLUP_API glupRotatef(
405 GLUPfloat
angle, GLUPfloat x, GLUPfloat y, GLUPfloat z
407 void GLUP_API glupRotated(
408 GLUPdouble
angle, GLUPdouble x, GLUPdouble y, GLUPdouble z
410 void GLUP_API glupOrtho(
411 GLUPdouble left, GLUPdouble right,
412 GLUPdouble bottom, GLUPdouble top,
413 GLUPdouble nearVal, GLUPdouble farVal
415 void GLUP_API glupOrtho2D(
416 GLUPdouble left, GLUPdouble right, GLUPdouble bottom, GLUPdouble top
418 void GLUP_API glupFrustum(
419 GLUPdouble left, GLUPdouble right,
420 GLUPdouble bottom, GLUPdouble top,
421 GLUPdouble nearVal, GLUPdouble farVal
423 void GLUP_API glupPerspective(
424 GLUPdouble fovy, GLUPdouble aspect,
425 GLUPdouble zNear, GLUPdouble zFar
428 GLUPint GLUP_API glupProject(
429 GLUPdouble objx, GLUPdouble objy, GLUPdouble objz,
430 const GLUPdouble modelMatrix[16],
431 const GLUPdouble projMatrix[16],
432 const GLUPint viewport[4],
433 GLUPdouble* winx, GLUPdouble* winy, GLUPdouble* winz
436 GLUPboolean GLUP_API glupUnProject(
437 GLUPdouble winx, GLUPdouble winy, GLUPdouble winz,
438 const GLUPdouble modelMatrix[16],
439 const GLUPdouble projMatrix[16],
440 const GLUPint viewport[4],
441 GLUPdouble *objx, GLUPdouble *objy, GLUPdouble *objz
444 GLUPboolean GLUP_API glupInvertMatrixfv(
445 GLUPfloat Minvert[16],
446 const GLUPfloat M[16]
449 GLUPboolean GLUP_API glupInvertMatrixdv(
450 GLUPdouble Minvert[16],
451 const GLUPdouble M[16]
481 GLUP_RESERVED_PRIMITIVE_1 = 10,
482 GLUP_NB_PRIMITIVES = 11
495 void GLUP_API glupDrawArrays(
499 void GLUP_API glupDrawElements(
501 GLUPenum type,
const GLUPvoid* indices
505 void GLUP_API glupEnd(
void);
507 void GLUP_API glupVertex2fv(
const GLUPfloat* xy);
508 void GLUP_API glupVertex3fv(
const GLUPfloat* xyz);
509 void GLUP_API glupVertex4fv(
const GLUPfloat* xyzw);
511 void GLUP_API glupVertex2dv(
const GLUPdouble* xy);
512 void GLUP_API glupVertex3dv(
const GLUPdouble* xyz);
513 void GLUP_API glupVertex4dv(
const GLUPdouble* xyzw);
515 void GLUP_API glupVertex2f(GLUPfloat x, GLUPfloat y);
516 void GLUP_API glupVertex3f(GLUPfloat x, GLUPfloat y, GLUPfloat z);
517 void GLUP_API glupVertex4f(
518 GLUPfloat x, GLUPfloat y, GLUPfloat z, GLUPfloat w
521 void GLUP_API glupVertex2d(GLUPdouble x, GLUPdouble y);
522 void GLUP_API glupVertex3d(GLUPdouble x, GLUPdouble y, GLUPdouble z);
523 void GLUP_API glupVertex4d(
524 GLUPdouble x, GLUPdouble y, GLUPdouble z, GLUPdouble w
527 void GLUP_API glupColor3fv(
const GLUPfloat* rgb);
528 void GLUP_API glupColor4fv(
const GLUPfloat* rgba);
530 void GLUP_API glupColor3dv(
const GLUPdouble* rgb);
531 void GLUP_API glupColor4dv(
const GLUPdouble* rgba);
533 void GLUP_API glupColor3f(GLUPfloat r, GLUPfloat g, GLUPfloat b);
534 void GLUP_API glupColor4f(
535 GLUPfloat r, GLUPfloat g, GLUPfloat b, GLUPfloat a
538 void GLUP_API glupColor3d(GLUPdouble r, GLUPdouble g, GLUPdouble b);
539 void GLUP_API glupColor4d(
540 GLUPdouble r, GLUPdouble g, GLUPdouble b, GLUPdouble a
543 void GLUP_API glupTexCoord2fv(
const GLUPfloat* st);
544 void GLUP_API glupTexCoord3fv(
const GLUPfloat* stu);
545 void GLUP_API glupTexCoord4fv(
const GLUPfloat* stuv);
547 void GLUP_API glupTexCoord2dv(
const GLUPdouble* st);
548 void GLUP_API glupTexCoord3dv(
const GLUPdouble* stu);
549 void GLUP_API glupTexCoord4dv(
const GLUPdouble* stuv);
551 void GLUP_API glupTexCoord1f(GLUPfloat s);
552 void GLUP_API glupTexCoord2f(GLUPfloat s, GLUPfloat t);
553 void GLUP_API glupTexCoord3f(GLUPfloat s, GLUPfloat t, GLUPfloat u);
554 void GLUP_API glupTexCoord4f(
555 GLUPfloat s, GLUPfloat t, GLUPfloat u, GLUPfloat v
558 void GLUP_API glupTexCoord1d(GLUPdouble s);
559 void GLUP_API glupTexCoord2d(GLUPdouble s, GLUPdouble t);
560 void GLUP_API glupTexCoord3d(GLUPdouble s, GLUPdouble t, GLUPdouble u);
561 void GLUP_API glupTexCoord4d(
562 GLUPdouble s, GLUPdouble t, GLUPdouble u, GLUPdouble v
566 void GLUP_API glupNormal3fv(GLUPfloat* xyz);
567 void GLUP_API glupNormal3f(GLUPfloat x, GLUPfloat y, GLUPfloat z);
569 void GLUP_API glupNormal3dv(GLUPdouble* xyz);
570 void GLUP_API glupNormal3d(GLUPdouble x, GLUPdouble y, GLUPdouble z);
void GLUP_API glupGetMatrixdv(GLUPmatrix matrix, GLUPdouble *ptr)
Queries a GLUP matrix.
GLUPcontext GLUP_API glupCreateContext(void)
Creates a new GLUP context.
GLUP_API const char * glupUniformStateDeclaration(void)
Gets the GLSL declaration of GLUP uniform state.
void GLUP_API glupGetMatrixfv(GLUPmatrix matrix, GLUPfloat *ptr)
Queries a GLUP matrix.
void GLUP_API glupMakeCurrent(GLUPcontext context)
Makes a GLUP context the current one.
GLUPclipMode GLUP_API glupGetClipMode(void)
Gets the clipping mode.
void GLUP_API glupBindUniformState(GLUPuint program)
Binds the GLUP uniform state to a program.
GLUPboolean GLUP_API glupPrimitiveSupportsArrayMode(GLUPprimitive prim)
Tests whether a given GLUP primitive supports array mode.
GLUPuint GLUP_API glupGetVertexArrayBinding(void)
Gets the name of the bound vertex array object.
void GLUP_API glupDeleteVertexArrays(GLUPsizei n, const GLUPuint *arrays)
Deletes vertex array objects.
void GLUP_API glupClipMode(GLUPclipMode mode)
Sets the current clipping mode.
void GLUP_API glupDeleteContext(GLUPcontext context)
Deletes a GLUP context.
void GLUP_API glupClipPlane(const GLUPdouble *eqn)
Defines the plane used by GLUP clipping.
void GLUP_API glupUseProgram(GLUPuint program)
Specifies a GLSL program to be used for drawing the primitives.
GLUP_API GLUPuint glupCompileProgram(const char *source)
Compiles a GLSL program.
void GLUP_API glupGenVertexArrays(GLUPsizei n, GLUPuint *arrays)
Generate vertex array object names.
void GLUP_API glupGetClipPlane(GLUPdouble *eqn)
Gets the current clipping plane.
GLUPcontext GLUP_API glupCurrentContext(void)
Gets the current GLUP context.
void GLUP_API glupBindVertexArray(GLUPuint array)
Binds a vertex array object.
GLUP_API GLUPuint glupCompileShader(GLUPenum target, GLUPprimitive primitive, const char *source)
Compiles a GLSL shader.
void * GLUPcontext
Opaque identifier of a GLUP context.
GLUP_API const char * glupCurrentProfileName(void)
The name of the profile implemented by the current context.
GLUPprimitive
Symbolic values corresponding to GLUP primitive types.
Basic definitions for the Geogram C API.
double angle(const vec3 &a, const vec3 &b)
Computes the angle between two 3d vectors.