Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

igl.h

Go to the documentation of this file.
00001 /*
00002 ===========================================================================
00003 Copyright (C) 1999-2005 Id Software, Inc.
00004 
00005 This file is part of Quake III Arena source code.
00006 
00007 Quake III Arena source code is free software; you can redistribute it
00008 and/or modify it under the terms of the GNU General Public License as
00009 published by the Free Software Foundation; either version 2 of the License,
00010 or (at your option) any later version.
00011 
00012 Quake III Arena source code is distributed in the hope that it will be
00013 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 GNU General Public License for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Foobar; if not, write to the Free Software
00019 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00020 ===========================================================================
00021 */
00022 //-----------------------------------------------------------------------------
00023 //
00024 // $LogFile$
00025 // $Revision: 1.7.2.3 $
00026 // $Author: ttimo $
00027 // $Date: 2000/02/16 15:43:14 $
00028 // $Log: igl.h,v $
00029 // Revision 1.7.2.3  2000/02/16 15:43:14  ttimo
00030 // Curry bug #101996: added glTexParameterf and glNormal3f
00031 //
00032 // Revision 1.7.2.2  2000/02/13 17:48:07  ttimo
00033 // Curry bug #101874 - added glTexGenf to GL interface
00034 //
00035 // Revision 1.7.2.1  2000/02/04 22:59:34  ttimo
00036 // messaging API preview
00037 //
00038 // Revision 1.7  2000/01/18 00:43:59  ttimo
00039 // RC
00040 //
00041 // Revision 1.6  2000/01/13 00:46:41  ttimo
00042 // Merged in patches in / out
00043 // Revision 1.1.1.4  2000/01/18 00:17:12  ttimo
00044 // merging in for RC
00045 //
00046 // Revision 1.5  2000/01/11 22:14:48  ttimo
00047 // cleaning up after merging and thinks badly fucked up
00048 //
00049 // Revision 1.2  2000/01/09 04:39:14  ttimo
00050 // added some bindings to the GL table
00051 //
00052 // Revision 1.1.1.3  2000/01/11 16:43:15  ttimo
00053 // merged version from old reposit and Robert update
00054 //
00055 // Revision 1.1.1.1  2000/01/07 17:17:30  ttimo
00056 // initial import of Q3Radiant module
00057 //
00058 // Revision 1.1.1.1  2000/01/07 17:17:30  ttimo
00059 // initial import of Q3Radiant module
00060 //
00061 // Revision 1.3  2000/01/17 23:53:44  TBesset
00062 // ready for merge in sourceforge (RC candidate)
00063 //
00064 // Revision 1.2  2000/01/07 16:40:13  TBesset
00065 // merged from BSP frontend
00066 //
00067 // Revision 1.1.1.3  1999/12/29 18:31:27  TBesset
00068 // Q3Radiant public version
00069 //
00070 // Revision 1.1.1.1.2.1  1999/12/29 21:39:45  TBesset
00071 // updated to update3 from Robert
00072 //
00073 // Revision 1.1.1.3  1999/12/29 18:31:27  TBesset
00074 // Q3Radiant public version
00075 // Revision 1.1.1.3  1999/12/29 18:31:27  TBesset
00076 // Q3Radiant public version
00077 //
00078 // Revision 1.2  1999/11/22 17:46:48  Timo & Christine
00079 // merged EARadiant into the main tree
00080 // bug fixes for Q3Plugin / EAPlugin
00081 // export for Robert
00082 //
00083 // Revision 1.1.2.2  1999/11/03 20:38:04  Timo & Christine
00084 // MEAN plugin for Q3Radiant, alpha version
00085 //
00086 // Revision 1.1.2.1.2.1  1999/10/27 08:34:29  Timo & Christine
00087 // preview version of the texture tools plugin is ready
00088 // ( TexTool.dll plugin is in Q3Plugin module )
00089 // plugins can draw in their own window using Radiant's qgl bindings
00090 //
00091 // Revision 1.1.2.1  1999/10/08 16:28:14  Timo & Christine
00092 // started plugin extensions for EA features support in Q3Radiant
00093 // MEAN files plugin, and Surface Properties plugin
00094 //
00095 //
00096 // DESCRIPTION:
00097 // all purpose OpenGL interface for Q3Radiant plugins
00098 //
00099 
00100 #ifndef __IGL_H__
00101 #define __IGL_H__
00102 
00103 // we use this class to let plugins draw inside the Radiant windows
00104 class IGLWindow
00105 {
00106 public:
00107     // Increment the number of references to this object
00108     virtual void IncRef () = 0;
00109     // Decrement the reference count
00110     virtual void DecRef () = 0;
00111     virtual void Draw( VIEWTYPE vt ) = 0;
00112 };
00113 
00114 // define a GUID for this interface so plugins can access and reference it
00115 // {0F237620-854B-11d3-8EF3-A2DFBD53251B}
00116 static const GUID QERQglTable_GUID = 
00117 { 0xf237620, 0x854b, 0x11d3, { 0x8e, 0xf3, 0xa2, 0xdf, 0xbd, 0x53, 0x25, 0x1b } };
00118 
00119 #include <gl/gl.h>
00120 #include <gl/glu.h>
00121 
00122 typedef void (APIENTRY* PFN_QGLALPHAFUNC)       (GLenum func, GLclampf ref);
00123 typedef void (APIENTRY* PFN_QGLBEGIN)           (GLenum);
00124 typedef void (APIENTRY* PFN_QGLBINDTEXTURE)     (GLenum target, GLuint texture);
00125 typedef void (APIENTRY* PFN_QGLBLENDFUNC)       (GLenum sfactor, GLenum dfactor);
00126 typedef void (APIENTRY* PFN_QGLCALLLIST)        (GLuint list);
00127 typedef void (APIENTRY* PFN_QGLCALLLISTS)       (GLsizei n, GLenum type, const GLvoid *lists);
00128 typedef void (APIENTRY* PFN_QGLCLEAR)           (GLbitfield mask);
00129 typedef void (APIENTRY* PFN_QGLCLEARCOLOR)      (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
00130 typedef void (APIENTRY* PFN_QGLCLEARDEPTH)      (GLclampd depth);
00131 typedef void (APIENTRY* PFN_QGLCOLOR3F)         (GLfloat red, GLfloat green, GLfloat blue);
00132 typedef void (APIENTRY* PFN_QGLCOLOR4F)         (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
00133 typedef void (APIENTRY* PFN_QGLCULLFACE)        (GLenum mode);
00134 typedef void (APIENTRY* PFN_QGLDELETELISTS)     (GLuint list, GLsizei range);
00135 typedef void (APIENTRY* PFN_QGLDISABLE)         (GLenum cap);
00136 typedef void (APIENTRY* PFN_QGLENABLE)          (GLenum cap);
00137 typedef void (APIENTRY* PFN_QGLEND)             ();
00138 typedef void (APIENTRY* PFN_QGLENDLIST)         (void);
00139 typedef GLuint (APIENTRY* PFN_QGLGENLISTS)      (GLsizei range);
00140 typedef void (APIENTRY* PFN_QGLLISTBASE)        (GLuint base);
00141 typedef void (APIENTRY* PFN_QGLLOADIDENTITY)    ();
00142 typedef void (APIENTRY* PFN_QGLMATRIXMODE)      (GLenum mode);
00143 typedef void (APIENTRY* PFN_QGLNEWLIST)         (GLuint list, GLenum mode);
00144 typedef void (APIENTRY* PFN_QGLNORMAL3F)        (GLfloat nx, GLfloat ny, GLfloat nz);
00145 typedef void (APIENTRY* PFN_QGLORTHO)           (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
00146 typedef void (APIENTRY* PFN_QGLPOINTSIZE)       (GLfloat size);
00147 typedef void (APIENTRY* PFN_QGLPOLYGONMODE)     (GLenum face, GLenum mode);
00148 typedef void (APIENTRY* PFN_QGLPOPMATRIX)       ();
00149 typedef void (APIENTRY* PFN_QGLPUSHMATRIX)      ();
00150 typedef void (APIENTRY* PFN_QGLROTATED)         (GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
00151 typedef void (APIENTRY* PFN_QGLROTATEF)         (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
00152 typedef void (APIENTRY* PFN_QGLSCALEF)          (GLfloat x, GLfloat y, GLfloat z);
00153 typedef void (APIENTRY* PFN_QGLTEXCOORD2F)      (GLfloat s, GLfloat t);
00154 typedef void (APIENTRY* PFN_QGLTEXENVF)         (GLenum target, GLenum pname, GLfloat param);
00155 typedef void (APIENTRY* PFN_QGLTEXGENF)         (GLenum coord, GLenum pname, GLfloat param);
00156 typedef void (APIENTRY* PFN_QGLTEXPARAMETERF)   (GLenum target, GLenum pname, GLfloat param);
00157 typedef void (APIENTRY* PFN_QGLTRANSLATED)      (GLdouble x, GLdouble y, GLdouble z);
00158 typedef void (APIENTRY* PFN_QGLTRANSLATEF)      (GLfloat x, GLfloat y, GLfloat z);
00159 typedef void (APIENTRY* PFN_QGLVERTEX2F)        (GLfloat x, GLfloat y);
00160 typedef void (APIENTRY* PFN_QGLVERTEX3F)        (GLfloat x, GLfloat y, GLfloat z);
00161 typedef void (APIENTRY* PFN_QGLVIEWPORT)        (GLint x, GLint y, GLsizei width, GLsizei height);
00162 
00163 typedef void    (WINAPI* PFN_QE_CHECKOPENGLFORERRORS)   ();
00164 typedef int     (WINAPI* PFN_QEW_SETUPPIXELFORMAT)      (HDC hDC, qboolean zbuffer );
00165 typedef HGLRC   (WINAPI* PFN_QWGL_CREATECONTEXT)        (HDC);
00166 typedef BOOL    (WINAPI* PFN_QWGL_DELETECONTEXT)        (HGLRC);
00167 typedef BOOL    (WINAPI* PFN_QWGL_MAKECURRENT)          (HDC, HGLRC);
00168 typedef BOOL    (WINAPI* PFN_QWGL_SHARELISTS)           (HGLRC, HGLRC);
00169 typedef BOOL    (WINAPI* PFN_QWGL_SWAPBUFFERS)          (HDC);
00170 typedef BOOL    (WINAPI* PFN_QWGL_USEFONTBITMAPS)       (HDC, DWORD, DWORD, DWORD);
00171 
00172 // glu stuff
00173 typedef void (APIENTRY * PFN_QGLUPERSPECTIVE) (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
00174 typedef void (APIENTRY * PFN_QGLULOOKAT)(
00175   GLdouble eyex,
00176   GLdouble eyey,
00177   GLdouble eyez,
00178   GLdouble centerx,
00179   GLdouble centery,
00180   GLdouble centerz,
00181   GLdouble upx,
00182   GLdouble upy,
00183   GLdouble upz);
00184 
00185 
00186 // specially provided by the editor for plugins
00187 typedef HGLRC   (WINAPI* PFN_QERAPP_GETQEGLOBALSHGLRC)  ();
00188 
00189 // plugins drawing inside the GL windows
00190 //++timo TODO: add hooking into other windows
00191 //+timo NOTE: this could be moved to the messaging system instead of having a dedicated interface
00192 typedef void (WINAPI* PFN_QERAPP_HOOKXYGLWINDOW) (IGLWindow *);
00193 typedef void (WINAPI* PFN_QERAPP_UNHOOKGLWINDOW) (IGLWindow *);
00194 
00195 struct _QERQglTable
00196 {
00197     //++timo do we really wanna play with versions ?
00198 //  float m_fVersion;
00199     int m_nSize;
00200     PFN_QGLALPHAFUNC        m_pfn_qglAlphaFunc;
00201     PFN_QGLBEGIN            m_pfn_qglBegin;
00202     PFN_QGLBINDTEXTURE      m_pfn_qglBindTexture;
00203     PFN_QGLBLENDFUNC        m_pfn_qglBlendFunc;
00204     PFN_QGLCALLLIST         m_pfn_qglCallList;
00205     PFN_QGLCLEAR            m_pfn_qglClear;
00206     PFN_QGLCLEARCOLOR       m_pfn_qglClearColor;
00207     PFN_QGLCALLLISTS        m_pfn_qglCallLists;
00208     PFN_QGLCLEARDEPTH       m_pfn_qglClearDepth;
00209     PFN_QGLCOLOR3F          m_pfn_qglColor3f;
00210     PFN_QGLCOLOR4F          m_pfn_qglColor4f;
00211     PFN_QGLCULLFACE         m_pfn_qglCullFace;
00212     PFN_QGLDELETELISTS      m_pfn_qglDeleteLists;
00213     PFN_QGLDISABLE          m_pfn_qglDisable;
00214     PFN_QGLENABLE           m_pfn_qglEnable;
00215     PFN_QGLEND              m_pfn_qglEnd;
00216     PFN_QGLENDLIST          m_pfn_qglEndList;
00217     PFN_QGLGENLISTS         m_pfn_qglGenLists;
00218     PFN_QGLLISTBASE         m_pfn_qglListBase;
00219     PFN_QGLLOADIDENTITY     m_pfn_qglLoadIdentity;
00220     PFN_QGLMATRIXMODE       m_pfn_qglMatrixMode;
00221     PFN_QGLNEWLIST          m_pfn_qglNewList;
00222     PFN_QGLNORMAL3F         m_pfn_qglNormal3f;
00223     PFN_QGLORTHO            m_pfn_qglOrtho;
00224     PFN_QGLPOINTSIZE        m_pfn_qglPointSize;
00225     PFN_QGLPOLYGONMODE      m_pfn_qglPolygonMode;
00226     PFN_QGLPOPMATRIX        m_pfn_qglPopMatrix;
00227     PFN_QGLPUSHMATRIX       m_pfn_qglPushMatrix;
00228     PFN_QGLROTATED          m_pfn_qglRotated;
00229     PFN_QGLROTATEF          m_pfn_qglRotatef;
00230     PFN_QGLSCALEF           m_pfn_qglScalef;
00231     PFN_QGLTEXCOORD2F       m_pfn_qglTexCoord2f;
00232     PFN_QGLTEXENVF          m_pfn_qglTexEnvf;
00233     PFN_QGLTEXGENF          m_pfn_qglTexGenf;
00234     PFN_QGLTEXPARAMETERF    m_pfn_qglTexParameterf;
00235     PFN_QGLTRANSLATED       m_pfn_qglTranslated;
00236     PFN_QGLTRANSLATEF       m_pfn_qglTranslatef;
00237     PFN_QGLVERTEX2F         m_pfn_qglVertex2f;
00238     PFN_QGLVERTEX3F         m_pfn_qglVertex3f;
00239     PFN_QGLVIEWPORT         m_pfn_qglViewport;
00240 
00241     PFN_QE_CHECKOPENGLFORERRORS m_pfn_QE_CheckOpenGLForErrors;
00242     PFN_QEW_SETUPPIXELFORMAT    m_pfn_QEW_SetupPixelFormat;
00243     PFN_QWGL_CREATECONTEXT      m_pfn_qwglCreateContext;
00244     PFN_QWGL_DELETECONTEXT      m_pfn_qwglDeleteContext;
00245     PFN_QWGL_MAKECURRENT        m_pfn_qwglMakeCurrent;
00246     PFN_QWGL_SHARELISTS         m_pfn_qwglShareLists;
00247     PFN_QWGL_SWAPBUFFERS        m_pfn_qwglSwapBuffers;
00248     PFN_QWGL_USEFONTBITMAPS     m_pfn_qwglUseFontBitmaps;
00249 
00250     PFN_QERAPP_GETQEGLOBALSHGLRC    m_pfnGetQeglobalsHGLRC;
00251 
00252     // glu stuff
00253     PFN_QGLUPERSPECTIVE         m_pfn_qgluPerspective;
00254     PFN_QGLULOOKAT              m_pfn_qgluLookAt;
00255 
00256     // plugin entities drawing inside Radiant windows
00257     PFN_QERAPP_HOOKXYGLWINDOW   m_pfnHookXYGLWindow;
00258     PFN_QERAPP_UNHOOKGLWINDOW   m_pfnUnHookGLWindow;
00259 };
00260 
00261 #endif

Generated on Thu Aug 25 12:38:29 2005 for Quake III Arena by  doxygen 1.3.9.1