/* * $Id: displaylists.h 160 2007-11-03 14:40:28Z hderuiter $ * * $Date$ * $Revision: 000 $ * * (C) 2007 by Hans de Ruiter * All rights reserved * * This file is part of the MiniGL library project * See the file Licence.txt for more details * */ #ifndef __DISPLAYLISTS_H__ #define __DISPLAYLISTS_H__ #include "sysinc.h" #include "mgl/gl.h" /** Returns true if compiling a display list is active, i.e., we are between * glNewList()nd glEndList() calls. */ static inline BOOL dl_IsDLActive(struct GLContextIFace *Self) { GLcontext context = GET_INSTANCE(Self); return (context->TargetDisplayListStart != NULL); } /** Returns true if compile mode is set to GL_COMPILE_AND_EXECUTE (i.e., need to continue with * execution of the function called) */ static inline BOOL dl_CompileAndExecuteMode(struct GLContextIFace *Self) { GLcontext context = GET_INSTANCE(Self); return (context->DisplayListCompileMode == GL_COMPILE_AND_EXECUTE); } extern void dl_save_ActiveTexture(struct GLContextIFace *Self, GLenum unit); extern void dl_save_AlphaFunc(struct GLContextIFace *Self, GLenum func, GLclampf ref); extern void dl_save_BlendFunc(struct GLContextIFace *Self, GLenum sfactor, GLenum dfactor); extern void dl_save_Begin(struct GLContextIFace *Self, GLenum mode); extern void dl_save_BindTexture(struct GLContextIFace *Self, GLenum target, GLuint texture); extern void dl_save_Bitmap( struct GLContextIFace *Self, GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLvoid *bitmap ); extern void dl_save_CallList(struct GLContextIFace *Self, GLuint list); extern void dl_save_CallLists(struct GLContextIFace *Self, GLsizei n, GLenum type, const GLvoid *lists); extern void dl_save_Clear(struct GLContextIFace *Self, GLbitfield mask); extern void dl_save_ClearColor(struct GLContextIFace *Self, GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); extern void dl_save_ClearDepth(struct GLContextIFace *Self, GLclampd depth); extern void dl_save_ClearStencil(struct GLContextIFace *Self, GLint s); extern void dl_save_ClipPlane(struct GLContextIFace *Self, GLenum plane, const GLdouble *equ); extern void dl_save_Color4f(struct GLContextIFace *Self, GLfloat r, GLfloat g, GLfloat b, GLfloat a); extern void dl_save_ColorMask(struct GLContextIFace *Self, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); extern void dl_save_ColorMaterial(struct GLContextIFace *Self, GLenum face, GLenum mode); extern void dl_save_ColorTable( struct GLContextIFace *Self, GLenum target, GLenum internalformat, GLint width, GLenum format, GLenum type, const GLvoid* data ); extern void dl_save_CopyTexImage2D( struct GLContextIFace *Self, GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ); extern void dl_save_CopyTexSubImage2D( struct GLContextIFace *Self, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ); extern void dl_save_CullFace(struct GLContextIFace *Self, GLenum mode); extern void dl_save_DepthFunc(struct GLContextIFace *Self, GLenum func); extern void dl_save_DepthMask(struct GLContextIFace *Self, GLboolean mask); extern void dl_save_DepthRange(struct GLContextIFace *Self, GLclampd nearval, GLclampd farval); extern void dl_save_DrawArrays(struct GLContextIFace *Self, GLenum mode, GLint first, GLsizei count); extern void dl_save_DrawElements( struct GLContextIFace *Self, GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ); extern void dl_save_DrawBuffer(struct GLContextIFace *Self, GLenum mode); extern void dl_save_ReadBuffer(struct GLContextIFace *Self, GLenum mode); extern void dl_save_DrawPixels( struct GLContextIFace *Self,GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ); extern void dl_save_EdgeFlag(struct GLContextIFace *Self, GLboolean flag); extern void dl_save_End(struct GLContextIFace *Self); extern void dl_save_Fogf(struct GLContextIFace *Self, GLenum pname, GLfloat param); extern void dl_save_Fogfv(struct GLContextIFace *Self, GLenum pname, const GLfloat *params); extern void dl_save_FrontFace(struct GLContextIFace *Self, GLenum mode); extern void dl_save_Frustum( struct GLContextIFace *Self, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval ); extern void dl_save_Hint(struct GLContextIFace *Self, GLenum target, GLenum mode); extern void dl_save_Lightf(struct GLContextIFace *Self, GLenum light, GLenum pname, GLfloat param); extern void dl_save_Lightfv(struct GLContextIFace *Self, GLenum light, GLenum pname, const GLfloat *params); extern void dl_save_Lightiv(struct GLContextIFace *Self, GLenum light, GLenum pname, const GLint *params); extern void dl_save_LightModelf(struct GLContextIFace *Self, GLenum pname, GLfloat param); extern void dl_save_LightModelfv(struct GLContextIFace *Self, GLenum pname, const GLfloat *params); extern void dl_save_LightModeliv(struct GLContextIFace *Self, GLenum pname, const GLint *params); extern void dl_save_LineWidth(struct GLContextIFace *Self, GLfloat width); extern void dl_save_LineStipple(struct GLContextIFace *Self, GLint factor, GLushort pattern); extern void dl_save_ListBase(struct GLContextIFace *Self, GLuint base); extern void dl_save_LoadIdentity(struct GLContextIFace *Self); extern void dl_save_LoadMatrixf(struct GLContextIFace *Self, const GLfloat *m); extern void dl_save_LoadMatrixd(struct GLContextIFace *Self, const GLdouble *m); extern void dl_save_Materialf(struct GLContextIFace *Self, GLenum face, GLenum pname, GLfloat param); extern void dl_save_Materialfv(struct GLContextIFace *Self, GLenum face, GLenum pname, const GLfloat *params); extern void dl_save_Materialiv(struct GLContextIFace *Self, GLenum face, GLenum pname, const GLint *params); extern void dl_save_MatrixMode(struct GLContextIFace *Self, GLenum mode); extern void dl_save_MultiTexCoord2f(struct GLContextIFace *Self, GLenum target, GLfloat s, GLfloat t); extern void dl_save_MultiTexCoord4f(struct GLContextIFace *Self, GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); extern void dl_save_MultMatrixf(struct GLContextIFace *Self, const GLfloat *m); extern void dl_save_MultMatrixd(struct GLContextIFace *Self, const GLdouble *m); extern void dl_save_Normal3f(struct GLContextIFace *Self, GLfloat nx, GLfloat ny, GLfloat nz); extern void dl_save_Ortho( struct GLContextIFace *Self, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval ); extern void dl_save_PinTexture(struct GLContextIFace *Self, GLuint texnum); extern void dl_save_PointSize(struct GLContextIFace *Self, GLfloat size); extern void dl_save_PolygonMode(struct GLContextIFace *Self, GLenum face, GLenum mode); extern void dl_save_PolygonStipple(struct GLContextIFace *Self, const GLubyte *pattern); extern void dl_save_PolygonOffset(struct GLContextIFace *Self, GLfloat factor, GLfloat units); extern void dl_save_PopAttrib(struct GLContextIFace *Self); extern void dl_save_PopMatrix(struct GLContextIFace *Self); extern void dl_save_PushAttrib(struct GLContextIFace *Self, GLbitfield mask); extern void dl_save_PushMatrix(struct GLContextIFace *Self); extern void dl_save_RasterPos4f(struct GLContextIFace *Self, GLfloat x, GLfloat y, GLfloat z, GLfloat w); extern void dl_save_Rectf(struct GLContextIFace *Self, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); extern void dl_save_Rotatef(struct GLContextIFace *Self, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); extern void dl_save_Scalef(struct GLContextIFace *Self, GLfloat x, GLfloat y, GLfloat z); extern void dl_save_Scissor(struct GLContextIFace *Self, GLint x, GLint y, GLsizei width, GLsizei height); extern void dl_save_SetState(struct GLContextIFace *Self, GLenum cap, GLboolean flag); extern void dl_save_SetTextureRenderTarget(struct GLContextIFace *Self, GLuint texnum); extern void dl_save_SetZOffset(struct GLContextIFace *Self, GLfloat offset); extern void dl_save_ShadeModel(struct GLContextIFace *Self, GLenum mode); extern void dl_save_StencilFunc(struct GLContextIFace *Self, GLenum func, GLint ref, GLuint mask); extern void dl_save_StencilMask(struct GLContextIFace *Self, GLuint mask); extern void dl_save_StencilOp(struct GLContextIFace *Self, GLenum fail, GLenum zfail, GLenum zpass); extern void dl_save_TexCoord2f(struct GLContextIFace *Self, GLfloat s, GLfloat t); extern void dl_save_TexCoord4f(struct GLContextIFace *Self, GLfloat s, GLfloat t, GLfloat r, GLfloat q); extern void dl_save_TexEnvi(struct GLContextIFace *Self, GLenum target, GLenum pname, GLint param); extern void dl_save_TexEnvfv(struct GLContextIFace *Self, GLenum target, GLenum pname, const GLfloat *params); extern void dl_save_TexParameteri(struct GLContextIFace *Self, GLenum target, GLenum pname, const GLint param); extern void dl_save_TexGeni(struct GLContextIFace *Self, GLenum coord, GLenum pname, GLint param); extern void dl_save_TexGenfv(struct GLContextIFace *Self, GLenum coord, GLenum pname, const GLfloat *params); extern void dl_save_TexImage2D( struct GLContextIFace *Self, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ); extern void dl_save_TexSubImage2D( struct GLContextIFace *Self, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ); extern void dl_save_Translatef(struct GLContextIFace *Self, GLfloat x, GLfloat y, GLfloat z); extern void dl_save_UnpinTexture(struct GLContextIFace *Self, GLuint texnum); extern void dl_save_Vertex4f(struct GLContextIFace *Self, GLfloat x, GLfloat y, GLfloat z, GLfloat w); extern void dl_save_Viewport(struct GLContextIFace *Self, GLint x, GLint y, GLsizei width, GLsizei height); extern void dl_save_Map1f( struct GLContextIFace *Self, GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points ); extern void dl_save_Map1d( struct GLContextIFace *Self, GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points ); extern void dl_save_EvalCoord1f(struct GLContextIFace *Self, GLfloat arg); extern void dl_save_MapGrid1f(struct GLContextIFace *Self, GLint n, GLfloat u1, GLfloat u2); extern void dl_save_EvalMesh1(struct GLContextIFace *Self, GLenum mode, GLint p1, GLint p2); extern void dl_save_EvalPoint1(struct GLContextIFace *Self, GLint p); extern void dl_save_Map2f(struct GLContextIFace *Self, GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points ); extern void dl_save_Map2d( struct GLContextIFace *Self, GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points ); extern void dl_save_EvalCoord2f(struct GLContextIFace *Self, GLfloat u, GLfloat v); extern void dl_save_MapGrid2f( struct GLContextIFace *Self, GLint nu, GLfloat u1, GLfloat u2, GLint nv, GLfloat v1, GLfloat v2 ); extern void dl_save_EvalMesh2( struct GLContextIFace *Self, GLenum mode, GLint p1, GLint p2, GLint q1, GLint q2 ); extern void dl_save_EvalPoint2(struct GLContextIFace *Self, GLint p, GLint q); extern void dl_save_PixelTransfer(struct GLContextIFace *Self, GLenum param, GLfloat value); extern void dl_save_PixelZoom(struct GLContextIFace *Self, GLfloat zoomX, GLfloat zoomY); extern void dl_save_CopyPixels(struct GLContextIFace *Self, GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); extern void dl_save_LogicOp(struct GLContextIFace *Self, GLenum op); // ##### FIXME! ##### void dl_save_InitNames(struct GLContextIFace *Self); void dl_save_LoadName(struct GLContextIFace *Self, GLuint name); void dl_save_PushName(struct GLContextIFace *Self, GLuint name); void dl_save_PopName(struct GLContextIFace *Self); #endif