Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gfxlib_struct.h File Reference
#include "gfx/vec.h"
#include "endianness.h"

Go to the source code of this file.

Classes

struct  GFXVertex
 Vertex, Normal, Texture, and (deprecated) Environment Mapping T2F_N3F_V3F format. More...
 
struct  GFXColor
 
struct  GFXColorVertex
 This vertex is used for the interleaved array argument for color based arrays T2F_C4F_N3F_V3F. More...
 
class  GFXLight
 Holds all information for a single light object. More...
 
struct  GFXTVertex
 Contains 4 texture coordinates (deprecated) More...
 
struct  GFXLightLocal
 
class  GFXQuadList
 
class  GFXVertexList
 
union  GFXVertexList::VDAT
 Vertices and colors stored. More...
 
union  GFXVertexList::INDEX
 
class  GFXSphereVertexList
 
struct  GFXMaterial
 
struct  PickData
 Pick data structures. More...
 

Macros

#define GFXBOOL   unsigned char
 
#define GFXTRUE   1
 
#define GFXFALSE   0
 
#define USE_DISPLAY_LISTS
 

Enumerations

enum  LIGHT_TARGET {
  ATTENUATE =1, DIFFUSE =2, SPECULAR =4, AMBIENT =8,
  POSITION =16, EMISSION =32
}
 important ATTENUATE const STAYS AT ONE...for w compat. More...
 
enum  POLYTYPE {
  GFXTRI, GFXQUAD, GFXLINE, GFXTRISTRIP,
  GFXQUADSTRIP, GFXTRIFAN, GFXLINESTRIP, GFXPOLY,
  GFXPOINT
}
 
enum  POLYMODE { GFXPOINTMODE, GFXLINEMODE, GFXFILLMODE }
 
enum  POLYFACE { GFXFRONT, GFXBACK, GFXFRONTANDBACK }
 
enum  TEXTURE_TARGET {
  TEXTURE1D, TEXTURE2D, TEXTURE3D, CUBEMAP,
  TEXTURERECT
}
 
enum  TEXTURE_IMAGE_TARGET {
  TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, CUBEMAP_POSITIVE_X,
  CUBEMAP_NEGATIVE_X, CUBEMAP_POSITIVE_Y, CUBEMAP_NEGATIVE_Y, CUBEMAP_POSITIVE_Z,
  CUBEMAP_NEGATIVE_Z, TEXTURE_RECTANGLE
}
 Textures may only be cube maps, Texture1d, Texture2d or Texture3d. More...
 
enum  MATRIXMODE { MODEL, PROJECTION, VIEW }
 
enum  TEXTUREFORMAT {
  DUMMY =0, PALETTE8 =1, RGB16 =2, RGBA16 =3,
  RGB24 =4, RGBA32 =5, RGB32 =6, DXT1 =7,
  DXT1RGBA =8, DXT3 =9, DXT5 =10, PNGPALETTE8 =11,
  PNGRGB24 =12, PNGRGBA32 =13
}
 
enum  STATE {
  LIGHTING, DEPTHTEST, DEPTHWRITE, COLORWRITE,
  TEXTURE0, TEXTURE1, CULLFACE, SMOOTH,
  STENCIL
}
 
enum  CLIPSTATE { GFX_NOT_VISIBLE, GFX_PARTIALLY_VISIBLE, GFX_TOTALLY_VISIBLE }
 
enum  ADDRESSMODE {
  WRAP, MIRROR, CLAMP, BORDER,
  DEFAULT_ADDRESS_MODE
}
 
enum  FOGMODE { FOG_OFF, FOG_EXP, FOG_EXP2, FOG_LINEAR }
 
enum  BLENDFUNC {
  ZERO =1, ONE =2, SRCCOLOR =3, INVSRCCOLOR =4,
  SRCALPHA =5, INVSRCALPHA =6, DESTALPHA =7, INVDESTALPHA =8,
  DESTCOLOR =9, INVDESTCOLOR =10, SRCALPHASAT =11, CONSTALPHA =12,
  INVCONSTALPHA =13, CONSTCOLOR =14, INVCONSTCOLOR =15
}
 
enum  FILTER { NEAREST =0x0, BILINEAR =0x1, MIPMAP =0x2, TRILINEAR =0x4 }
 
enum  DEPTHFUNC {
  NEVER, LESS, EQUAL, LEQUAL,
  GREATER, NEQUAL, GEQUAL, ALWAYS
}
 
enum  STENCILOP {
  KEEP, CLEAR, REPLACE, INCR,
  DECR, INVERT
}
 

Functions

int GFXCreateList ()
 Creates a Display list. 0 is returned if no memory is avail for a display list. More...
 
GFXBOOL GFXEndList ()
 Ends the display list call. Returns false if unsuccessful. More...
 
void GFXDeleteList (int list)
 Removes a display list from application memory. More...
 
GFXColor operator* (float s, const GFXColor &c)
 
GFXColor operator* (const GFXColor &c, float s)
 
GFXColor operator+ (const GFXColor &c0, const GFXColor &c1)
 
GFXColor operator- (const GFXColor &c0, const GFXColor &c1)
 

Variables

const int INDEX_BYTE = sizeof (unsigned char)
 
const int INDEX_SHORT = sizeof (unsigned short)
 
const int INDEX_INT = sizeof (unsigned int)
 
const int CHANGE_MUTABLE = (sizeof (unsigned int)*2)
 
const int CHANGE_CHANGE = (sizeof (unsigned int)*4)
 
const int HAS_COLOR = (sizeof (unsigned int)*8)
 
const int HAS_INDEX = sizeof (unsigned char)|sizeof (unsigned short)|sizeof (unsigned int)
 

Macro Definition Documentation

#define GFXBOOL   unsigned char

Definition at line 27 of file gfxlib_struct.h.

Referenced by GFXCreateLightContext().

#define USE_DISPLAY_LISTS

Definition at line 38 of file gfxlib_struct.h.

Enumeration Type Documentation

Address modes various textures may have

Enumerator
WRAP 
MIRROR 
CLAMP 
BORDER 
DEFAULT_ADDRESS_MODE 

Definition at line 780 of file gfxlib_struct.h.

781 {
782  WRAP,
783  MIRROR,
784  CLAMP,
785  BORDER,
787 };
enum BLENDFUNC

Blend functions that a blendmode may have Not all work for all systems

Enumerator
ZERO 
ONE 
SRCCOLOR 
INVSRCCOLOR 
SRCALPHA 
INVSRCALPHA 
DESTALPHA 
INVDESTALPHA 
DESTCOLOR 
INVDESTCOLOR 
SRCALPHASAT 
CONSTALPHA 
INVCONSTALPHA 
CONSTCOLOR 
INVCONSTCOLOR 

Definition at line 799 of file gfxlib_struct.h.

800 {
801  ZERO=1,
802  ONE=2,
803  SRCCOLOR=3,
804  INVSRCCOLOR =4,
805  SRCALPHA =5,
806  INVSRCALPHA =6,
807  DESTALPHA =7,
808  INVDESTALPHA =8,
809  DESTCOLOR =9,
810  INVDESTCOLOR =10,
811  SRCALPHASAT =11,
812  CONSTALPHA =12,
813  INVCONSTALPHA=13,
814  CONSTCOLOR =14,
815  INVCONSTCOLOR=15
816 };
enum CLIPSTATE
Enumerator
GFX_NOT_VISIBLE 
GFX_PARTIALLY_VISIBLE 
GFX_TOTALLY_VISIBLE 

Definition at line 770 of file gfxlib_struct.h.

771 {
775 };
enum DEPTHFUNC

Used for depth and alpha comparisons

Enumerator
NEVER 
LESS 
EQUAL 
LEQUAL 
GREATER 
NEQUAL 
GEQUAL 
ALWAYS 

Definition at line 833 of file gfxlib_struct.h.

834 {
836 };
enum FILTER

Different types of filtering. Bilinear and mipmap are independent params (hence powers of two)

Enumerator
NEAREST 
BILINEAR 
MIPMAP 
TRILINEAR 

Definition at line 822 of file gfxlib_struct.h.

823 {
824  NEAREST =0x0,
825  BILINEAR =0x1,
826  MIPMAP =0x2,
827  TRILINEAR=0x4
828 };
enum FOGMODE
Enumerator
FOG_OFF 
FOG_EXP 
FOG_EXP2 
FOG_LINEAR 

Definition at line 789 of file gfxlib_struct.h.

790 {
791  FOG_OFF,
792  FOG_EXP,
793  FOG_EXP2,
794  FOG_LINEAR
795 };

important ATTENUATE const STAYS AT ONE...for w compat.

Enumerator
ATTENUATE 
DIFFUSE 
SPECULAR 
AMBIENT 
POSITION 
EMISSION 

Definition at line 330 of file gfxlib_struct.h.

331 {
332  ATTENUATE=1,
333  DIFFUSE =2,
334  SPECULAR =4,
335  AMBIENT =8,
336  POSITION =16,
337  EMISSION =32
338 };
enum MATRIXMODE

Unlike OpenGL, 3 matrices are saved, the Model, the View and the Projection Consistency is maintained through pushing the rotation part of view onto projection matrix

Enumerator
MODEL 
PROJECTION 
VIEW 

Definition at line 728 of file gfxlib_struct.h.

729 {
730  MODEL,
731  PROJECTION,
732  VIEW
733 };
enum POLYFACE
Enumerator
GFXFRONT 
GFXBACK 
GFXFRONTANDBACK 

Definition at line 440 of file gfxlib_struct.h.

441 {
442  GFXFRONT,
443  GFXBACK,
445 };
enum POLYMODE
Enumerator
GFXPOINTMODE 
GFXLINEMODE 
GFXFILLMODE 

Definition at line 433 of file gfxlib_struct.h.

434 {
435  GFXPOINTMODE,
436  GFXLINEMODE,
438 };
enum POLYTYPE
Enumerator
GFXTRI 
GFXQUAD 
GFXLINE 
GFXTRISTRIP 
GFXQUADSTRIP 
GFXTRIFAN 
GFXLINESTRIP 
GFXPOLY 
GFXPOINT 

Definition at line 420 of file gfxlib_struct.h.

421 {
422  GFXTRI,
423  GFXQUAD,
424  GFXLINE,
425  GFXTRISTRIP,
426  GFXQUADSTRIP,
427  GFXTRIFAN,
428  GFXLINESTRIP,
429  GFXPOLY,
430  GFXPOINT
431 };
enum STATE

The following state may be activated/deactivated LIGHTING, DEPTHTEST,DEPTHWRITE, TEXTURE0, and TEXTURE1. Future support For arbitrary number of texture units should be added FIXME

Enumerator
LIGHTING 
DEPTHTEST 
DEPTHWRITE 
COLORWRITE 
TEXTURE0 
TEXTURE1 
CULLFACE 
SMOOTH 
STENCIL 

Definition at line 757 of file gfxlib_struct.h.

758 {
759  LIGHTING,
760  DEPTHTEST,
761  DEPTHWRITE,
762  COLORWRITE,
763  TEXTURE0,
764  TEXTURE1,
765  CULLFACE,
766  SMOOTH,
767  STENCIL
768 };
enum STENCILOP

Used for stencil writes

Enumerator
KEEP 
CLEAR 
REPLACE 
INCR 
DECR 
INVERT 

Definition at line 841 of file gfxlib_struct.h.

842 {
844 };

Textures may only be cube maps, Texture1d, Texture2d or Texture3d.

Enumerator
TEXTURE_1D 
TEXTURE_2D 
TEXTURE_3D 
CUBEMAP_POSITIVE_X 
CUBEMAP_NEGATIVE_X 
CUBEMAP_POSITIVE_Y 
CUBEMAP_NEGATIVE_Y 
CUBEMAP_POSITIVE_Z 
CUBEMAP_NEGATIVE_Z 
TEXTURE_RECTANGLE 

Definition at line 709 of file gfxlib_struct.h.

Enumerator
TEXTURE1D 
TEXTURE2D 
TEXTURE3D 
CUBEMAP 
TEXTURERECT 

Definition at line 700 of file gfxlib_struct.h.

701 {
702  TEXTURE1D,
703  TEXTURE2D,
704  TEXTURE3D,
705  CUBEMAP,
707 };
Enumerator
DUMMY 
PALETTE8 
RGB16 
RGBA16 
RGB24 
RGBA32 
RGB32 
DXT1 
DXT1RGBA 
DXT3 
DXT5 
PNGPALETTE8 
PNGRGB24 
PNGRGBA32 

Definition at line 735 of file gfxlib_struct.h.

736 {
737  DUMMY=0,
738  PALETTE8 =1,
739  RGB16 =2,
740  RGBA16 =3,
741  RGB24 =4,
742  RGBA32 =5,
743  RGB32 =6,
744  DXT1 =7,
745  DXT1RGBA =8,
746  DXT3 =9,
747  DXT5 =10,
748  PNGPALETTE8=11,
749  PNGRGB24 =12,
750  PNGRGBA32 =13
751 };

Function Documentation

int GFXCreateList ( )

Creates a Display list. 0 is returned if no memory is avail for a display list.

Definition at line 73 of file gfxlib_struct_server.cpp.

Referenced by CreateLists(), and GFXVertexList::RefreshDisplayList().

74 {
75  return 0;
76 }
void GFXDeleteList ( int  list)

Removes a display list from application memory.

Definition at line 83 of file gfxlib_struct_server.cpp.

Referenced by GFXVertexList::RefreshDisplayList(), and GFXVertexList::~GFXVertexList().

83 {}
GFXBOOL GFXEndList ( )

Ends the display list call. Returns false if unsuccessful.

Definition at line 78 of file gfxlib_struct_server.cpp.

References GFXFALSE.

Referenced by CreateLists(), and GFXVertexList::RefreshDisplayList().

79 {
80  return GFXFALSE;
81 }
GFXColor operator* ( float  s,
const GFXColor c 
)
inline

Definition at line 194 of file gfxlib_struct.h.

References GFXColor::a, GFXColor::b, GFXColor::g, and GFXColor::r.

195 {
196  return GFXColor( s*c.r, s*c.g, s*c.b, s*c.a );
197 }
GFXColor operator* ( const GFXColor c,
float  s 
)
inline

Definition at line 198 of file gfxlib_struct.h.

References GFXColor::a, GFXColor::b, GFXColor::g, and GFXColor::r.

199 {
200  return GFXColor( s*c.r, s*c.g, s*c.b, s*c.a );
201 }
GFXColor operator+ ( const GFXColor c0,
const GFXColor c1 
)
inline

Definition at line 202 of file gfxlib_struct.h.

References GFXColor::a, GFXColor::b, GFXColor::g, and GFXColor::r.

203 {
204  return GFXColor( c0.r+c1.r, c0.g+c1.g, c0.b+c1.b, c0.a+c1.a );
205 }
GFXColor operator- ( const GFXColor c0,
const GFXColor c1 
)
inline

Definition at line 206 of file gfxlib_struct.h.

References GFXColor::a, GFXColor::b, GFXColor::g, and GFXColor::r.

207 {
208  return GFXColor( c0.r-c1.r, c0.g-c1.g, c0.b-c1.b, c0.a-c1.a );
209 }

Variable Documentation

const int CHANGE_CHANGE = (sizeof (unsigned int)*4)
const int CHANGE_MUTABLE = (sizeof (unsigned int)*2)
const int HAS_INDEX = sizeof (unsigned char)|sizeof (unsigned short)|sizeof (unsigned int)
const int INDEX_BYTE = sizeof (unsigned char)
const int INDEX_INT = sizeof (unsigned int)

Definition at line 34 of file gfxlib_struct.h.

Referenced by GFXVertexList::Init().

const int INDEX_SHORT = sizeof (unsigned short)