Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include "gl_globals.h"
#include "gfxlib.h"
#include "vegastrike.h"
#include "vs_globals.h"
#include <stack>
Go to the source code of this file.
Classes | |
struct | BlendMode |
Macros | |
#define | GL_STATE_CPP |
#define | GL_CONSTANT_ALPHA 0x8003 |
#define | GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 |
#define | GL_ONE_MINUS_CONSTANT_COLOR 0x8002 |
#define | GL_CONSTANT_COLOR 0x8001 |
#define | GL_CLAMP_TO_EDGE_EXT 0x812F |
#define | GL_CLAMP_TO_BORDER_ARB 0x812D |
Functions | |
GLenum | GetGLTextureTarget (enum TEXTURE_TARGET texture_target) |
static bool | _GFXActiveTextureValid () |
void | GFXEnable (const STATE state) |
void | GFXToggleTexture (bool enable, int whichstage, enum TEXTURE_TARGET target) |
void | GFXDisable (const STATE state) |
void | GFXTextureAddressMode (const ADDRESSMODE mode, enum TEXTURE_TARGET target) |
Sets texture to clamp or wrap texture coordinates. More... | |
void | GFXGetBlendMode (enum BLENDFUNC &src, enum BLENDFUNC &dst) |
Gets the current blend mode to src,dst. More... | |
static GLenum | blendToGL (const enum BLENDFUNC func) |
void | GFXBlendMode (const enum BLENDFUNC src, const enum BLENDFUNC dst) |
Sets the current blend mode to src,dst. More... | |
void | GFXPushBlendMode () |
Pushes and saves current blend mode. More... | |
void | GFXPopBlendMode () |
Restores previous blend mode. More... | |
void | GFXColorMaterial (int LIGHTTARG) |
enum DEPTHFUNC | GFXDepthFunc () |
Returns the current depth function. More... | |
void | GFXDepthFunc (enum DEPTHFUNC dfunc) |
Sets up depth compare function. More... | |
enum DEPTHFUNC | GFXStencilFunc () |
Returns the current stencil test function. More... | |
void | GFXStencilFunc (enum DEPTHFUNC *pFunc, int *pRef, int *pMask) |
Gets details about the current stancil compare function - Specify NULL for unwanted fields. More... | |
void | GFXStencilFunc (enum DEPTHFUNC sfunc, int ref, unsigned int mask) |
Sets up a stencil compare function. More... | |
void | GFXStencilOp (enum STENCILOP *pFail, enum STENCILOP *pZfail, enum STENCILOP *pZpass) |
Gets the current stencil write operations - Specify NULL for unwanted fields. More... | |
void | GFXStencilOp (enum STENCILOP fail, enum STENCILOP zfail, enum STENCILOP zpass) |
Sets up the stencil write operations. More... | |
unsigned int | GFXStencilMask () |
Returns the current stencil write mask. More... | |
void | GFXStencilMask (unsigned int mask) |
Sets the stencil write mask. More... | |
void | GFXActiveTexture (const int stage) |
Sets the active texture stage in multitexture. More... | |
void | GFXAlphaTest (const enum DEPTHFUNC df, const float ref) |
Turns on alpha testing mode (or turns if off if DEPTHFUNC is set to ALWAYS. More... | |
Variables | |
GLenum | bTex [32] |
int | activeTextureStage = -1 |
GFXBOOL | GFXLIGHTING |
struct BlendMode | currBlendMode |
stack< BlendMode > | blendstack |
static DEPTHFUNC | cur_depth_func = LESS |
static DEPTHFUNC | cur_stencil_func = ALWAYS |
static int | cur_stencil_func_ref = 0 |
static unsigned int | cur_stencil_func_mask = ~0 |
static unsigned int | cur_stencil_mask = ~0 |
static STENCILOP | cur_stencil_op_f = KEEP |
static STENCILOP | cur_stencil_op_zf = KEEP |
static STENCILOP | cur_stencil_op_zp = KEEP |
#define GL_CLAMP_TO_BORDER_ARB 0x812D |
Definition at line 255 of file gl_state.cpp.
Referenced by GFXTextureAddressMode().
#define GL_CLAMP_TO_EDGE_EXT 0x812F |
Definition at line 252 of file gl_state.cpp.
Referenced by GFXTextureAddressMode().
#define GL_CONSTANT_ALPHA 0x8003 |
Definition at line 31 of file gl_state.cpp.
Referenced by blendToGL().
#define GL_CONSTANT_COLOR 0x8001 |
Definition at line 40 of file gl_state.cpp.
Referenced by blendToGL().
#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 |
Definition at line 34 of file gl_state.cpp.
Referenced by blendToGL().
#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 |
Definition at line 37 of file gl_state.cpp.
Referenced by blendToGL().
#define GL_STATE_CPP |
Definition at line 21 of file gl_state.cpp.
|
inlinestatic |
Definition at line 82 of file gl_state.cpp.
References activeTextureStage, gl_options, and gl_options_t::Multitexture.
Referenced by GFXTextureAddressMode().
|
static |
Definition at line 317 of file gl_state.cpp.
References CONSTALPHA, CONSTCOLOR, DESTALPHA, DESTCOLOR, GL_CONSTANT_ALPHA, GL_CONSTANT_COLOR, GL_ONE_MINUS_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_COLOR, INVCONSTALPHA, INVCONSTCOLOR, INVDESTALPHA, INVDESTCOLOR, INVSRCALPHA, INVSRCCOLOR, ONE, SRCALPHA, SRCALPHASAT, SRCCOLOR, and ZERO.
Referenced by GFXBlendMode().
GLenum GetGLTextureTarget | ( | enum TEXTURE_TARGET | texture_target) |
Definition at line 50 of file gl_state.cpp.
References CUBEMAP, GL_TEXTURE_CUBE_MAP_EXT, GL_TEXTURE_RECTANGLE_ARB, TEXTURE1D, TEXTURE2D, TEXTURE3D, and TEXTURERECT.
Referenced by GFXTextureAddressMode(), GFXTextureWrap(), and GFXToggleTexture().
void GFXActiveTexture | ( | const int | stage) |
Sets the active texture stage in multitexture.
Definition at line 594 of file gl_state.cpp.
References activeTextureStage, gl_options, glActiveTextureARB_p, and gl_options_t::Multitexture.
Referenced by GameStarSystem::activateLightMap(), Background::Draw(), GFXCreateTexture(), GFXDisable(), GFXEnable(), GFXInit(), GFXSelectTexture(), GFXTextureCoordGenMode(), GFXTextureEnv(), GFXTextureWrap(), GFXToggleTexture(), LookAtHelper(), Texture::MakeActive(), RestoreSpecMapState(), and SetupSpecMapSecondPass().
Turns on alpha testing mode (or turns if off if DEPTHFUNC is set to ALWAYS.
Definition at line 606 of file gl_state.cpp.
References ALWAYS, EQUAL, GEQUAL, GREATER, LEQUAL, LESS, NEQUAL, and NEVER.
Referenced by Bolt::Draw(), Stars::Draw(), GameCockpit::Draw(), BaseInterface::Room::BaseVSSprite::Draw(), DrawHUDSprite(), and setupGLState().
Sets the current blend mode to src,dst.
Definition at line 342 of file gl_state.cpp.
References blendToGL(), currBlendMode, BlendMode::dfactor, and BlendMode::sfactor.
Referenced by bootstrap_draw(), CoordinateSelect::Draw(), Bolt::Draw(), Background::Draw(), VDU::Draw(), Stars::Draw(), WindowManager::draw(), GameCockpit::Draw(), BaseInterface::Room::BaseVSSprite::Draw(), BaseInterface::Room::Draw(), NavigationSystem::Draw(), GFXVertexList::Draw(), UnivMap::Draw(), ParticleTrail::DrawAndUpdate(), Animation::DrawAsVSSprite(), NavigationSystem::DrawButtonOutline(), NavigationSystem::DrawCircle(), DrawCrosshairs(), NavigationSystem::DrawCursor(), DrawDamageFlash(), DrawDockingBoxes(), DrawFrustum(), NavigationSystem::DrawGalaxy(), DrawGlutMouse(), NavigationSystem::DrawGrid(), NavigationSystem::DrawHalfCircleBottom(), NavigationSystem::DrawHalfCircleTop(), DrawHUDSprite(), DrawITTSLine(), DrawITTSMark(), NavigationSystem::DrawJump(), PaintText::drawLines(), NavigationSystem::DrawMissile(), NavigationSystem::DrawMission(), NavigationSystem::DrawNavCircle(), Animation::DrawNoTransform(), Mesh::DrawNow(), DrawOneTargetBox(), NavigationSystem::DrawPlanet(), NavigationSystem::DrawSectorList(), DrawShield(), NavigationSystem::DrawShip(), NavigationSystem::DrawStation(), NavigationSystem::DrawTargetCorners(), GFXInit(), GFXPopBlendMode(), Box::ProcessDrawQueue(), Halo::ProcessDrawQueue(), Logo::ProcessDrawQueue(), Animation::ProcessDrawQueue(), Beam::ProcessDrawQueue(), Animation::ProcessFarDrawQueue(), QuadTree::Render(), Briefing::Render(), SetupCloakState(), SetupDamageMapThirdPass(), SetupEnvmapPass(), SetupGlowMapFourthPass(), setupGLState(), SetupSpecMapFirstPass(), SetupSpecMapSecondPass(), StartGUIFrame(), TerrainMakeActive(), and TerrainMakeClearActive().
void GFXColorMaterial | ( | int | LIGHTTARG) |
Definition at line 365 of file gl_state.cpp.
References AMBIENT, DIFFUSE, EMISSION, and SPECULAR.
Referenced by PointStarVlist::BeginDrawState(), SpriteStarVlist::BeginDrawState(), PointStarVlist::EndDrawState(), SpriteStarVlist::EndDrawState(), quadsquare::Render(), RestoreCloakState(), and SetupCloakState().
enum DEPTHFUNC GFXDepthFunc | ( | ) |
Returns the current depth function.
Definition at line 394 of file gl_state.cpp.
References cur_depth_func.
Referenced by RestoreEnvmapState(), RestoreFirstPassState(), RestoreGlowMapState(), RestoreSpecMapState(), SetupDamageMapThirdPass(), SetupEnvmapPass(), SetupGlowMapFourthPass(), setupGLState(), SetupSpecMapFirstPass(), and SetupSpecMapSecondPass().
void GFXDepthFunc | ( | enum DEPTHFUNC | dfunc) |
void GFXDisable | ( | const STATE | state) |
Definition at line 185 of file gl_state.cpp.
References bTex, COLORWRITE, CULLFACE, DEPTHTEST, DEPTHWRITE, GFXActiveTexture(), GFXFALSE, GFXLIGHTING, gl_options, GL_TEXTURE_CUBE_MAP_EXT, LIGHTING, gl_options_t::Multitexture, SMOOTH, STENCIL, TEXTURE0, and TEXTURE1.
void GFXEnable | ( | const STATE | state) |
Definition at line 89 of file gl_state.cpp.
References bTex, COLORWRITE, CULLFACE, DEPTHTEST, DEPTHWRITE, GFXActiveTexture(), GFXLIGHTING, GFXTRUE, gl_options, GL_TEXTURE_CUBE_MAP_EXT, LIGHTING, gl_options_t::Multitexture, SMOOTH, gl_options_t::smooth_lines, gl_options_t::smooth_points, STENCIL, TEXTURE0, and TEXTURE1.
Gets the current blend mode to src,dst.
Definition at line 311 of file gl_state.cpp.
References currBlendMode, BlendMode::dfactor, and BlendMode::sfactor.
Referenced by VSSprite::Draw(), GFXVertexList::Draw(), Animation::DrawAsVSSprite(), Animation::DrawNoTransform(), and Animation::DrawNow().
void GFXPopBlendMode | ( | ) |
Restores previous blend mode.
Definition at line 356 of file gl_state.cpp.
References blendstack, currBlendMode, BlendMode::dfactor, GFXBlendMode(), and BlendMode::sfactor.
Referenced by CoordinateSelect::Draw(), LocationSelect::Draw(), GFXVertexList::Draw(), Animation::DrawAsVSSprite(), DrawDamageFlash(), PaintText::drawLines(), DrawShield(), Halo::ProcessDrawQueue(), Beam::ProcessDrawQueue(), RestoreCloakState(), RestoreEnvmapState(), RestoreFirstPassState(), RestoreGlowMapState(), and RestoreSpecMapState().
void GFXPushBlendMode | ( | ) |
Pushes and saves current blend mode.
Definition at line 351 of file gl_state.cpp.
References blendstack, and currBlendMode.
Referenced by CoordinateSelect::Draw(), GFXVertexList::Draw(), Animation::DrawAsVSSprite(), DrawDamageFlash(), PaintText::drawLines(), DrawShield(), Halo::ProcessDrawQueue(), Beam::ProcessDrawQueue(), SetupCloakState(), SetupDamageMapThirdPass(), SetupEnvmapPass(), SetupGlowMapFourthPass(), SetupSpecMapFirstPass(), and SetupSpecMapSecondPass().
enum DEPTHFUNC GFXStencilFunc | ( | ) |
Returns the current stencil test function.
Definition at line 444 of file gl_state.cpp.
References cur_stencil_func.
Gets details about the current stancil compare function - Specify NULL for unwanted fields.
Definition at line 449 of file gl_state.cpp.
References cur_stencil_func, cur_stencil_func_mask, and cur_stencil_func_ref.
Sets up a stencil compare function.
Definition at line 456 of file gl_state.cpp.
References ALWAYS, cur_stencil_func, cur_stencil_func_mask, cur_stencil_func_ref, EQUAL, GEQUAL, GREATER, LEQUAL, LESS, NEQUAL, and NEVER.
unsigned int GFXStencilMask | ( | ) |
Returns the current stencil write mask.
Definition at line 583 of file gl_state.cpp.
References cur_stencil_mask.
void GFXStencilMask | ( | unsigned int | mask) |
Sets the stencil write mask.
Definition at line 588 of file gl_state.cpp.
References cur_stencil_mask.
Gets the current stencil write operations - Specify NULL for unwanted fields.
Definition at line 495 of file gl_state.cpp.
References cur_stencil_op_f, cur_stencil_op_zf, and cur_stencil_op_zp.
Sets up the stencil write operations.
Definition at line 502 of file gl_state.cpp.
References CLEAR, cur_stencil_op_f, cur_stencil_op_zf, cur_stencil_op_zp, DECR, INCR, INVERT, KEEP, and REPLACE.
void GFXTextureAddressMode | ( | const ADDRESSMODE | mode, |
enum TEXTURE_TARGET | target | ||
) |
Sets texture to clamp or wrap texture coordinates.
Definition at line 258 of file gl_state.cpp.
References _GFXActiveTextureValid(), BORDER, CLAMP, CUBEMAP, DEFAULT_ADDRESS_MODE, GetGLTextureTarget(), GL_CLAMP_TO_BORDER_ARB, GL_CLAMP_TO_EDGE_EXT, MIRROR, TEXTURE1D, TEXTURE3D, and WRAP.
Referenced by Background::Draw(), GFXCreateTexture(), and Texture::MakeActive().
void GFXToggleTexture | ( | bool | enable, |
int | whichstage, | ||
enum TEXTURE_TARGET | target | ||
) |
Definition at line 167 of file gl_state.cpp.
References bTex, GetGLTextureTarget(), GFXActiveTexture(), gl_options, and gl_options_t::Multitexture.
Referenced by GameStarSystem::activateLightMap(), Bolt::Draw(), Background::Draw(), VSSprite::Draw(), Animation::DrawAsVSSprite(), PaintText::drawLines(), Animation::DrawNoTransform(), Animation::DrawNow(), Mesh::DrawNow(), GFXInit(), Beam::ProcessDrawQueue(), Mesh::ProcessDrawQueue(), RestoreEnvmapState(), RestoreFirstPassState(), SetupEnvmapPass(), and SetupSpecMapFirstPass().
int activeTextureStage = -1 |
Definition at line 80 of file gl_state.cpp.
Referenced by _GFXActiveTextureValid(), and GFXActiveTexture().
stack< BlendMode > blendstack |
Definition at line 309 of file gl_state.cpp.
Referenced by GFXPopBlendMode(), and GFXPushBlendMode().
GLenum bTex[32] |
Definition at line 43 of file gl_state.cpp.
Referenced by GFXDisable(), GFXEnable(), and GFXToggleTexture().
Definition at line 392 of file gl_state.cpp.
Referenced by GFXDepthFunc().
Definition at line 436 of file gl_state.cpp.
Referenced by GFXStencilFunc().
|
static |
Definition at line 438 of file gl_state.cpp.
Referenced by GFXStencilFunc().
|
static |
Definition at line 437 of file gl_state.cpp.
Referenced by GFXStencilFunc().
|
static |
Definition at line 439 of file gl_state.cpp.
Referenced by GFXStencilMask().
Definition at line 440 of file gl_state.cpp.
Referenced by GFXStencilOp().
Definition at line 441 of file gl_state.cpp.
Referenced by GFXStencilOp().
Definition at line 442 of file gl_state.cpp.
Referenced by GFXStencilOp().
struct BlendMode currBlendMode |
Referenced by GFXBlendMode(), GFXGetBlendMode(), GFXPopBlendMode(), and GFXPushBlendMode().
GFXBOOL GFXLIGHTING |
Definition at line 32 of file gl_light.cpp.
Referenced by GFXDisable(), and GFXEnable().