In file libs/cs3d/opengl/ogl_g3d.h:

## class csGraphics3DOpenGL : public IGraphics3D

## Inheritance:

### Public Fields

csIniFile* config
  The configuration file
static int do_interlaced
  For interlacing. 0 = draw odd lines, 1 = draw even lines, -1 = draw all lines.
static bool do_lighting
  Option variable: do texture lighting?
static bool do_perfect
  Option variable: do perfect texture mapping?
static bool do_texel_filt
  Option variable: do expensive texel filtering?
static bool do_textured
  Option variable: render textures?
static bool do_transp
  Option variable: render transparent textures?
static bool ilace_fastmove
  For interlacing
OpenGLLightmapCache* lightmap_cache
  The lightmap cache.
IGraphics2D* m_piG2D
  Low-level 2D graphics layer
ISystem* m_piSystem
  The System interface.
OpenGLTextureCache* texture_cache
  The texture cache.
csTextureManagerOpenGL* txtmgr
  The texture manager

### Public Methods

STDMETHODIMP AddFogPolygon(CS_ID id, G3DPolygonAFP& poly, int fogtype)
  Add a front or back-facing fog polygon in the current fog object
STDMETHODIMP BeginDraw(int DrawFlags)
  Start a new frame (see CSDRAW_XXX bit flags)
void CacheInitTexture(IPolygonTexture* texture)
  Give a texture to csGraphics3DOpenGL to initialize the cache for it
void CacheLightedTexture(IPolygonTexture *texture)
  Allocate a 'lighted texture' in which the base texture and lightmap are pre-mixed in software and then presented to OpenGL to render
void CacheRectTexture(IPolygonTexture* texture, int minu, int minv, int maxu, int maxv)
  Give a rectangle to csGraphics3DOpenGL so that all sub-textures in this rectangle are cached
void CacheSubTexture(IPolygonTexture* texture, int u, int v)
  Give a sub-texture to csGraphics3DOpenGL to cache it.
STDMETHODIMP CacheTexture(IPolygonTexture* texture)
  Give a texture to csGraphics3DOpenGL to cache it.
STDMETHODIMP ClearCache(void)
  Clear the texture cache.
STDMETHODIMP Close()
STDMETHODIMP CloseFogObject(CS_ID id)
  Close a volumetric fog object
csGraphics3DOpenGL(ISystem* piSystem)
STDMETHODIMP DrawLine(csVector3& v1, csVector3& v2, float fov, int color)
  Draw a line in camera space.
STDMETHODIMP DrawPolygon(G3DPolygonDP& poly)
  Draw the projected polygon with light and texture.
STDMETHODIMP DrawPolygonDebug(G3DPolygonDP& poly)
  Draw the projected polygon with light and texture
STDMETHODIMP DrawPolygonFX(G3DPolygonDPFX& poly)
  Draw a polygon with special effects.
STDMETHODIMP DumpCache(void)
  Dump the texture cache.
STDMETHODIMP FinishDraw()
  End the frame and do a page swap.
STDMETHODIMP FinishPolygonFX()
  Finish a series of DrawPolygonFX
STDMETHODIMP Get2dDriver(IGraphics2D** pi)
  Get the IGraphics2D driver.
STDMETHODIMP GetCaps(G3D_CAPS *caps)
  Get the current driver's capabilities
STDMETHODIMP GetColormapFormat(G3D_COLORMAPFORMAT& retval)
  Get the colorformat you want.
STDMETHODIMP GetFogMode(G3D_FOGMETHOD& retval)
  Get the fog mode.
STDMETHODIMP GetHeight(int& retval)
  Get drawing buffer height
STDMETHODIMP GetMaximumAspectRatio(int& retval)
  Returns the maximum aspect ratio of maps.
STDMETHODIMP GetRenderState(G3D_RENDERSTATEOPTION op, long& val)
  Get a renderstate value.
STDMETHODIMP GetTextureManager(ITextureManager** pi)
  Get the ITextureManager.
STDMETHODIMP GetWidth(int& retval)
  Get drawing buffer width
STDMETHODIMP GetZBufPoint(int , int , unsigned long** retval)
  Get address of Z-buffer at specific point
STDMETHODIMP Initialize()
STDMETHODIMP NeedsPO2Maps()
  Returns S_OK if this driver requires all maps to be PO2.
STDMETHODIMP Open(char *Title)
STDMETHODIMP OpenFogObject(CS_ID id, csFog* fog)
  Initiate a volumetric fog object
STDMETHODIMP Print(csRect *area)
  Print the image in backbuffer
STDMETHODIMP SetDimensions(int width, int height)
  Change the dimensions of the display.
STDMETHODIMP SetFogMode(G3D_FOGMETHOD fogm)
  Get the fog mode.
STDMETHODIMP SetRenderState(G3D_RENDERSTATEOPTION op, long val)
  Set a renderstate boolean.
STDMETHODIMP SetZBufMode(G3DZBufMode mode)
  Set the mode for the Z buffer used for drawing the next polygon.
STDMETHODIMP StartPolygonFX(ITextureHandle* handle, UInt mode)
  Start a series of DrawPolygonFX
STDMETHODIMP UncacheTexture(IPolygonTexture* texture)
  Release a texture from the cache.
virtual ~csGraphics3DOpenGL()

### Protected Fields

long dbg_current_polygon
  For debugging: the current polygon number.
long dbg_max_polygons_to_draw
  For debugging: the maximum number of polygons to draw in a frame.
bool do_extra_bright
  Brighten rendered textures in an extra pass
int DrawMode
  DrawFlags on last BeginDraw ()
int height
  Height of display.
int height2
  Opt: height divided by 2.
float m_alpha
  Alpha value for DrawPolygonFX
bool m_gouraud
  Should DrawPolygonFX use Gouraud shading?
GLenum m_lightmap_src_blend
  Current settings of the user configurable blend parameters for lightmaps
UInt m_mixmode
  Mixing mode for DrawPolygonFX
bool m_textured
  Should DrawPolygonFX use texture?
bool rstate_dither
  DAN: render-states these override any other variable settings
int width
  Width of display.
int width2
  Opt: width divided by 2.
G3DZBufMode z_buf_mode
  Z Buffer mode to use while rendering next polygon.

## Documentation

`G3DZBufMode z_buf_mode`
  Z Buffer mode to use while rendering next polygon.

`int width`
  Width of display.

`int height`
  Height of display.

`int width2`
  Opt: width divided by 2.

`int height2`
  Opt: height divided by 2.

`bool rstate_dither`
  DAN: render-states these override any other variable settings

`bool m_gouraud`
  Should DrawPolygonFX use Gouraud shading?

`UInt m_mixmode`
  Mixing mode for DrawPolygonFX

`float m_alpha`
  Alpha value for DrawPolygonFX

`bool m_textured`
  Should DrawPolygonFX use texture?

`GLenum m_lightmap_src_blend`
  Current settings of the user configurable blend parameters for lightmaps. Certain settings work better on certain cards

`bool do_extra_bright`
  Brighten rendered textures in an extra pass. This slows down rendering (we should use multi-texturing) but is simulates 2*SRC*DST on cards that only support SRC*DST. At least it seems to do this on a RIVA 128.

`long dbg_max_polygons_to_draw`
  For debugging: the maximum number of polygons to draw in a frame.

`long dbg_current_polygon`
  For debugging: the current polygon number.

`int DrawMode`
  DrawFlags on last BeginDraw ()

`IGraphics2D* m_piG2D`
  Low-level 2D graphics layer. csGraphics3DOpenGL is in charge of creating and managing this.

`csIniFile* config`
  The configuration file

`csTextureManagerOpenGL* txtmgr`
  The texture manager

`OpenGLTextureCache* texture_cache`
  The texture cache.

`OpenGLLightmapCache* lightmap_cache`
  The lightmap cache.

`ISystem* m_piSystem`
  The System interface.

`static bool do_lighting`
  Option variable: do texture lighting?

`static bool do_transp`
  Option variable: render transparent textures?

`static bool do_textured`
  Option variable: render textures?

`static bool do_texel_filt`
  Option variable: do expensive texel filtering?

`static bool do_perfect`
  Option variable: do perfect texture mapping?

`static int do_interlaced`
  For interlacing. 0 = draw odd lines, 1 = draw even lines, -1 = draw all lines.

`static bool ilace_fastmove`
  For interlacing. Temporary set to true if we moved quickly. This will decrease the bluriness a little.

`csGraphics3DOpenGL(ISystem* piSystem)`

`virtual ~csGraphics3DOpenGL()`

`STDMETHODIMP Initialize()`

`STDMETHODIMP Open(char *Title)`

`STDMETHODIMP Close()`

`STDMETHODIMP SetDimensions(int width, int height)`
  Change the dimensions of the display.

`STDMETHODIMP BeginDraw(int DrawFlags)`
  Start a new frame (see CSDRAW_XXX bit flags)

`STDMETHODIMP FinishDraw()`
  End the frame and do a page swap.

`STDMETHODIMP Print(csRect *area)`
  Print the image in backbuffer

`STDMETHODIMP SetZBufMode(G3DZBufMode mode)`
  Set the mode for the Z buffer used for drawing the next polygon.

`STDMETHODIMP DrawPolygon(G3DPolygonDP& poly)`
  Draw the projected polygon with light and texture.

`STDMETHODIMP DrawPolygonDebug(G3DPolygonDP& poly)`
  Draw the projected polygon with light and texture. Debugging version. This one does not actually draw anything but it just prints debug information about what it would have done.

`STDMETHODIMP DrawLine(csVector3& v1, csVector3& v2, float fov, int color)`
  Draw a line in camera space.

`STDMETHODIMP StartPolygonFX(ITextureHandle* handle, UInt mode)`
  Start a series of DrawPolygonFX

`STDMETHODIMP FinishPolygonFX()`
  Finish a series of DrawPolygonFX

`STDMETHODIMP DrawPolygonFX(G3DPolygonDPFX& poly)`
  Draw a polygon with special effects.

`STDMETHODIMP CacheTexture(IPolygonTexture* texture)`
  Give a texture to csGraphics3DOpenGL to cache it.

`void CacheInitTexture(IPolygonTexture* texture)`
  Give a texture to csGraphics3DOpenGL to initialize the cache for it. This is used together with the sub-texture optimization and is meant to allocate the space in the cache but not do any actual calculations yet.

`void CacheSubTexture(IPolygonTexture* texture, int u, int v)`
  Give a sub-texture to csGraphics3DOpenGL to cache it.

`void CacheRectTexture(IPolygonTexture* texture, int minu, int minv, int maxu, int maxv)`
  Give a rectangle to csGraphics3DOpenGL so that all sub-textures in this rectangle are cached

`void CacheLightedTexture(IPolygonTexture *texture)`
  Allocate a 'lighted texture' in which the base texture and lightmap are pre-mixed in software and then presented to OpenGL to render. This emulates multi-texturing which is needed for transparent lighted portals

`STDMETHODIMP UncacheTexture(IPolygonTexture* texture)`
  Release a texture from the cache.

`STDMETHODIMP SetRenderState(G3D_RENDERSTATEOPTION op, long val)`
  Set a renderstate boolean.

`STDMETHODIMP GetRenderState(G3D_RENDERSTATEOPTION op, long& val)`
  Get a renderstate value.

`STDMETHODIMP GetCaps(G3D_CAPS *caps)`
  Get the current driver's capabilities. Each driver implements their own function.

`STDMETHODIMP GetZBufPoint(int , int , unsigned long** retval)`
  Get address of Z-buffer at specific point

`STDMETHODIMP DumpCache(void)`
  Dump the texture cache.

`STDMETHODIMP ClearCache(void)`
  Clear the texture cache.

`STDMETHODIMP GetWidth(int& retval)`
  Get drawing buffer width

`STDMETHODIMP GetHeight(int& retval)`
  Get drawing buffer height

`STDMETHODIMP Get2dDriver(IGraphics2D** pi)`
  Get the IGraphics2D driver.

`STDMETHODIMP GetTextureManager(ITextureManager** pi)`
  Get the ITextureManager.

`STDMETHODIMP NeedsPO2Maps()`
  Returns S_OK if this driver requires all maps to be PO2.

`STDMETHODIMP GetMaximumAspectRatio(int& retval)`
  Returns the maximum aspect ratio of maps.

`STDMETHODIMP GetFogMode(G3D_FOGMETHOD& retval)`
  Get the fog mode.

`STDMETHODIMP SetFogMode(G3D_FOGMETHOD fogm)`
  Get the fog mode.

`STDMETHODIMP OpenFogObject(CS_ID id, csFog* fog)`
  Initiate a volumetric fog object. This function will be called before front-facing and back-facing fog polygons are added to the object. The fog object will be convex but not necesarily closed. The given CS_ID can be used to identify multiple fog objects when multiple objects are started.

`STDMETHODIMP AddFogPolygon(CS_ID id, G3DPolygonAFP& poly, int fogtype)`
  Add a front or back-facing fog polygon in the current fog object. Note that it is guaranteed that all back-facing fog polygons will have been added before the first front-facing polygon. fogtype can be:
  - CS_FOG_FRONT: a front-facing polygon
  - CS_FOG_BACK: a back-facing polygon
  - CS_FOG_VIEW: the view-plane

`STDMETHODIMP CloseFogObject(CS_ID id)`
  Close a volumetric fog object. After the volumetric object is closed it should be rendered on screen (whether you do it here or in DrawFrontFog/DrawBackFog is not important).

`STDMETHODIMP GetColormapFormat(G3D_COLORMAPFORMAT& retval)`
  Get the colorformat you want.

This class has no child classes.

alphabetic index hierarchy of classes

this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de