gfx_opengl.cc File Reference

Facade for graphics system (OpenGL). More...

#include "base.hh"
#include "base_misc.hh"
#include "base_file.hh"
#include "base_settings.hh"
#include "inp.hh"
#include "inp_queue.hh"
#include "gfx.hh"
#include "gfx_events.hh"
#include "gfx_opengl.hh"
#include "gfx_settings.hh"

Namespaces

namespace  gfx

Classes

struct  gfx::BlendImageState

Defines

#define GFX_OPENGL_CC   1
#define RETURN_IF_VECTOR_OUTSIDE_FRUSTUM(i)
#define RETURN_FALSE_IF_SPHERE_OUTSIDE_FRUSTUM(i)

Variables

static BlendImageState gfx::sBlendImage


Detailed Description

Facade for graphics system (OpenGL).

Id
LastChangedDate

Author:
Jim E. Brooks http://www.palomino3d.org
 * -----------------------------------------------------------------------------
 * NOTE: To avoid inconsistent state, whenever possible, GFX methods should be
 * called instead of directly calling OpenGL functions.
 *
 * Some GFX methods test and update flags as an optimization to bypass OpenGL state changes,
 * so directly calling OpenGL functions would undermine state tracking.
 * Eg, directly calling glDepthMask() could contradict what GFX::SetDepthMask()
 * thinks the state of the depth mask really is.
 * -----------------------------------------------------------------------------
 * Normal modes:
 * - depth test enabled
 * - depth mask enabled
 * - blending disabled
 * Blocks which change these modes should revert them before leaving.
 * -----------------------------------------------------------------------------
 * Blending and depth-test:
 * Whether to enable depth test during blending varies.
 * Graphics literature say to disable depth test for proper blending,
 * but Palomino has exceptions.  Polygon class draws translucent polygons
 * with depth test enabled because the Engine doesn't sort polygons
 * If depth test was disabled, a Craft's cockpit glass could be visible thru
 * its fuselage when viewed from underneath.   Trees (via TexQuad) are also blended
 * with depth test enabled because the sorting of hills and trees WRT each other
 * isn't accurate (due to radius approximation).
 * -----------------------------------------------------------------------------
 * 

Define Documentation

#define GFX_OPENGL_CC   1

#define RETURN_FALSE_IF_SPHERE_OUTSIDE_FRUSTUM (  ) 

Value:

if ( msFrustum[i][0] * origin.x                     \
       + msFrustum[i][1] * origin.y                     \
       + msFrustum[i][2] * origin.z                     \
       + msFrustum[i][3] <= negRadius )                 \
        return false;

#define RETURN_IF_VECTOR_OUTSIDE_FRUSTUM (  ) 

Value:

if ( msFrustum[i][0] * v.x + msFrustum[i][1] * v.y + msFrustum[i][2] * v.z + msFrustum[i][3] <= 0 ) \
                return false;

Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:15 2007