Source graphics

From FreeSpace Wiki
Revision as of 22:12, 5 April 2010 by TopAce (talk | contribs) (same here, essentially)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contains both high-level and low-level routines for handling 3d graphics primitives. To allow for rendering with either DirectX or OpenGL, the graphics engine uses a structure (gr_screen) with function pointers to all the standard 3d operations (such as initializing the screen, page flipping, displaying primitives etc.). There are basically two sets of source files: grd3d* (DirectX) and gropengl* (OpenGL).

Major Classes/Functions/Structs

Class/Group/Struct Method/Function/Element Notes
gr_screen/screen global struct res, mode, aspect etc. Contains all info about screen setup (bits, resolution, etc)
gf_* functions Wraps standard 3d functions such as page flip, render buffer etc. allowing the engine to abstract DirectX and OpenGL functions.
gf_render_buffer() Main rendering call for models (ships etc.). Wraps buffer rendering modes in DirectX/OpenGL.
gr_* functions gr_init() Initialises graphics engine (either DirectX or OpenGL)