Update of /cvsroot/epfl/tgengine-0.1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27124 Modified Files: defs.h engine.h event.h gldefs.h glrenderer.h texture.cc tgendian.h tgglext.cc tgglext.h timer.h vshader.h Log Message: Portage Win32 Index: timer.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/timer.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** timer.h 26 Sep 2004 13:15:17 -0000 1.1.1.1 --- timer.h 28 Sep 2004 09:44:26 -0000 1.2 *************** *** 3,7 **** #include "base.h" ! #include <SDL.h> namespace tg --- 3,7 ---- #include "base.h" ! #include "gldefs.h" namespace tg Index: tgglext.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/tgglext.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tgglext.cc 27 Sep 2004 19:33:58 -0000 1.2 --- tgglext.cc 28 Sep 2004 09:44:26 -0000 1.3 *************** *** 1,74 **** ! #include "tgglext.h" ! namespace tg ! { ! ! PFNGLACTIVETEXTUREPROC _glActiveTextureARB; ! PFNGLMULTITEXCOORD3FARBPROC _glMultiTexCoord3fARB; ! PFNGLMULTITEXCOORD2FARBPROC _glMultiTexCoord2fARB; ! PFNGLMULTITEXCOORD2FVARBPROC _glMultiTexCoord2fvARB; ! PFNGLMULTITEXCOORD1FARBPROC _glMultiTexCoord1fARB; ! PFNGLCLIENTACTIVETEXTUREPROC _glClientActiveTextureARB; ! ! PFNGLBINDBUFFERARBPROC _glBindBufferARB ; ! PFNGLDELETEBUFFERSARBPROC _glDeleteBuffersARB; ! PFNGLGENBUFFERSARBPROC _glGenBuffersARB; ! PFNGLBUFFERDATAARBPROC _glBufferDataARB; ! ! PFNGLGENPROGRAMSARBPROC _glGenProgramsARB; ! PFNGLBINDPROGRAMARBPROC _glBindProgramARB; ! PFNGLPROGRAMSTRINGARBPROC _glProgramStringARB; ! PFNGLPROGRAMENVPARAMETER4FARBPROC _glProgramEnvParameter4fARB; ! ! PFNGLCOMBINERPARAMETERINVPROC _glCombinerParameteriNV; ! PFNGLCOMBINERPARAMETERFVNVPROC _glCombinerParameterfvNV; ! PFNGLCOMBINERINPUTNVPROC _glCombinerInputNV; ! PFNGLCOMBINEROUTPUTNVPROC _glCombinerOutputNV; ! PFNGLFINALCOMBINERINPUTNVPROC _glFinalCombinerInputNV; ! ! PFNGLLOADPROGRAMNVPROC _glLoadProgramNV; ! PFNGLGENPROGRAMSNVPROC _glGenProgramsNV; ! PFNGLBINDPROGRAMNVPROC _glBindProgramNV; ! PFNGLTRACKMATRIXNVPROC _glTrackMatrixNV; ! PFNGLPROGRAMPARAMETER4FNVPROC _glProgramParameter4fNV; ! ! ! #ifdef TGWIN32 ! #define GETARBPOINTER(var,type,name) var = (type)wglGetProcAddress(name); ! #endif ! #ifdef TGLINUX ! #define GETARBPOINTER(var,type,name) var = (type)SDL_GL_GetProcAddress(name); ! #endif ! #ifdef TGOSX ! #define GETARBPOINTER(var,type,name) var = (type)SDL_GL_GetProcAddress(name); ! #endif ! ! ! void InitARBFunctions() ! { ! GETARBPOINTER(_glActiveTextureARB, PFNGLACTIVETEXTUREPROC, "glActiveTextureARB"); ! GETARBPOINTER(_glMultiTexCoord2fARB, PFNGLMULTITEXCOORD2FARBPROC, "glMultiTexCoord2fARB"); ! GETARBPOINTER(_glMultiTexCoord2fvARB, PFNGLMULTITEXCOORD2FVARBPROC, "glMultiTexCoord2fvARB"); ! GETARBPOINTER(_glMultiTexCoord1fARB, PFNGLMULTITEXCOORD1FARBPROC, "glMultiTexCoord1fARB"); ! GETARBPOINTER(_glMultiTexCoord3fARB, PFNGLMULTITEXCOORD3FARBPROC, "glMultiTexCoord3fARB"); ! GETARBPOINTER(_glClientActiveTextureARB, PFNGLCLIENTACTIVETEXTUREPROC, "glClientActiveTextureARB"); ! GETARBPOINTER(_glGenProgramsARB, PFNGLGENPROGRAMSARBPROC, "glGenProgramsARB"); ! GETARBPOINTER(_glBindProgramARB, PFNGLBINDPROGRAMARBPROC, "glBindProgramARB"); ! GETARBPOINTER(_glProgramStringARB, PFNGLPROGRAMSTRINGARBPROC, "glProgramStringARB"); ! GETARBPOINTER(_glProgramEnvParameter4fARB, PFNGLPROGRAMENVPARAMETER4FARBPROC, "glProgramEnvParameter4fARB"); ! GETARBPOINTER(_glBindBufferARB, PFNGLBINDBUFFERARBPROC, "glBindBufferARB"); ! GETARBPOINTER(_glDeleteBuffersARB, PFNGLDELETEBUFFERSARBPROC, "glDeleteBuffersARB"); ! GETARBPOINTER(_glGenBuffersARB, PFNGLGENBUFFERSARBPROC, "glGenBuffersARB"); ! GETARBPOINTER(_glBufferDataARB, PFNGLBUFFERDATAARBPROC, "glBufferDataARB"); ! GETARBPOINTER(_glCombinerParameteriNV, PFNGLCOMBINERPARAMETERINVPROC, "glCombinerParameteriNV"); ! GETARBPOINTER(_glCombinerParameterfvNV, PFNGLCOMBINERPARAMETERFVNVPROC, "glCombinerParameterfvNV"); ! GETARBPOINTER(_glCombinerInputNV, PFNGLCOMBINERINPUTNVPROC, "glCombinerInputNV"); ! GETARBPOINTER(_glCombinerOutputNV, PFNGLCOMBINEROUTPUTNVPROC, "glCombinerOutputNV"); ! GETARBPOINTER(_glFinalCombinerInputNV, PFNGLFINALCOMBINERINPUTNVPROC, "glFinalCombinerInputNV"); ! GETARBPOINTER(_glLoadProgramNV, PFNGLLOADPROGRAMNVPROC, "glLoadProgramNV"); ! GETARBPOINTER(_glGenProgramsNV, PFNGLGENPROGRAMSNVPROC, "glGenProgramsNV"); ! GETARBPOINTER(_glBindProgramNV, PFNGLBINDPROGRAMNVPROC, "glBindProgramNV"); ! GETARBPOINTER(_glTrackMatrixNV, PFNGLTRACKMATRIXNVPROC, "glTrackMatrixNV"); ! GETARBPOINTER(_glProgramParameter4fNV, PFNGLPROGRAMPARAMETER4FNVPROC, "glProgramParameter4fNV"); ! ! } ! } --- 1,74 ---- ! #include "tgglext.h" ! namespace tg ! { ! ! PFNGLACTIVETEXTUREPROC _glActiveTextureARB; ! PFNGLMULTITEXCOORD3FARBPROC _glMultiTexCoord3fARB; ! PFNGLMULTITEXCOORD2FARBPROC _glMultiTexCoord2fARB; ! PFNGLMULTITEXCOORD2FVARBPROC _glMultiTexCoord2fvARB; ! PFNGLMULTITEXCOORD1FARBPROC _glMultiTexCoord1fARB; ! PFNGLCLIENTACTIVETEXTUREPROC _glClientActiveTextureARB; ! ! PFNGLBINDBUFFERARBPROC _glBindBufferARB ; ! PFNGLDELETEBUFFERSARBPROC _glDeleteBuffersARB; ! PFNGLGENBUFFERSARBPROC _glGenBuffersARB; ! PFNGLBUFFERDATAARBPROC _glBufferDataARB; ! ! PFNGLGENPROGRAMSARBPROC _glGenProgramsARB; ! PFNGLBINDPROGRAMARBPROC _glBindProgramARB; ! PFNGLPROGRAMSTRINGARBPROC _glProgramStringARB; ! PFNGLPROGRAMENVPARAMETER4FARBPROC _glProgramEnvParameter4fARB; ! ! PFNGLCOMBINERPARAMETERINVPROC _glCombinerParameteriNV; ! PFNGLCOMBINERPARAMETERFVNVPROC _glCombinerParameterfvNV; ! PFNGLCOMBINERINPUTNVPROC _glCombinerInputNV; ! PFNGLCOMBINEROUTPUTNVPROC _glCombinerOutputNV; ! PFNGLFINALCOMBINERINPUTNVPROC _glFinalCombinerInputNV; ! ! PFNGLLOADPROGRAMNVPROC _glLoadProgramNV; ! PFNGLGENPROGRAMSNVPROC _glGenProgramsNV; ! PFNGLBINDPROGRAMNVPROC _glBindProgramNV; ! PFNGLTRACKMATRIXNVPROC _glTrackMatrixNV; ! PFNGLPROGRAMPARAMETER4FNVPROC _glProgramParameter4fNV; ! ! ! #ifdef TGWIN32 ! #define GETARBPOINTER(var,type,name) var = (type)wglGetProcAddress(name); ! #endif ! #ifdef TGLINUX ! #define GETARBPOINTER(var,type,name) var = (type)SDL_GL_GetProcAddress(name); ! #endif ! #ifdef TGOSX ! #define GETARBPOINTER(var,type,name) var = (type)SDL_GL_GetProcAddress(name); ! #endif ! ! ! void InitARBFunctions() ! { ! GETARBPOINTER(_glActiveTextureARB, PFNGLACTIVETEXTUREPROC, "glActiveTextureARB"); ! GETARBPOINTER(_glMultiTexCoord2fARB, PFNGLMULTITEXCOORD2FARBPROC, "glMultiTexCoord2fARB"); ! GETARBPOINTER(_glMultiTexCoord2fvARB, PFNGLMULTITEXCOORD2FVARBPROC, "glMultiTexCoord2fvARB"); ! GETARBPOINTER(_glMultiTexCoord1fARB, PFNGLMULTITEXCOORD1FARBPROC, "glMultiTexCoord1fARB"); ! GETARBPOINTER(_glMultiTexCoord3fARB, PFNGLMULTITEXCOORD3FARBPROC, "glMultiTexCoord3fARB"); ! GETARBPOINTER(_glClientActiveTextureARB, PFNGLCLIENTACTIVETEXTUREPROC, "glClientActiveTextureARB"); ! GETARBPOINTER(_glGenProgramsARB, PFNGLGENPROGRAMSARBPROC, "glGenProgramsARB"); ! GETARBPOINTER(_glBindProgramARB, PFNGLBINDPROGRAMARBPROC, "glBindProgramARB"); ! GETARBPOINTER(_glProgramStringARB, PFNGLPROGRAMSTRINGARBPROC, "glProgramStringARB"); ! GETARBPOINTER(_glProgramEnvParameter4fARB, PFNGLPROGRAMENVPARAMETER4FARBPROC, "glProgramEnvParameter4fARB"); ! GETARBPOINTER(_glBindBufferARB, PFNGLBINDBUFFERARBPROC, "glBindBufferARB"); ! GETARBPOINTER(_glDeleteBuffersARB, PFNGLDELETEBUFFERSARBPROC, "glDeleteBuffersARB"); ! GETARBPOINTER(_glGenBuffersARB, PFNGLGENBUFFERSARBPROC, "glGenBuffersARB"); ! GETARBPOINTER(_glBufferDataARB, PFNGLBUFFERDATAARBPROC, "glBufferDataARB"); ! GETARBPOINTER(_glCombinerParameteriNV, PFNGLCOMBINERPARAMETERINVPROC, "glCombinerParameteriNV"); ! GETARBPOINTER(_glCombinerParameterfvNV, PFNGLCOMBINERPARAMETERFVNVPROC, "glCombinerParameterfvNV"); ! GETARBPOINTER(_glCombinerInputNV, PFNGLCOMBINERINPUTNVPROC, "glCombinerInputNV"); ! GETARBPOINTER(_glCombinerOutputNV, PFNGLCOMBINEROUTPUTNVPROC, "glCombinerOutputNV"); ! GETARBPOINTER(_glFinalCombinerInputNV, PFNGLFINALCOMBINERINPUTNVPROC, "glFinalCombinerInputNV"); ! GETARBPOINTER(_glLoadProgramNV, PFNGLLOADPROGRAMNVPROC, "glLoadProgramNV"); ! GETARBPOINTER(_glGenProgramsNV, PFNGLGENPROGRAMSNVPROC, "glGenProgramsNV"); ! GETARBPOINTER(_glBindProgramNV, PFNGLBINDPROGRAMNVPROC, "glBindProgramNV"); ! GETARBPOINTER(_glTrackMatrixNV, PFNGLTRACKMATRIXNVPROC, "glTrackMatrixNV"); ! GETARBPOINTER(_glProgramParameter4fNV, PFNGLPROGRAMPARAMETER4FNVPROC, "glProgramParameter4fNV"); ! ! } ! } Index: defs.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/defs.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** defs.h 27 Sep 2004 21:34:05 -0000 1.2 --- defs.h 28 Sep 2004 09:44:26 -0000 1.3 *************** *** 12,15 **** --- 12,23 ---- #include <sstream> + #ifdef TGWIN32 + #include <SDL/SDL.h> + #include <SDL/SDL_image.h> + #else + #include <SDL.h> + #include <SDL_image.h> + #endif + namespace tg { Index: tgglext.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/tgglext.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tgglext.h 27 Sep 2004 19:33:58 -0000 1.2 --- tgglext.h 28 Sep 2004 09:44:26 -0000 1.3 *************** *** 1,82 **** ! #ifndef _TGTGGLEXT_H ! #define _TGTGGLEXT_H ! ! #include "gldefs.h" ! //#define GL_GLEXT_PROTOTYPES ! //#undef GL_GLEXT_PROTOTYPES ! ! #ifndef APIENTRY ! #define APIENTRY ! #endif ! ! namespace tg ! { ! ! typedef void (APIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); ! typedef void (APIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); ! ! typedef void (APIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); ! typedef void (APIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); ! typedef void (APIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); ! typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); ! ! typedef void (APIENTRY * PFNGLBINDBUFFERARBPROC)(GLenum target, GLuint buffer); ! typedef void (APIENTRY * PFNGLDELETEBUFFERSARBPROC)(GLsizei n, const GLuint *buffers); ! typedef void (APIENTRY * PFNGLGENBUFFERSARBPROC)(GLsizei n, GLuint *buffers); ! typedef void (APIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, int size, const GLvoid *data, GLenum usage); ! ! typedef void (APIENTRY * PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); ! typedef void (APIENTRY * PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); ! typedef void (APIENTRY * PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void *string); ! typedef void (APIENTRY * PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); ! ! typedef void (APIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); ! typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); ! typedef void (APIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); ! typedef void (APIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); ! typedef void (APIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); ! ! typedef void (APIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); ! typedef void (APIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); ! typedef void (APIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); ! typedef void (APIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); ! typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); ! ! extern PFNGLACTIVETEXTUREPROC _glActiveTextureARB; ! extern PFNGLMULTITEXCOORD3FARBPROC _glMultiTexCoord3fARB; ! extern PFNGLMULTITEXCOORD2FARBPROC _glMultiTexCoord2fARB; ! extern PFNGLMULTITEXCOORD2FVARBPROC _glMultiTexCoord2fvARB; ! extern PFNGLMULTITEXCOORD1FARBPROC _glMultiTexCoord1fARB; ! extern PFNGLCLIENTACTIVETEXTUREPROC _glClientActiveTextureARB; ! ! extern PFNGLBINDBUFFERARBPROC _glBindBufferARB ; ! extern PFNGLDELETEBUFFERSARBPROC _glDeleteBuffersARB; ! extern PFNGLGENBUFFERSARBPROC _glGenBuffersARB; ! extern PFNGLBUFFERDATAARBPROC _glBufferDataARB; ! ! extern PFNGLGENPROGRAMSARBPROC _glGenProgramsARB; ! extern PFNGLBINDPROGRAMARBPROC _glBindProgramARB; ! extern PFNGLPROGRAMSTRINGARBPROC _glProgramStringARB; ! extern PFNGLPROGRAMENVPARAMETER4FARBPROC _glProgramEnvParameter4fARB; ! ! extern PFNGLCOMBINERPARAMETERINVPROC _glCombinerParameteriNV; ! extern PFNGLCOMBINERPARAMETERFVNVPROC _glCombinerParameterfvNV; ! extern PFNGLCOMBINERINPUTNVPROC _glCombinerInputNV; ! extern PFNGLCOMBINEROUTPUTNVPROC _glCombinerOutputNV; ! extern PFNGLFINALCOMBINERINPUTNVPROC _glFinalCombinerInputNV; ! ! extern PFNGLLOADPROGRAMNVPROC _glLoadProgramNV; ! extern PFNGLGENPROGRAMSNVPROC _glGenProgramsNV; ! extern PFNGLBINDPROGRAMNVPROC _glBindProgramNV; ! extern PFNGLTRACKMATRIXNVPROC _glTrackMatrixNV; ! extern PFNGLPROGRAMPARAMETER4FNVPROC _glProgramParameter4fNV; ! ! #define GL_VERTEX_PROGRAM_NV 0x8620 ! #define GL_PROGRAM_ERROR_POSITION_NV 0x864B ! #define GL_IDENTITY_NV 0x862A ! #define GL_MODELVIEW_PROJECTION_NV 0x8629 ! ! void InitARBFunctions (); ! ! } ! #endif --- 1,82 ---- ! #ifndef _TGTGGLEXT_H ! #define _TGTGGLEXT_H ! ! #include "gldefs.h" ! //#define GL_GLEXT_PROTOTYPES ! //#undef GL_GLEXT_PROTOTYPES ! ! #ifndef APIENTRY ! #define APIENTRY ! #endif ! ! namespace tg ! { ! ! typedef void (APIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); ! typedef void (APIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); ! ! typedef void (APIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); ! typedef void (APIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); ! typedef void (APIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); ! typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); ! ! typedef void (APIENTRY * PFNGLBINDBUFFERARBPROC)(GLenum target, GLuint buffer); ! typedef void (APIENTRY * PFNGLDELETEBUFFERSARBPROC)(GLsizei n, const GLuint *buffers); ! typedef void (APIENTRY * PFNGLGENBUFFERSARBPROC)(GLsizei n, GLuint *buffers); ! typedef void (APIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, int size, const GLvoid *data, GLenum usage); ! ! typedef void (APIENTRY * PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); ! typedef void (APIENTRY * PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); ! typedef void (APIENTRY * PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void *string); ! typedef void (APIENTRY * PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); ! ! typedef void (APIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); ! typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); ! typedef void (APIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); ! typedef void (APIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); ! typedef void (APIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); ! ! typedef void (APIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); ! typedef void (APIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); ! typedef void (APIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); ! typedef void (APIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); ! typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); ! ! extern PFNGLACTIVETEXTUREPROC _glActiveTextureARB; ! extern PFNGLMULTITEXCOORD3FARBPROC _glMultiTexCoord3fARB; ! extern PFNGLMULTITEXCOORD2FARBPROC _glMultiTexCoord2fARB; ! extern PFNGLMULTITEXCOORD2FVARBPROC _glMultiTexCoord2fvARB; ! extern PFNGLMULTITEXCOORD1FARBPROC _glMultiTexCoord1fARB; ! extern PFNGLCLIENTACTIVETEXTUREPROC _glClientActiveTextureARB; ! ! extern PFNGLBINDBUFFERARBPROC _glBindBufferARB ; ! extern PFNGLDELETEBUFFERSARBPROC _glDeleteBuffersARB; ! extern PFNGLGENBUFFERSARBPROC _glGenBuffersARB; ! extern PFNGLBUFFERDATAARBPROC _glBufferDataARB; ! ! extern PFNGLGENPROGRAMSARBPROC _glGenProgramsARB; ! extern PFNGLBINDPROGRAMARBPROC _glBindProgramARB; ! extern PFNGLPROGRAMSTRINGARBPROC _glProgramStringARB; ! extern PFNGLPROGRAMENVPARAMETER4FARBPROC _glProgramEnvParameter4fARB; ! ! extern PFNGLCOMBINERPARAMETERINVPROC _glCombinerParameteriNV; ! extern PFNGLCOMBINERPARAMETERFVNVPROC _glCombinerParameterfvNV; ! extern PFNGLCOMBINERINPUTNVPROC _glCombinerInputNV; ! extern PFNGLCOMBINEROUTPUTNVPROC _glCombinerOutputNV; ! extern PFNGLFINALCOMBINERINPUTNVPROC _glFinalCombinerInputNV; ! ! extern PFNGLLOADPROGRAMNVPROC _glLoadProgramNV; ! extern PFNGLGENPROGRAMSNVPROC _glGenProgramsNV; ! extern PFNGLBINDPROGRAMNVPROC _glBindProgramNV; ! extern PFNGLTRACKMATRIXNVPROC _glTrackMatrixNV; ! extern PFNGLPROGRAMPARAMETER4FNVPROC _glProgramParameter4fNV; ! ! #define GL_VERTEX_PROGRAM_NV 0x8620 ! #define GL_PROGRAM_ERROR_POSITION_NV 0x864B ! #define GL_IDENTITY_NV 0x862A ! #define GL_MODELVIEW_PROJECTION_NV 0x8629 ! ! void InitARBFunctions (); ! ! } ! #endif Index: tgendian.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/tgendian.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** tgendian.h 26 Sep 2004 13:15:35 -0000 1.1.1.1 --- tgendian.h 28 Sep 2004 09:44:26 -0000 1.2 *************** *** 1,71 **** ! #ifndef _TGTGENDIAN_H ! #define _TGTGENDIAN_H ! namespace tg ! { ! ! /** ! * Endian : Gestion de la conversion little endian/big endian ! */ ! class Endian ! { ! public: ! virtual short Short (short l) = 0; ! virtual int Long (int l) = 0; ! virtual float Float (float f) = 0; ! bool bLittle; ! }; ! ! /** ! * LittleEndian : conversion pour les architectures x86. Les .bmp et .bsp sont en littleendian -> pas de conversion ! */ ! class LittleEndian : public Endian ! { ! public: ! LittleEndian () { bLittle=true; } ! short Short (short l) { return l; } ! int Long (int l) { return l; } ! float Float (float f) { return f; } ! ! }; ! ! class BigEndian : public Endian ! { ! public: ! BigEndian () { bLittle=false; } ! short Short (short l) ! { ! unsigned char b1, b2; ! b1 = l&255; ! b2 = (l>>8)&255; ! return (b1<<8) + b2; ! } ! ! int Long (int l) ! { ! unsigned char b1,b2,b3,b4; ! b1=l&255; ! b2=(l>>8)&255; ! b3=(l>>16)&255; ! b4=(l>>24)&255; ! return ((int)b1<<24) + ((int)b2<<16) + ((int)b3<<8) + b4; ! } ! ! float Float (float f) ! { ! union ! { ! float f; ! unsigned char b[4]; ! }dat1, dat2; ! dat1.f = f; ! dat2.b[0] = dat1.b[3]; ! dat2.b[1] = dat1.b[2]; ! dat2.b[2] = dat1.b[1]; ! dat2.b[3] = dat1.b[0]; ! return dat2.f; ! } ! ! }; ! ! } ! #endif --- 1,71 ---- ! #ifndef _TGTGENDIAN_H ! #define _TGTGENDIAN_H ! namespace tg ! { ! ! /** ! * Endian : Gestion de la conversion little endian/big endian ! */ ! class Endian ! { ! public: ! virtual short Short (short l) = 0; ! virtual int Long (int l) = 0; ! virtual float Float (float f) = 0; ! bool bLittle; ! }; ! ! /** ! * LittleEndian : conversion pour les architectures x86. Les .bmp et .bsp sont en littleendian -> pas de conversion ! */ ! class LittleEndian : public Endian ! { ! public: ! LittleEndian () { bLittle=true; } ! short Short (short l) { return l; } ! int Long (int l) { return l; } ! float Float (float f) { return f; } ! ! }; ! ! class BigEndian : public Endian ! { ! public: ! BigEndian () { bLittle=false; } ! short Short (short l) ! { ! unsigned char b1, b2; ! b1 = l&255; ! b2 = (l>>8)&255; ! return (b1<<8) + b2; ! } ! ! int Long (int l) ! { ! unsigned char b1,b2,b3,b4; ! b1=l&255; ! b2=(l>>8)&255; ! b3=(l>>16)&255; ! b4=(l>>24)&255; ! return ((int)b1<<24) + ((int)b2<<16) + ((int)b3<<8) + b4; ! } ! ! float Float (float f) ! { ! union ! { ! float f; ! unsigned char b[4]; ! }dat1, dat2; ! dat1.f = f; ! dat2.b[0] = dat1.b[3]; ! dat2.b[1] = dat1.b[2]; ! dat2.b[2] = dat1.b[1]; ! dat2.b[3] = dat1.b[0]; ! return dat2.f; ! } ! ! }; ! ! } ! #endif Index: vshader.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/vshader.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** vshader.h 27 Sep 2004 19:33:58 -0000 1.3 --- vshader.h 28 Sep 2004 09:44:26 -0000 1.4 *************** *** 1,27 **** ! #ifndef _TGVSHADER_H ! #define _TGVSHADER_H ! ! #include "gldefs.h" ! ! namespace tg ! { ! ! /** ! * Classe de gestion des vertex shaders ! */ ! class VShader ! { ! public: ! VShader(const char* name); ! void Enable (); ! void Disable (); ! void Bind (); ! void Bind (const float* value, ...); ! void SetParams(const float* value, ...); ! protected: ! //GLhandleARB shader; ! }; ! ! } ! #endif \ No newline at end of file --- 1,27 ---- ! #ifndef _TGVSHADER_H ! #define _TGVSHADER_H ! ! #include "gldefs.h" ! ! namespace tg ! { ! ! /** ! * Classe de gestion des vertex shaders ! */ ! class VShader ! { ! public: ! VShader(const char* name); ! void Enable (); ! void Disable (); ! void Bind (); ! void Bind (const float* value, ...); ! void SetParams(const float* value, ...); ! protected: ! //GLhandleARB shader; ! }; ! ! } ! #endif \ No newline at end of file Index: texture.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/texture.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** texture.cc 27 Sep 2004 22:10:57 -0000 1.4 --- texture.cc 28 Sep 2004 09:44:26 -0000 1.5 *************** *** 10,14 **** #endif #include "engine.h" - #include "SDL_image.h" namespace tg --- 10,13 ---- Index: engine.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/engine.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** engine.h 26 Sep 2004 13:15:07 -0000 1.1.1.1 --- engine.h 28 Sep 2004 09:44:26 -0000 1.2 *************** *** 35,39 **** #include "texturemanager.h" #include "tgendian.h" ! #include <SDL.h> namespace tg --- 35,39 ---- #include "texturemanager.h" #include "tgendian.h" ! #include "defs.h" namespace tg Index: glrenderer.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/glrenderer.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** glrenderer.h 26 Sep 2004 13:15:12 -0000 1.1.1.1 --- glrenderer.h 28 Sep 2004 09:44:26 -0000 1.2 *************** *** 7,11 **** #include "texture.h" #include "boundingbox.h" - #include <SDL.h> #include "gldefs.h" #include <vector> --- 7,10 ---- Index: event.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/event.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** event.h 26 Sep 2004 13:15:07 -0000 1.1.1.1 --- event.h 28 Sep 2004 09:44:26 -0000 1.2 *************** *** 1,448 **** ! /* ! * TG Engine ! * ! * Copyright (C) 2004 Julien "Silver" Rebetez ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! ! #ifndef _TGEVENT_H ! #define _TGEVENT_H ! ! #include "defs.h" ! #include <SDL.h> ! namespace tg ! { ! /** @defgroup eventstructs AE event structs and definitions. ! * AE event structures and definitions. ! * @{ ! */ ! ! /// Key definition table. ! /*! ! This is essentially the same as SDLKEY_*, the only ! change is in the name (AEKEY_*). ! */ ! enum tgKey { ! TGKEY_UNKNOWN = 0, ! TGKEY_FIRST = 0, ! TGKEY_BACKSPACE = 8, ! TGKEY_TAB = 9, ! TGKEY_CLEAR = 12, ! TGKEY_RETURN = 13, ! TGKEY_PAUSE = 19, ! TGKEY_ESCAPE = 27, ! TGKEY_SPACE = 32, ! TGKEY_EXCLAIM = 33, ! TGKEY_QUOTEDBL = 34, ! TGKEY_HASH = 35, ! TGKEY_DOLLAR = 36, ! TGKEY_AMPERSAND = 38, ! TGKEY_QUOTE = 39, ! TGKEY_LEFTPAREN = 40, ! TGKEY_RIGHTPAREN = 41, ! TGKEY_ASTERISK = 42, ! TGKEY_PLUS = 43, ! TGKEY_COMMA = 44, ! TGKEY_MINUS = 45, ! TGKEY_PERIOD = 46, ! TGKEY_SLASH = 47, ! TGKEY_0 = 48, ! TGKEY_1 = 49, ! TGKEY_2 = 50, ! TGKEY_3 = 51, ! TGKEY_4 = 52, ! TGKEY_5 = 53, ! TGKEY_6 = 54, ! TGKEY_7 = 55, ! TGKEY_8 = 56, ! TGKEY_9 = 57, ! TGKEY_COLON = 58, ! TGKEY_SEMICOLON = 59, ! TGKEY_LESS = 60, ! TGKEY_EQUALS = 61, ! TGKEY_GREATER = 62, ! TGKEY_QUESTION = 63, ! TGKEY_AT = 64, ! ! TGKEY_LEFTBRACKET = 91, ! TGKEY_BACKSLASH = 92, ! TGKEY_RIGHTBRACKET = 93, ! TGKEY_CARET = 94, ! TGKEY_UNDERSCORE = 95, ! TGKEY_BACKQUOTE = 96, ! TGKEY_a = 97, ! TGKEY_b = 98, ! TGKEY_c = 99, ! TGKEY_d = 100, ! TGKEY_e = 101, ! TGKEY_f = 102, ! TGKEY_g = 103, ! TGKEY_h = 104, ! TGKEY_i = 105, ! TGKEY_j = 106, ! TGKEY_k = 107, ! TGKEY_l = 108, ! TGKEY_m = 109, ! TGKEY_n = 110, ! TGKEY_o = 111, ! TGKEY_p = 112, ! TGKEY_q = 113, ! TGKEY_r = 114, ! TGKEY_s = 115, ! TGKEY_t = 116, ! TGKEY_u = 117, ! TGKEY_v = 118, ! TGKEY_w = 119, ! TGKEY_x = 120, ! TGKEY_y = 121, ! TGKEY_z = 122, ! TGKEY_DELETE = 127, ! ! TGKEY_WORLD_0 = 160, ! TGKEY_WORLD_1 = 161, ! TGKEY_WORLD_2 = 162, ! TGKEY_WORLD_3 = 163, ! TGKEY_WORLD_4 = 164, ! TGKEY_WORLD_5 = 165, ! TGKEY_WORLD_6 = 166, ! TGKEY_WORLD_7 = 167, ! TGKEY_WORLD_8 = 168, ! TGKEY_WORLD_9 = 169, ! TGKEY_WORLD_10 = 170, ! TGKEY_WORLD_11 = 171, ! TGKEY_WORLD_12 = 172, ! TGKEY_WORLD_13 = 173, ! TGKEY_WORLD_14 = 174, ! TGKEY_WORLD_15 = 175, ! TGKEY_WORLD_16 = 176, ! TGKEY_WORLD_17 = 177, ! TGKEY_WORLD_18 = 178, ! TGKEY_WORLD_19 = 179, ! TGKEY_WORLD_20 = 180, ! TGKEY_WORLD_21 = 181, ! TGKEY_WORLD_22 = 182, ! TGKEY_WORLD_23 = 183, ! TGKEY_WORLD_24 = 184, ! TGKEY_WORLD_25 = 185, ! TGKEY_WORLD_26 = 186, ! TGKEY_WORLD_27 = 187, ! TGKEY_WORLD_28 = 188, ! TGKEY_WORLD_29 = 189, ! TGKEY_WORLD_30 = 190, ! TGKEY_WORLD_31 = 191, ! TGKEY_WORLD_32 = 192, ! TGKEY_WORLD_33 = 193, ! TGKEY_WORLD_34 = 194, ! TGKEY_WORLD_35 = 195, ! TGKEY_WORLD_36 = 196, ! TGKEY_WORLD_37 = 197, ! TGKEY_WORLD_38 = 198, ! TGKEY_WORLD_39 = 199, ! TGKEY_WORLD_40 = 200, ! TGKEY_WORLD_41 = 201, ! TGKEY_WORLD_42 = 202, ! TGKEY_WORLD_43 = 203, ! TGKEY_WORLD_44 = 204, ! TGKEY_WORLD_45 = 205, ! TGKEY_WORLD_46 = 206, ! TGKEY_WORLD_47 = 207, ! TGKEY_WORLD_48 = 208, ! TGKEY_WORLD_49 = 209, ! TGKEY_WORLD_50 = 210, ! TGKEY_WORLD_51 = 211, ! TGKEY_WORLD_52 = 212, ! TGKEY_WORLD_53 = 213, ! TGKEY_WORLD_54 = 214, ! TGKEY_WORLD_55 = 215, ! TGKEY_WORLD_56 = 216, ! TGKEY_WORLD_57 = 217, ! TGKEY_WORLD_58 = 218, ! TGKEY_WORLD_59 = 219, ! TGKEY_WORLD_60 = 220, ! TGKEY_WORLD_61 = 221, ! TGKEY_WORLD_62 = 222, ! TGKEY_WORLD_63 = 223, ! TGKEY_WORLD_64 = 224, ! TGKEY_WORLD_65 = 225, ! TGKEY_WORLD_66 = 226, ! TGKEY_WORLD_67 = 227, ! TGKEY_WORLD_68 = 228, ! TGKEY_WORLD_69 = 229, ! TGKEY_WORLD_70 = 230, ! TGKEY_WORLD_71 = 231, ! TGKEY_WORLD_72 = 232, ! TGKEY_WORLD_73 = 233, ! TGKEY_WORLD_74 = 234, ! TGKEY_WORLD_75 = 235, ! TGKEY_WORLD_76 = 236, ! TGKEY_WORLD_77 = 237, ! TGKEY_WORLD_78 = 238, ! TGKEY_WORLD_79 = 239, ! TGKEY_WORLD_80 = 240, ! TGKEY_WORLD_81 = 241, ! TGKEY_WORLD_82 = 242, ! TGKEY_WORLD_83 = 243, ! TGKEY_WORLD_84 = 244, ! TGKEY_WORLD_85 = 245, ! TGKEY_WORLD_86 = 246, ! TGKEY_WORLD_87 = 247, ! TGKEY_WORLD_88 = 248, ! TGKEY_WORLD_89 = 249, ! TGKEY_WORLD_90 = 250, ! TGKEY_WORLD_91 = 251, ! TGKEY_WORLD_92 = 252, ! TGKEY_WORLD_93 = 253, ! TGKEY_WORLD_94 = 254, ! TGKEY_WORLD_95 = 255, ! ! TGKEY_KP0 = 256, ! TGKEY_KP1 = 257, ! TGKEY_KP2 = 258, ! TGKEY_KP3 = 259, ! TGKEY_KP4 = 260, ! TGKEY_KP5 = 261, ! TGKEY_KP6 = 262, ! TGKEY_KP7 = 263, ! TGKEY_KP8 = 264, ! TGKEY_KP9 = 265, ! TGKEY_KP_PERIOD = 266, ! TGKEY_KP_DIVIDE = 267, ! TGKEY_KP_MULTIPLY = 268, ! TGKEY_KP_MINUS = 269, ! TGKEY_KP_PLUS = 270, ! TGKEY_KP_ENTER = 271, ! TGKEY_KP_EQUALS = 272, ! ! TGKEY_UP = 273, ! TGKEY_DOWN = 274, ! TGKEY_RIGHT = 275, ! TGKEY_LEFT = 276, ! TGKEY_INSERT = 277, ! TGKEY_HOME = 278, ! TGKEY_END = 279, ! TGKEY_PAGEUP = 280, ! TGKEY_PAGEDOWN = 281, ! ! TGKEY_F1 = 282, ! TGKEY_F2 = 283, ! TGKEY_F3 = 284, ! TGKEY_F4 = 285, ! TGKEY_F5 = 286, ! TGKEY_F6 = 287, ! TGKEY_F7 = 288, ! TGKEY_F8 = 289, ! TGKEY_F9 = 290, ! TGKEY_F10 = 291, ! TGKEY_F11 = 292, ! TGKEY_F12 = 293, ! TGKEY_F13 = 294, ! TGKEY_F14 = 295, ! TGKEY_F15 = 296, ! ! TGKEY_NUMLOCK = 300, ! TGKEY_CAPSLOCK = 301, ! TGKEY_SCROLLOCK = 302, ! TGKEY_RSHIFT = 303, ! TGKEY_LSHIFT = 304, ! TGKEY_RCTRL = 305, ! TGKEY_LCTRL = 306, ! TGKEY_RALT = 307, ! TGKEY_LALT = 308, ! TGKEY_RMETA = 309, ! TGKEY_LMETA = 310, ! TGKEY_LSUPER = 311, ! TGKEY_RSUPER = 312, ! TGKEY_MODE = 313, ! TGKEY_COMPOSE = 314, ! ! TGKEY_HELP = 315, ! TGKEY_PRINT = 316, ! TGKEY_SYSREQ = 317, ! TGKEY_BREAK = 318, ! TGKEY_MENU = 319, ! TGKEY_POWER = 320, ! TGKEY_EURO = 321, ! TGKEY_UNDO = 322, ! ! TGKEY_LAST ! }; ! ! /// Just a rename... ! typedef SDLMod tgKeyMod; ! ! /// Event type codes. Used to indentify the type of an event occuring. ! enum tgEventType { ! evActiveEvent, ! evBroadcast, ! evKeyDown, ! evKeyUp, ! evMouseMotion, ! evMouseButtonDown, ! evMouseButtonUp, ! evQuit ! }; ! ! /// Event command codes. ! enum tgEventCmdCode { ! cmdPreFrame, ! cmdProcessFrame, ! cmdPostFrame, ! cmdToggleFullscreen ! }; ! ! /// Application focus states. ! enum tgAppActiveState { ! tgAppMouseFocus, ! tgAppInputFocus, ! tgAppActive ! }; ! ! /// Button states for press/release. ! enum tgButtonState { ! tgPressed, ! tgReleased ! }; ! ! /// Mouse button definitions. ! enum tgMouseButton { ! tgButtonLeft = 1, ! tgButtonMiddle = 2, ! tgButtonRight = 3 ! }; ! ! /// Mouse button states for press/release. ! enum tgMouseButtonState { ! tgNonePressed = 0, ! tgLeftPressed = 1, ! tgMiddlePressed = 2, ! tgRightPressed = 3 ! }; ! ! /** ! * Holds info for app focus gain/lost event. ! * ! */ ! struct tgActiveEvent { ! /// Event type. ! tgEventType type; ! /// Whether it was gain or loss. 0 = loss, 1 = gain. ! uint8 gain; ! /// App focus state. ! tgAppActiveState state; ! }; ! ! /** ! * Event command struct. ! * ! */ ! struct tgEventCommand { ! /// Event command code. ! tgEventCmdCode code; ! }; ! ! /** ! * Key press info. ! * ! */ ! struct tgKeySym { ! /// Scancode. ! uint8 scancode; ! /// The key this event occured on. ! tgKey sym; ! /// Modified key. ! tgKeyMod mod; ! /// Unicode. ! uint16 unicode; ! }; ! ! /** ! * Keyboard event struct. ! * ! */ ! struct tgKeyboardEvent { ! /// Event type. ! tgEventType type; ! /// Button state. ! tgButtonState state; ! // Key press information. ! tgKeySym keysym; ! }; ! ! /** ! * Mouse motion event struct. ! * ! */ ! struct tgMouseMotionEvent { ! /// Event type. ! tgEventType type; ! /// Mouse button state. ! tgMouseButtonState state; ! /// X and Y pos of the mouse cursor. ! uint16 x, y; ! /// The change in mouse X and Y from the last position. ! sint16 xrel, yrel; ! }; ! ! /** ! * Mouse button event struct. ! * ! */ ! struct tgMouseButtonEvent { ! /// Event type. ! tgEventType type; ! /// Mouse button this even occured on. ! tgMouseButton button; ! /// Button state. ! tgButtonState state; ! /// Mouse position. ! uint16 x, y; ! }; ! ! /** ! * Quit event. Used on application quit. ! * ! */ ! struct tgQuitEvent { ! /// Event type. ! tgEventType type; ! }; ! ! /** ! * The TG event structure. ! * ! */ ! struct tgEvent { ! /// Event type. ! tgEventType type; ! /// Event command. ! tgEventCommand cmd; ! /// Active event. ! tgActiveEvent active; ! /// Keyboard event. ! tgKeyboardEvent key; ! /// Mouse motion event. ! tgMouseMotionEvent motion; ! /// Mouse button event. ! tgMouseButtonEvent button; ! /// Quit event. ! tgQuitEvent quit; ! }; ! ! ! /** @} */ ! } ! #endif // __TGLIB_TGENGINE_EVENT_H__ --- 1,447 ---- ! /* ! * TG Engine ! * ! * Copyright (C) 2004 Julien "Silver" Rebetez ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! ! #ifndef _TGEVENT_H ! #define _TGEVENT_H ! ! #include "defs.h" ! namespace tg ! { ! /** @defgroup eventstructs AE event structs and definitions. ! * AE event structures and definitions. ! * @{ ! */ ! ! /// Key definition table. ! /*! ! This is essentially the same as SDLKEY_*, the only ! change is in the name (AEKEY_*). ! */ ! enum tgKey { ! TGKEY_UNKNOWN = 0, ! TGKEY_FIRST = 0, ! TGKEY_BACKSPACE = 8, ! TGKEY_TAB = 9, ! TGKEY_CLEAR = 12, ! TGKEY_RETURN = 13, ! TGKEY_PAUSE = 19, ! TGKEY_ESCAPE = 27, ! TGKEY_SPACE = 32, ! TGKEY_EXCLAIM = 33, ! TGKEY_QUOTEDBL = 34, ! TGKEY_HASH = 35, ! TGKEY_DOLLAR = 36, ! TGKEY_AMPERSAND = 38, ! TGKEY_QUOTE = 39, ! TGKEY_LEFTPAREN = 40, ! TGKEY_RIGHTPAREN = 41, ! TGKEY_ASTERISK = 42, ! TGKEY_PLUS = 43, ! TGKEY_COMMA = 44, ! TGKEY_MINUS = 45, ! TGKEY_PERIOD = 46, ! TGKEY_SLASH = 47, ! TGKEY_0 = 48, ! TGKEY_1 = 49, ! TGKEY_2 = 50, ! TGKEY_3 = 51, ! TGKEY_4 = 52, ! TGKEY_5 = 53, ! TGKEY_6 = 54, ! TGKEY_7 = 55, ! TGKEY_8 = 56, ! TGKEY_9 = 57, ! TGKEY_COLON = 58, ! TGKEY_SEMICOLON = 59, ! TGKEY_LESS = 60, ! TGKEY_EQUALS = 61, ! TGKEY_GREATER = 62, ! TGKEY_QUESTION = 63, ! TGKEY_AT = 64, ! ! TGKEY_LEFTBRACKET = 91, ! TGKEY_BACKSLASH = 92, ! TGKEY_RIGHTBRACKET = 93, ! TGKEY_CARET = 94, ! TGKEY_UNDERSCORE = 95, ! TGKEY_BACKQUOTE = 96, ! TGKEY_a = 97, ! TGKEY_b = 98, ! TGKEY_c = 99, ! TGKEY_d = 100, ! TGKEY_e = 101, ! TGKEY_f = 102, ! TGKEY_g = 103, ! TGKEY_h = 104, ! TGKEY_i = 105, ! TGKEY_j = 106, ! TGKEY_k = 107, ! TGKEY_l = 108, ! TGKEY_m = 109, ! TGKEY_n = 110, ! TGKEY_o = 111, ! TGKEY_p = 112, ! TGKEY_q = 113, ! TGKEY_r = 114, ! TGKEY_s = 115, ! TGKEY_t = 116, ! TGKEY_u = 117, ! TGKEY_v = 118, ! TGKEY_w = 119, ! TGKEY_x = 120, ! TGKEY_y = 121, ! TGKEY_z = 122, ! TGKEY_DELETE = 127, ! ! TGKEY_WORLD_0 = 160, ! TGKEY_WORLD_1 = 161, ! TGKEY_WORLD_2 = 162, ! TGKEY_WORLD_3 = 163, ! TGKEY_WORLD_4 = 164, ! TGKEY_WORLD_5 = 165, ! TGKEY_WORLD_6 = 166, ! TGKEY_WORLD_7 = 167, ! TGKEY_WORLD_8 = 168, ! TGKEY_WORLD_9 = 169, ! TGKEY_WORLD_10 = 170, ! TGKEY_WORLD_11 = 171, ! TGKEY_WORLD_12 = 172, ! TGKEY_WORLD_13 = 173, ! TGKEY_WORLD_14 = 174, ! TGKEY_WORLD_15 = 175, ! TGKEY_WORLD_16 = 176, ! TGKEY_WORLD_17 = 177, ! TGKEY_WORLD_18 = 178, ! TGKEY_WORLD_19 = 179, ! TGKEY_WORLD_20 = 180, ! TGKEY_WORLD_21 = 181, ! TGKEY_WORLD_22 = 182, ! TGKEY_WORLD_23 = 183, ! TGKEY_WORLD_24 = 184, ! TGKEY_WORLD_25 = 185, ! TGKEY_WORLD_26 = 186, ! TGKEY_WORLD_27 = 187, ! TGKEY_WORLD_28 = 188, ! TGKEY_WORLD_29 = 189, ! TGKEY_WORLD_30 = 190, ! TGKEY_WORLD_31 = 191, ! TGKEY_WORLD_32 = 192, ! TGKEY_WORLD_33 = 193, ! TGKEY_WORLD_34 = 194, ! TGKEY_WORLD_35 = 195, ! TGKEY_WORLD_36 = 196, ! TGKEY_WORLD_37 = 197, ! TGKEY_WORLD_38 = 198, ! TGKEY_WORLD_39 = 199, ! TGKEY_WORLD_40 = 200, ! TGKEY_WORLD_41 = 201, ! TGKEY_WORLD_42 = 202, ! TGKEY_WORLD_43 = 203, ! TGKEY_WORLD_44 = 204, ! TGKEY_WORLD_45 = 205, ! TGKEY_WORLD_46 = 206, ! TGKEY_WORLD_47 = 207, ! TGKEY_WORLD_48 = 208, ! TGKEY_WORLD_49 = 209, ! TGKEY_WORLD_50 = 210, ! TGKEY_WORLD_51 = 211, ! TGKEY_WORLD_52 = 212, ! TGKEY_WORLD_53 = 213, ! TGKEY_WORLD_54 = 214, ! TGKEY_WORLD_55 = 215, ! TGKEY_WORLD_56 = 216, ! TGKEY_WORLD_57 = 217, ! TGKEY_WORLD_58 = 218, ! TGKEY_WORLD_59 = 219, ! TGKEY_WORLD_60 = 220, ! TGKEY_WORLD_61 = 221, ! TGKEY_WORLD_62 = 222, ! TGKEY_WORLD_63 = 223, ! TGKEY_WORLD_64 = 224, ! TGKEY_WORLD_65 = 225, ! TGKEY_WORLD_66 = 226, ! TGKEY_WORLD_67 = 227, ! TGKEY_WORLD_68 = 228, ! TGKEY_WORLD_69 = 229, ! TGKEY_WORLD_70 = 230, ! TGKEY_WORLD_71 = 231, ! TGKEY_WORLD_72 = 232, ! TGKEY_WORLD_73 = 233, ! TGKEY_WORLD_74 = 234, ! TGKEY_WORLD_75 = 235, ! TGKEY_WORLD_76 = 236, ! TGKEY_WORLD_77 = 237, ! TGKEY_WORLD_78 = 238, ! TGKEY_WORLD_79 = 239, ! TGKEY_WORLD_80 = 240, ! TGKEY_WORLD_81 = 241, ! TGKEY_WORLD_82 = 242, ! TGKEY_WORLD_83 = 243, ! TGKEY_WORLD_84 = 244, ! TGKEY_WORLD_85 = 245, ! TGKEY_WORLD_86 = 246, ! TGKEY_WORLD_87 = 247, ! TGKEY_WORLD_88 = 248, ! TGKEY_WORLD_89 = 249, ! TGKEY_WORLD_90 = 250, ! TGKEY_WORLD_91 = 251, ! TGKEY_WORLD_92 = 252, ! TGKEY_WORLD_93 = 253, ! TGKEY_WORLD_94 = 254, ! TGKEY_WORLD_95 = 255, ! ! TGKEY_KP0 = 256, ! TGKEY_KP1 = 257, ! TGKEY_KP2 = 258, ! TGKEY_KP3 = 259, ! TGKEY_KP4 = 260, ! TGKEY_KP5 = 261, ! TGKEY_KP6 = 262, ! TGKEY_KP7 = 263, ! TGKEY_KP8 = 264, ! TGKEY_KP9 = 265, ! TGKEY_KP_PERIOD = 266, ! TGKEY_KP_DIVIDE = 267, ! TGKEY_KP_MULTIPLY = 268, ! TGKEY_KP_MINUS = 269, ! TGKEY_KP_PLUS = 270, ! TGKEY_KP_ENTER = 271, ! TGKEY_KP_EQUALS = 272, ! ! TGKEY_UP = 273, ! TGKEY_DOWN = 274, ! TGKEY_RIGHT = 275, ! TGKEY_LEFT = 276, ! TGKEY_INSERT = 277, ! TGKEY_HOME = 278, ! TGKEY_END = 279, ! TGKEY_PAGEUP = 280, ! TGKEY_PAGEDOWN = 281, ! ! TGKEY_F1 = 282, ! TGKEY_F2 = 283, ! TGKEY_F3 = 284, ! TGKEY_F4 = 285, ! TGKEY_F5 = 286, ! TGKEY_F6 = 287, ! TGKEY_F7 = 288, ! TGKEY_F8 = 289, ! TGKEY_F9 = 290, ! TGKEY_F10 = 291, ! TGKEY_F11 = 292, ! TGKEY_F12 = 293, ! TGKEY_F13 = 294, ! TGKEY_F14 = 295, ! TGKEY_F15 = 296, ! ! TGKEY_NUMLOCK = 300, ! TGKEY_CAPSLOCK = 301, ! TGKEY_SCROLLOCK = 302, ! TGKEY_RSHIFT = 303, ! TGKEY_LSHIFT = 304, ! TGKEY_RCTRL = 305, ! TGKEY_LCTRL = 306, ! TGKEY_RALT = 307, ! TGKEY_LALT = 308, ! TGKEY_RMETA = 309, ! TGKEY_LMETA = 310, ! TGKEY_LSUPER = 311, ! TGKEY_RSUPER = 312, ! TGKEY_MODE = 313, ! TGKEY_COMPOSE = 314, ! ! TGKEY_HELP = 315, ! TGKEY_PRINT = 316, ! TGKEY_SYSREQ = 317, ! TGKEY_BREAK = 318, ! TGKEY_MENU = 319, ! TGKEY_POWER = 320, ! TGKEY_EURO = 321, ! TGKEY_UNDO = 322, ! ! TGKEY_LAST ! }; ! ! /// Just a rename... ! typedef SDLMod tgKeyMod; ! ! /// Event type codes. Used to indentify the type of an event occuring. ! enum tgEventType { ! evActiveEvent, ! evBroadcast, ! evKeyDown, ! evKeyUp, ! evMouseMotion, ! evMouseButtonDown, ! evMouseButtonUp, ! evQuit ! }; ! ! /// Event command codes. ! enum tgEventCmdCode { ! cmdPreFrame, ! cmdProcessFrame, ! cmdPostFrame, ! cmdToggleFullscreen ! }; ! ! /// Application focus states. ! enum tgAppActiveState { ! tgAppMouseFocus, ! tgAppInputFocus, ! tgAppActive ! }; ! ! /// Button states for press/release. ! enum tgButtonState { ! tgPressed, ! tgReleased ! }; ! ! /// Mouse button definitions. ! enum tgMouseButton { ! tgButtonLeft = 1, ! tgButtonMiddle = 2, ! tgButtonRight = 3 ! }; ! ! /// Mouse button states for press/release. ! enum tgMouseButtonState { ! tgNonePressed = 0, ! tgLeftPressed = 1, ! tgMiddlePressed = 2, ! tgRightPressed = 3 ! }; ! ! /** ! * Holds info for app focus gain/lost event. ! * ! */ ! struct tgActiveEvent { ! /// Event type. ! tgEventType type; ! /// Whether it was gain or loss. 0 = loss, 1 = gain. ! uint8 gain; ! /// App focus state. ! tgAppActiveState state; ! }; ! ! /** ! * Event command struct. ! * ! */ ! struct tgEventCommand { ! /// Event command code. ! tgEventCmdCode code; ! }; ! ! /** ! * Key press info. ! * ! */ ! struct tgKeySym { ! /// Scancode. ! uint8 scancode; ! /// The key this event occured on. ! tgKey sym; ! /// Modified key. ! tgKeyMod mod; ! /// Unicode. ! uint16 unicode; ! }; ! ! /** ! * Keyboard event struct. ! * ! */ ! struct tgKeyboardEvent { ! /// Event type. ! tgEventType type; ! /// Button state. ! tgButtonState state; ! // Key press information. ! tgKeySym keysym; ! }; ! ! /** ! * Mouse motion event struct. ! * ! */ ! struct tgMouseMotionEvent { ! /// Event type. ! tgEventType type; ! /// Mouse button state. ! tgMouseButtonState state; ! /// X and Y pos of the mouse cursor. ! uint16 x, y; ! /// The change in mouse X and Y from the last position. ! sint16 xrel, yrel; ! }; ! ! /** ! * Mouse button event struct. ! * ! */ ! struct tgMouseButtonEvent { ! /// Event type. ! tgEventType type; ! /// Mouse button this even occured on. ! tgMouseButton button; ! /// Button state. ! tgButtonState state; ! /// Mouse position. ! uint16 x, y; ! }; ! ! /** ! * Quit event. Used on application quit. ! * ! */ ! struct tgQuitEvent { ! /// Event type. ! tgEventType type; ! }; ! ! /** ! * The TG event structure. ! * ! */ ! struct tgEvent { ! /// Event type. ! tgEventType type; ! /// Event command. ! tgEventCommand cmd; ! /// Active event. ! tgActiveEvent active; ! /// Keyboard event. ! tgKeyboardEvent key; ! /// Mouse motion event. ! tgMouseMotionEvent motion; ! /// Mouse button event. ! tgMouseButtonEvent button; ! /// Quit event. ! tgQuitEvent quit; ! }; ! ! ! /** @} */ ! } ! #endif // __TGLIB_TGENGINE_EVENT_H__ Index: gldefs.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/gldefs.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gldefs.h 27 Sep 2004 19:33:58 -0000 1.2 --- gldefs.h 28 Sep 2004 09:44:26 -0000 1.3 *************** *** 11,16 **** #include <GL/glext.h> #endif ! #include <SDL.h> #define TG_CUBEMAP GL_TEXTURE1 --- 11,19 ---- #include <GL/glext.h> #endif ! #ifdef TGWIN32 ! #include <SDL/SDL.h> ! #else #include <SDL.h> + #endif #define TG_CUBEMAP GL_TEXTURE1 *************** *** 18,22 **** #define TG_NORMALMAP GL_TEXTURE0 ! //Vbos --- 21,26 ---- #define TG_NORMALMAP GL_TEXTURE0 ! #define GL_VERTEX_PROGRAM_ARB 0x8620 ! #define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 //Vbos |