Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <string.h>
#include "gl_globals.h"
#include "vegastrike.h"
#include "gfxlib.h"
#include "vs_globals.h"
#include "gl_light.h"
#include "config_xml.h"
#include "winsys.h"
Go to the source code of this file.
Macros | |
#define | GL_MISC_CPP |
Functions | |
bool | GFXMultiTexAvailable () |
void | GFXCircle (float x, float y, float wid, float hei) |
void | GFXBeginScene () |
resets all local lights and sets identity matrix More... | |
void | GFXEndScene () |
Flushes and Swaps buffers. More... | |
void | GFXClear (const GFXBOOL colorbuffer, const GFXBOOL depthbuffer, const GFXBOOL stencilbuffer) |
Clears the Z buffer. Also clears color buffer if GFXTRUE passed in. More... | |
GFXBOOL | GFXCapture (char *filename) |
Screen capture (FIXME) More... | |
void | GFXGetPolygonOffset (float *factor, float *units) |
void | GFXPolygonOffset (float factor, float units) |
Sets Depth Offset for polgyons. More... | |
void | GFXPolygonMode (const enum POLYMODE polymode) |
Sets the polygon rasterization mode. More... | |
void | GFXCullFace (const enum POLYFACE polyface) |
Sets the facecull mode. More... | |
void | GFXPointSize (const float size) |
Sets the size in pixels of a GFXPOINT. More... | |
void | GFXLineWidth (const float size) |
Sets the line width in pixels of a GFXLINE. More... | |
void | GFXBegin (const enum POLYTYPE ptype) |
Begins a polytype. More... | |
void | GFXColorf (const GFXColor &col) |
Specifies a color for henceforth drawn vertices to share. More... | |
GFXColor | GFXColorf () |
Gets the current color. More... | |
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 | GFXTexCoord2f (const float s, const float t) |
Specifies a pair of texture coordinates for given vertex. More... | |
void | GFXTexCoord4f (const float s, const float t, const float u, const float v) |
Specifies four texture coordinates for a given vertex (2 textures) More... | |
void | GFXTexCoord224f (const float s, const float t, const float s2, const float t2, const float s3, const float t3, const float u3, const float v3) |
Specifies four texture coordinates for a given vertex (3 textures) More... | |
void | GFXNormal3f (const float i, const float j, const float k) |
Specifies a normal with 3 floats. More... | |
void | GFXNormal (const Vector &n) |
Specifies a notmal with 1 vector. More... | |
void | GFXVertex3f (const float x, const float y, const float z) |
Specifies a vertex with 3 floats. More... | |
void | GFXVertex3f (const double x, const double y, const double z) |
void | GFXVertex3d (const double x, const double y, const double z) |
void | GFXVertexf (const Vector &v) |
Specifies a vertex with a vector. More... | |
void | GFXVertexf (const QVector &v) |
void | GFXEnd () |
Ends the current set of polytypes. More... | |
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 | GFXCallList (int list) |
Draws a given display list. More... | |
void | GFXDeleteList (int list) |
Removes a display list from application memory. More... | |
void | GFXSubwindow (int x, int y, int xsize, int ysize) |
Creates a subwindow with the current parameters for center and size. More... | |
void | GFXSubwindow (float x, float y, float xsize, float ysize) |
Vector | GFXDeviceToEye (int x, int y) |
convertes eyespace to 3space at the near plane More... | |
Variables | |
static float | last_factor = 0 |
static float | last_units = 0 |
#define GL_MISC_CPP |
Definition at line 22 of file gl_misc.cpp.
void GFXBegin | ( | const enum POLYTYPE | ptype) |
Begins a polytype.
Definition at line 152 of file gl_misc.cpp.
References GFXLINE, GFXLINESTRIP, GFXPOINT, GFXPOLY, GFXQUAD, GFXQUADSTRIP, GFXTRI, GFXTRIFAN, and GFXTRISTRIP.
Referenced by AnimationDraw(), ParticlePoint::Draw(), GuiTexture::draw(), Background::Draw(), VSSprite::Draw(), BaseInterface::Room::BaseText::Draw(), BaseInterface::Room::Draw(), ParticleTrail::DrawAndUpdate(), Animation::DrawAsVSSprite(), Radar::SphereDisplay::DrawBackground(), Radar::BubbleDisplay::DrawBackground(), NavigationSystem::DrawButtonOutline(), NavigationSystem::DrawCircle(), DrawCrosshairs(), NavigationSystem::DrawCursor(), DrawDamageFlash(), DrawFrustum(), NavigationSystem::DrawGalaxy(), NavigationSystem::DrawGrid(), Radar::PlaneDisplay::DrawGround(), DrawGun(), NavigationSystem::DrawHalfCircleBottom(), NavigationSystem::DrawHalfCircleTop(), DrawHUDSprite(), DrawITTSLine(), DrawITTSMark(), NavigationSystem::DrawJump(), NavigationSystem::DrawMissile(), NavigationSystem::DrawNavCircle(), Animation::DrawNoTransform(), Animation::DrawNow(), DrawOneTargetBox(), NavigationSystem::DrawPlanet(), DrawShield(), DrawSquare(), NavigationSystem::DrawStation(), Radar::PlaneDisplay::DrawTarget(), NavigationSystem::DrawTargetCorners(), Radar::SphereDisplay::DrawTargetMarker(), Radar::BubbleDisplay::DrawTargetMarker(), Radar::PlaneDisplay::DrawTargetMarker(), Radar::SphereDisplay::DrawTrack(), Radar::BubbleDisplay::DrawTrack(), GFXCircle(), and Box::ProcessDrawQueue().
void GFXBeginScene | ( | ) |
resets all local lights and sets identity matrix
Definition at line 54 of file gl_misc.cpp.
References GFXLoadIdentity(), light_rekey_frame(), and MODEL.
Referenced by base_main_loop(), bootstrap_draw(), gamemenu_draw(), nav_main_loop(), GameUniverse::StartDraw(), and GameUniverse::StartGFX().
void GFXCallList | ( | int | list) |
Draws a given display list.
Definition at line 312 of file gl_misc.cpp.
Referenced by GFXVertexList::Draw().
GFXBOOL GFXCapture | ( | char * | filename) |
Definition at line 37 of file gl_misc.cpp.
References UniverseUtil::cos(), f, g_game, VegaConfig::getVariable(), GFXBegin(), GFXEnd(), GFXLINESTRIP, GFXVertex3f(), i, int, M_PI, Magnitude(), XMLSupport::parse_float(), UniverseUtil::sin(), Vector, vs_config, game_data_t::x_resolution, and game_data_t::y_resolution.
Referenced by DrawCrosshairs().
Clears the Z buffer. Also clears color buffer if GFXTRUE passed in.
Definition at line 66 of file gl_misc.cpp.
Referenced by bootstrap_draw(), Background::Draw(), WindowManager::draw(), GameCockpit::Draw(), BaseInterface::Room::BaseShip::Draw(), Mesh::ProcessUndrawnMeshes(), Mesh::ProcessZFarMeshes(), Briefing::Render(), and StartGUIFrame().
Specifies a color for henceforth drawn vertices to share.
Definition at line 214 of file gl_misc.cpp.
Referenced by bootstrap_draw(), GuiTexture::draw(), Bolt::Draw(), GameStarSystem::Draw(), GameCockpit::Draw(), BaseInterface::Room::Draw(), NavigationSystem::Draw(), UnivMap::Draw(), DrawDamageFlash(), DrawDockingBoxes(), DrawGlutMouse(), DrawShield(), GFXVertexList::EndDrawState(), Box::ProcessDrawQueue(), Logo::ProcessDrawQueue(), SetupCloakState(), and StartGUIFrame().
void GFXColorf | ( | const GFXColor & | col) |
Specifies a color for henceforth drawn vertices to share.
Definition at line 192 of file gl_misc.cpp.
References GFXColor::r.
Referenced by ParticlePoint::Draw(), Background::Draw(), WindowManager::draw(), GameCockpit::Draw(), BaseInterface::Room::BaseText::Draw(), Radar::SphereDisplay::DrawBackground(), Radar::BubbleDisplay::DrawBackground(), NavigationSystem::DrawButtonOutline(), NavigationSystem::DrawCircle(), DrawCrosshairs(), NavigationSystem::DrawCursor(), DrawDockingBoxes(), DrawFrustum(), NavigationSystem::DrawGalaxy(), NavigationSystem::DrawGrid(), Radar::PlaneDisplay::DrawGround(), NavigationSystem::DrawHalfCircleBottom(), NavigationSystem::DrawHalfCircleTop(), DrawHUDSprite(), DrawITTSLine(), DrawITTSMark(), NavigationSystem::DrawJump(), PaintText::drawLines(), NavigationSystem::DrawMissile(), NavigationSystem::DrawNavCircle(), NavigationSystem::DrawPlanet(), DrawShield(), NavigationSystem::DrawStation(), Radar::PlaneDisplay::DrawTarget(), NavigationSystem::DrawTargetCorners(), Radar::PlaneDisplay::DrawTargetMarker(), Radar::SphereDisplay::DrawTrack(), Radar::BubbleDisplay::DrawTrack(), AnimatedTexture::MakeActive(), Animation::ProcessDrawQueue(), SetupCloakState(), and AnimatedTexture::SetupPass().
GFXColor GFXColorf | ( | ) |
int GFXCreateList | ( | ) |
Creates a Display list. 0 is returned if no memory is avail for a display list.
Definition at line 298 of file gl_misc.cpp.
Referenced by CreateLists(), and GFXVertexList::RefreshDisplayList().
void GFXCullFace | ( | const enum POLYFACE | polyface) |
Sets the facecull mode.
Definition at line 123 of file gl_misc.cpp.
References GFXBACK, GFXFRONT, and GFXFRONTANDBACK.
Referenced by setupGLState().
void GFXDeleteList | ( | int | list) |
Removes a display list from application memory.
Definition at line 321 of file gl_misc.cpp.
Referenced by GFXVertexList::RefreshDisplayList(), and GFXVertexList::~GFXVertexList().
convertes eyespace to 3space at the near plane
Definition at line 343 of file gl_misc.cpp.
References b, f, g_game, GFXGetFrustumVars(), Vector, game_data_t::x_resolution, and game_data_t::y_resolution.
Referenced by MouseCoordinate().
void GFXEnd | ( | ) |
Ends the current set of polytypes.
Definition at line 293 of file gl_misc.cpp.
Referenced by AnimationDraw(), ParticlePoint::Draw(), GuiTexture::draw(), Background::Draw(), VSSprite::Draw(), BaseInterface::Room::BaseText::Draw(), BaseInterface::Room::Draw(), ParticleTrail::DrawAndUpdate(), Animation::DrawAsVSSprite(), Radar::SphereDisplay::DrawBackground(), Radar::BubbleDisplay::DrawBackground(), NavigationSystem::DrawButtonOutline(), NavigationSystem::DrawCircle(), DrawCrosshairs(), NavigationSystem::DrawCursor(), DrawDamageFlash(), DrawFrustum(), NavigationSystem::DrawGalaxy(), NavigationSystem::DrawGrid(), Radar::PlaneDisplay::DrawGround(), DrawGun(), NavigationSystem::DrawHalfCircleBottom(), NavigationSystem::DrawHalfCircleTop(), DrawHUDSprite(), DrawITTSLine(), DrawITTSMark(), NavigationSystem::DrawJump(), NavigationSystem::DrawMissile(), NavigationSystem::DrawNavCircle(), Animation::DrawNoTransform(), Animation::DrawNow(), DrawOneTargetBox(), NavigationSystem::DrawPlanet(), DrawShield(), DrawSquare(), NavigationSystem::DrawStation(), Radar::PlaneDisplay::DrawTarget(), NavigationSystem::DrawTargetCorners(), Radar::SphereDisplay::DrawTargetMarker(), Radar::BubbleDisplay::DrawTargetMarker(), Radar::PlaneDisplay::DrawTargetMarker(), Radar::SphereDisplay::DrawTrack(), Radar::BubbleDisplay::DrawTrack(), GFXCircle(), and Box::ProcessDrawQueue().
GFXBOOL GFXEndList | ( | ) |
Ends the display list call. Returns false if unsuccessful.
Definition at line 306 of file gl_misc.cpp.
Referenced by CreateLists(), and GFXVertexList::RefreshDisplayList().
void GFXEndScene | ( | ) |
Flushes and Swaps buffers.
Definition at line 60 of file gl_misc.cpp.
References winsys_swap_buffers().
Referenced by base_main_loop(), bootstrap_draw(), gamemenu_draw(), nav_main_loop(), GameUniverse::StartDraw(), and GameUniverse::StartGFX().
Definition at line 81 of file gl_misc.cpp.
References last_factor, and last_units.
Referenced by SetupSpecMapFirstPass().
void GFXLineWidth | ( | const float | size) |
Sets the line width in pixels of a GFXLINE.
Definition at line 147 of file gl_misc.cpp.
Referenced by Radar::SphereDisplay::DrawBackground(), Radar::BubbleDisplay::DrawBackground(), Radar::PlaneDisplay::DrawGround(), DrawOneTargetBox(), Radar::PlaneDisplay::DrawTarget(), Radar::SphereDisplay::DrawTargetMarker(), Radar::BubbleDisplay::DrawTargetMarker(), Radar::PlaneDisplay::DrawTargetMarker(), and setupGLState().
bool GFXMultiTexAvailable | ( | ) |
Definition at line 32 of file gl_misc.cpp.
References gl_options, and gl_options_t::Multitexture.
void GFXNormal | ( | const Vector & | n) |
Specifies a notmal with 1 vector.
Definition at line 263 of file gl_misc.cpp.
Specifies a normal with 3 floats.
Definition at line 258 of file gl_misc.cpp.
void GFXPointSize | ( | const float | size) |
Sets the size in pixels of a GFXPOINT.
Definition at line 142 of file gl_misc.cpp.
Referenced by Radar::SphereDisplay::Draw(), Radar::BubbleDisplay::Draw(), Radar::PlaneDisplay::Draw(), ParticleTrail::DrawAndUpdate(), DrawGun(), Radar::PlaneDisplay::DrawTarget(), Radar::SphereDisplay::DrawTrack(), and Radar::BubbleDisplay::DrawTrack().
void GFXPolygonMode | ( | const enum POLYMODE | polymode) |
Sets the polygon rasterization mode.
Definition at line 104 of file gl_misc.cpp.
References GFXFILLMODE, GFXLINEMODE, and GFXPOINTMODE.
Referenced by setupGLState().
Sets Depth Offset for polgyons.
Definition at line 87 of file gl_misc.cpp.
References last_factor, and last_units.
Referenced by Logo::ProcessDrawQueue(), SphereMesh::ProcessDrawQueue(), CityLights::ProcessDrawQueue(), quadsquare::Render(), setupGLState(), and SetupSpecMapFirstPass().
Creates a subwindow with the current parameters for center and size.
Definition at line 327 of file gl_misc.cpp.
References g_game, game_data_t::x_resolution, and game_data_t::y_resolution.
Referenced by GFXSubwindow(), Camera::RestoreViewPort(), and Camera::UpdateGFX().
Definition at line 337 of file gl_misc.cpp.
References g_game, GFXSubwindow(), game_data_t::x_resolution, and game_data_t::y_resolution.
void GFXTexCoord224f | ( | const float | s, |
const float | t, | ||
const float | s2, | ||
const float | t2, | ||
const float | s3, | ||
const float | t3, | ||
const float | u3, | ||
const float | v3 | ||
) |
Specifies four texture coordinates for a given vertex (3 textures)
Definition at line 237 of file gl_misc.cpp.
References gl_options, glMultiTexCoord2fARB_p, glMultiTexCoord4fARB_p, and gl_options_t::Multitexture.
Referenced by GFXVertexList::RefreshDisplayList().
Specifies a pair of texture coordinates for given vertex.
Definition at line 219 of file gl_misc.cpp.
Referenced by AnimationDraw(), ParticlePoint::Draw(), GuiTexture::draw(), VSSprite::Draw(), Animation::DrawAsVSSprite(), DrawDamageFlash(), DrawHUDSprite(), Animation::DrawNoTransform(), and Animation::DrawNow().
Specifies four texture coordinates for a given vertex (2 textures)
Definition at line 224 of file gl_misc.cpp.
References gl_options, glMultiTexCoord2fARB_p, and gl_options_t::Multitexture.
Referenced by VSSprite::Draw(), Animation::DrawAsVSSprite(), Animation::DrawNoTransform(), and Animation::DrawNow().
void GFXVertex3d | ( | const double | x, |
const double | y, | ||
const double | z | ||
) |
Definition at line 278 of file gl_misc.cpp.
Referenced by ParticlePoint::Draw(), DrawGun(), and DrawShield().
Specifies a vertex with 3 floats.
Definition at line 268 of file gl_misc.cpp.
Referenced by AnimationDraw(), BaseInterface::Room::BaseText::Draw(), Radar::BubbleDisplay::DrawBackground(), NavigationSystem::DrawButtonOutline(), NavigationSystem::DrawCircle(), DrawCrosshairs(), NavigationSystem::DrawCursor(), DrawDamageFlash(), NavigationSystem::DrawGalaxy(), NavigationSystem::DrawGrid(), NavigationSystem::DrawHalfCircleBottom(), NavigationSystem::DrawHalfCircleTop(), NavigationSystem::DrawJump(), NavigationSystem::DrawMissile(), NavigationSystem::DrawNavCircle(), Animation::DrawNoTransform(), Animation::DrawNow(), NavigationSystem::DrawPlanet(), DrawSquare(), NavigationSystem::DrawStation(), NavigationSystem::DrawTargetCorners(), Radar::SphereDisplay::DrawTargetMarker(), Radar::BubbleDisplay::DrawTargetMarker(), Radar::PlaneDisplay::DrawTargetMarker(), GFXCircle(), and Box::ProcessDrawQueue().
void GFXVertex3f | ( | const double | x, |
const double | y, | ||
const double | z | ||
) |
Definition at line 273 of file gl_misc.cpp.
void GFXVertexf | ( | const Vector & | v) |
Specifies a vertex with a vector.
Definition at line 283 of file gl_misc.cpp.
Referenced by ParticlePoint::Draw(), GuiTexture::draw(), VSSprite::Draw(), BaseInterface::Room::Draw(), Animation::DrawAsVSSprite(), Radar::SphereDisplay::DrawBackground(), DrawFrustum(), Radar::PlaneDisplay::DrawGround(), DrawGun(), DrawHUDSprite(), DrawITTSLine(), DrawITTSMark(), DrawOneTargetBox(), Radar::PlaneDisplay::DrawTarget(), Radar::PlaneDisplay::DrawTargetMarker(), Radar::SphereDisplay::DrawTrack(), and Radar::BubbleDisplay::DrawTrack().
void GFXVertexf | ( | const QVector & | v) |
Definition at line 288 of file gl_misc.cpp.
|
static |
Definition at line 78 of file gl_misc.cpp.
Referenced by GFXGetPolygonOffset(), and GFXPolygonOffset().
|
static |
Definition at line 79 of file gl_misc.cpp.
Referenced by GFXGetPolygonOffset(), and GFXPolygonOffset().