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.cpp File Reference
#include "gfxlib_struct.h"
#include "gfxlib.h"
#include "gldrv/gl_globals.h"
#include <stdio.h>
#include "xml_support.h"
#include "config_xml.h"
#include "vs_globals.h"
#include "vs_random.h"
#include "vsfilesystem.h"
#include "options.h"
#include <vector>

Go to the source code of this file.

Functions

GLenum PolyLookup (POLYTYPE poly)
 
static void BindBuf (unsigned int vbo_data)
 
static void BindInd (unsigned int element_data)
 
static void clear_gl_error ()
 
static void print_gl_error (const char *fmt)
 
void GFXColor4f (const float r, const float g, const float b, const float a)
 Specifies a color for henceforth drawn vertices to share. More...
 
void GFXCallList (int list)
 Draws a given display list. More...
 
void SetVector (const double factor, Vector *pv)
 local helper funcs for procedural Modification More...
 

Variables

vs_options game_options
 

Function Documentation

static void BindBuf ( unsigned int  vbo_data)
static

Definition at line 53 of file gfxlib_struct.cpp.

Referenced by GFXVertexList::BeginDrawState(), GFXVertexList::Map(), GFXVertexList::RefreshDisplayList(), and GFXVertexList::UnMap().

54 {
55  (*glBindBufferARB_p)(GL_ARRAY_BUFFER_ARB, vbo_data);
56 }
static void BindInd ( unsigned int  element_data)
static

Definition at line 57 of file gfxlib_struct.cpp.

Referenced by GFXVertexList::BeginDrawState(), GFXVertexList::Draw(), GFXVertexList::Map(), GFXVertexList::RefreshDisplayList(), and GFXVertexList::UnMap().

58 {
59  (*glBindBufferARB_p)(GL_ELEMENT_ARRAY_BUFFER_ARB, element_data);
60 }
static void clear_gl_error ( )
static

Definition at line 61 of file gfxlib_struct.cpp.

Referenced by GFXVertexList::BeginDrawState().

62 {
63  glGetError();
64 }
void GFXCallList ( int  list)

Draws a given display list.

Definition at line 312 of file gl_misc.cpp.

313 {
314 //VSFileSystem::Fprintf (stderr,"CallListStart");///causes crash with GF2 privaledge instruction on Win2k in certain instances
315 //fflush (stderr);
316  glCallList( list );
317 //VSFileSystem::Fprintf (stderr,"CallListEnd");
318 //fflush (stderr);
319 }
void GFXColor4f ( const float  r,
const float  g,
const float  b,
const float  a 
)

Specifies a color for henceforth drawn vertices to share.

Definition at line 214 of file gl_misc.cpp.

215 {
216  glColor4f( r, g, b, a );
217 }
GLenum PolyLookup ( POLYTYPE  poly)

Definition at line 17 of file gfxlib_struct.cpp.

References GFXLINE, GFXLINESTRIP, GFXPOINT, GFXPOLY, GFXQUAD, GFXQUADSTRIP, GFXTRI, GFXTRIFAN, and GFXTRISTRIP.

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

18 {
19  switch (poly)
20  {
21  case GFXTRI:
22  return GL_TRIANGLES;
23 
24  case GFXQUAD:
25  return GL_QUADS;
26 
27  case GFXTRISTRIP:
28  return GL_TRIANGLE_STRIP;
29 
30  case GFXQUADSTRIP:
31  return GL_QUAD_STRIP;
32 
33  case GFXTRIFAN:
34  return GL_TRIANGLE_FAN;
35 
36  case GFXPOLY:
37  return GL_POLYGON;
38 
39  case GFXLINE:
40  return GL_LINES;
41 
42  case GFXLINESTRIP:
43  return GL_LINE_STRIP;
44 
45  case GFXPOINT:
46  return GL_POINTS;
47 
48  default:
49  return GL_TRIANGLES;
50  }
51 }
static void print_gl_error ( const char *  fmt)
static

Definition at line 65 of file gfxlib_struct.cpp.

References VSFileSystem::vs_dprintf().

Referenced by GFXVertexList::BeginDrawState().

66 {
67  GLenum gl_error;
68  if ((gl_error = glGetError()))
69  VSFileSystem::vs_dprintf(1, fmt, gl_error);
70 }
void SetVector ( const double  factor,
Vector pv 
)

local helper funcs for procedural Modification

Definition at line 631 of file gfxlib_struct.cpp.

Referenced by GFXSphereVertexList::ProceduralModification().

631  {
632  pv->i = pv->i * factor;
633  pv->j = pv->j * factor;
634  pv->k = pv->k * factor;
635 }

Variable Documentation

vs_options game_options

Draws cockpit parts Draws gauges, info strings, radar, ...

Definition at line 83 of file main.cpp.