From 089475041fe26964d72cb2ebc3559a36ba89a2f2 Mon Sep 17 00:00:00 2001 From: "N.N." Date: Tue, 8 Jul 2008 05:56:10 +0000 Subject: trying to import gridflow 0.9.4 svn path=/trunk/; revision=10148 --- externals/gridflow/bundled/Base/GemState.h | 150 +++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 externals/gridflow/bundled/Base/GemState.h (limited to 'externals/gridflow/bundled/Base/GemState.h') diff --git a/externals/gridflow/bundled/Base/GemState.h b/externals/gridflow/bundled/Base/GemState.h new file mode 100644 index 00000000..b41d2ee3 --- /dev/null +++ b/externals/gridflow/bundled/Base/GemState.h @@ -0,0 +1,150 @@ +/*----------------------------------------------------------------- + LOG + GEM - Graphics Environment for Multimedia + + The state to pass among GEM objects + + Copyright (c) 1997-2000 Mark Danks. mark@danks.org + Copyright (c) Günther Geiger. geiger@epy.co.at + Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::für::umläute. IEM. zmoelnig@iem.kug.ac.at + For information on usage and redistribution, and for a DISCLAIMER OF ALL + WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. + + -----------------------------------------------------------------*/ + +#ifndef INCLUDE_GEMSTATE_H_ +#define INCLUDE_GEMSTATE_H_ + +#include "Base/GemExportDef.h" +#include "Base/GemGL.h" + +struct pixBlock; +class TexCoord; + +/*----------------------------------------------------------------- + ------------------------------------------------------------------- + CLASS + TexCoord + + + DESCRIPTION + + -----------------------------------------------------------------*/ +class GEM_EXTERN TexCoord +{ + public: + TexCoord() : s(0.f), t(0.f) { } + TexCoord(float s_, float t_) : s(s_), t(t_) { } + float s; + float t; +}; + + +/*----------------------------------------------------------------- + ------------------------------------------------------------------- + CLASS + GemState + + The state to pass among GEM objects + + DESCRIPTION + + -----------------------------------------------------------------*/ +class GEM_EXTERN GemState +{ + public: + + ////////// + // Has something changed since the last time? + int dirty; + + ////////// + // Are we in a display list creation? + int inDisplayList; + + ////////// + // Lighting on? + int lighting; + + ////////// + // Smooth shading (flat is other type) + int smooth; + + ////////// + // Texture mapping on? + // 0..off + // 1..normalized texture + // 2..rectangle texture + int texture; + + ////////// + // The image to texture map + pixBlock *image; + + ////////// + // Texture coordinates. + // This can be NULL if there aren't any coordinates + TexCoord *texCoords; + + ////////// + // The number of TexCoords + int numTexCoords; + + ////////// + // The number of multiTexUnits + // default = 0, max = 7 + int multiTexUnits; + + ////////// + // Milliseconds since last frame + // If in Stereoscopic mode, then it is the same number for both left + // and right renderings + float tickTime; + + ////////////////// + // the default draw-type (might be overriden within a Geo) + GLenum drawType; + + ////////// + // how deep is the current stack /* 4 fields for the 4 stacks */ + int stackDepth[4]; + + //////////// + //vertex-array data + int VertexDirty; // the vertex-arrays has changed + + GLfloat *VertexArray; + int VertexArraySize; + int VertexArrayStride; + + GLfloat *ColorArray; + int HaveColorArray; + + GLfloat *NormalArray; + int HaveNormalArray; + + GLfloat *TexCoordArray; + int HaveTexCoordArray; + + ////////// + // Constructor + GemState(); + + float texCoordX(int num) { + if (texture && numTexCoords > num) + return texCoords[num].s; + else return 0.; + } + + float texCoordY(int num) { + if (texture && numTexCoords > num) + return texCoords[num].t; + else return 0.; + } + + /* reset (parts of?) the GemState: to be called from [gemhead] */ + void reset(); + +}; + +#endif // for header file -- cgit v1.2.1