Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Video Class Reference

#include <Video.h>

Inheritance diagram for Video:
VideoDX9 VideoDX9

List of all members.

Public Types

enum  STATUS { VIDEO_OK, VIDEO_ERR, VIDEO_BAD_PARM }
enum  RENDER_STATE {
  FILL_MODE, SHADE_MODE, LIGHTING_ENABLE, Z_ENABLE,
  Z_WRITE_ENABLE, Z_BIAS, TEXTURE_FILTER, DITHER_ENABLE,
  SPECULAR_ENABLE, FOG_ENABLE, FOG_COLOR, FOG_DENSITY,
  STENCIL_ENABLE, TEXTURE_WRAP, LIGHTING_PASS, RENDER_STATE_MAX
}
enum  BLEND_TYPE { BLEND_SOLID = 1, BLEND_ALPHA = 2, BLEND_ADDITIVE = 4, BLEND_FORCE_DWORD = 0x7fffffff }
enum  SHADE_TYPE { SHADE_FLAT = 1, SHADE_GOURAUD = 2, SHADE_PHONG = 3, SHADE_FORCE_DWORD = 0x7fffffff }
enum  FILL_TYPE { FILL_POINT = 1, FILL_WIREFRAME = 2, FILL_SOLID = 3, FILL_FORCE_DWORD = 0x7fffffff }
enum  FILTER_TYPE {
  FILTER_NONE = 1, FILTER_LINEAR = 2, FILTER_MIPMAP = 3, FILTER_MIPLINEAR = 4,
  FILTER_TRILINEAR = 6, FILTER_FORCE_DWORD = 0x7fffffff
}
enum  PROJECTION_TYPE { PROJECTION_PERSPECTIVE = 1, PROJECTION_ORTHOGONAL = 2, PROJECTION_FORCE_DWORD = 0x7fffffff }

Public Member Functions

 Video ()
virtual ~Video ()
STATUS Status () const
virtual const VideoSettingsGetVideoSettings () const
virtual bool SetVideoSettings (const VideoSettings *vs)
virtual bool Reset (const VideoSettings *vs)
virtual bool SetBackgroundColor (Color c)
virtual bool SetGammaLevel (int g)
virtual bool SetObjTransform (const Matrix &o, const Point &l)
virtual int Width () const
virtual int Height () const
virtual int Depth () const
virtual void RecoverSurfaces ()
virtual bool ClearAll ()
virtual bool ClearDepthBuffer ()
virtual bool Present ()
virtual bool Pause ()
virtual bool Resume ()
virtual bool IsWindowed () const
virtual bool IsFullScreen () const
virtual bool IsModeSupported (int width, int height, int bpp) const
virtual bool IsHardware () const
virtual bool IsHardwareTL () const
virtual int ZDepth () const
virtual DWORD VidMemFree () const
virtual int D3DLevel () const
virtual int MaxTexSize () const
virtual int MaxTexAspect () const
virtual int GammaLevel () const
virtual bool IsShadowEnabled () const
virtual bool IsBumpMapEnabled () const
virtual bool IsSpecMapEnabled () const
virtual void SetShadowEnabled (bool e)
virtual void SetBumpMapEnabled (bool e)
virtual void SetSpecMapEnabled (bool e)
virtual bool Capture (Bitmap &bmp)
virtual bool GetWindowRect (Rect &r)
virtual bool SetWindowRect (const Rect &r)
virtual bool SetViewport (int x, int y, int w, int h)
virtual bool SetCamera (const Camera *cam)
virtual bool SetProjection (float fov, float znear=1.0f, float zfar=1.0e6f, DWORD type=PROJECTION_PERSPECTIVE)
virtual bool SetEnvironment (Bitmap **faces)
virtual bool SetAmbient (Color c)
virtual bool SetLights (const List< Light > &lights)
virtual bool SetRenderState (RENDER_STATE state, DWORD value)
virtual bool SetBlendType (int blend_type)
virtual bool StartFrame ()
virtual bool EndFrame ()
virtual bool DrawPolys (int npolys, Poly *p)
virtual bool DrawScreenPolys (int npolys, Poly *p, int blend=0)
virtual bool DrawSolid (Solid *s, DWORD blend_modes=0xf)
virtual bool DrawShadow (Solid *s, int nverts, Vec3 *verts, bool vis=false)
virtual bool DrawLines (int nlines, Vec3 *v, Color c, int blend=0)
virtual bool DrawScreenLines (int nlines, float *v, Color c, int blend=0)
virtual bool DrawPoints (VertexSet *v)
virtual bool DrawPolyOutline (Poly *p)
virtual bool UseMaterial (Material *m)
virtual bool UseXFont (const char *name, int size, bool b, bool i)
virtual bool DrawText (const char *text, int count, const Rect &rect, DWORD format, Color c)
virtual void PreloadTexture (Bitmap *bmp)
virtual void PreloadSurface (Surface *s)
virtual void InvalidateCache ()
const CameraGetCamera () const
const RenderStatsGetStats () const

Static Public Member Functions

static VideoGetInstance ()

Protected Attributes

STATUS status
RenderStats stats
const Cameracamera
bool shadow_enabled
bool bump_enabled
bool spec_enabled

Static Protected Attributes

static Videovideo_instance = 0

Detailed Description

Definition at line 60 of file Video.h.


Member Enumeration Documentation

Enumerator:
BLEND_SOLID 
BLEND_ALPHA 
BLEND_ADDITIVE 
BLEND_FORCE_DWORD 

Definition at line 85 of file Video.h.

Enumerator:
FILL_POINT 
FILL_WIREFRAME 
FILL_SOLID 
FILL_FORCE_DWORD 

Definition at line 99 of file Video.h.

Enumerator:
FILTER_NONE 
FILTER_LINEAR 
FILTER_MIPMAP 
FILTER_MIPLINEAR 
FILTER_TRILINEAR 
FILTER_FORCE_DWORD 

Definition at line 106 of file Video.h.

Enumerator:
PROJECTION_PERSPECTIVE 
PROJECTION_ORTHOGONAL 
PROJECTION_FORCE_DWORD 

Definition at line 115 of file Video.h.

Enumerator:
FILL_MODE 
SHADE_MODE 
LIGHTING_ENABLE 
Z_ENABLE 
Z_WRITE_ENABLE 
Z_BIAS 
TEXTURE_FILTER 
DITHER_ENABLE 
SPECULAR_ENABLE 
FOG_ENABLE 
FOG_COLOR 
FOG_DENSITY 
STENCIL_ENABLE 
TEXTURE_WRAP 
LIGHTING_PASS 
RENDER_STATE_MAX 

Definition at line 65 of file Video.h.

Enumerator:
SHADE_FLAT 
SHADE_GOURAUD 
SHADE_PHONG 
SHADE_FORCE_DWORD 

Definition at line 92 of file Video.h.

Enumerator:
VIDEO_OK 
VIDEO_ERR 
VIDEO_BAD_PARM 

Definition at line 63 of file Video.h.


Constructor & Destructor Documentation

Video::Video ( )

Definition at line 25 of file Video.cpp.

Video::~Video ( )
virtual

Definition at line 37 of file Video.cpp.


Member Function Documentation

virtual bool Video::Capture ( Bitmap bmp)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 167 of file Video.h.

virtual bool Video::ClearAll ( )
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 140 of file Video.h.

virtual bool Video::ClearDepthBuffer ( )
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 141 of file Video.h.

virtual int Video::D3DLevel ( ) const
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 154 of file Video.h.

virtual int Video::Depth ( ) const
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 136 of file Video.h.

virtual bool Video::DrawLines ( int  nlines,
Vec3 v,
Color  c,
int  blend = 0 
)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 190 of file Video.h.

virtual bool Video::DrawPoints ( VertexSet v)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 193 of file Video.h.

virtual bool Video::DrawPolyOutline ( Poly p)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 194 of file Video.h.

virtual bool Video::DrawPolys ( int  npolys,
Poly p 
)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 185 of file Video.h.

virtual bool Video::DrawScreenLines ( int  nlines,
float *  v,
Color  c,
int  blend = 0 
)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 191 of file Video.h.

virtual bool Video::DrawScreenPolys ( int  npolys,
Poly p,
int  blend = 0 
)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 186 of file Video.h.

virtual bool Video::DrawShadow ( Solid s,
int  nverts,
Vec3 verts,
bool  vis = false 
)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 188 of file Video.h.

virtual bool Video::DrawSolid ( Solid s,
DWORD  blend_modes = 0xf 
)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 187 of file Video.h.

virtual bool Video::DrawText ( const char *  text,
int  count,
const Rect rect,
DWORD  format,
Color  c 
)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 198 of file Video.h.

virtual bool Video::EndFrame ( )
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 183 of file Video.h.

virtual int Video::GammaLevel ( ) const
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 157 of file Video.h.

const Camera* Video::GetCamera ( ) const
inline

Definition at line 205 of file Video.h.

static Video* Video::GetInstance ( )
inlinestatic

Definition at line 207 of file Video.h.

const RenderStats& Video::GetStats ( ) const
inline

Definition at line 206 of file Video.h.

virtual const VideoSettings* Video::GetVideoSettings ( ) const
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 126 of file Video.h.

virtual bool Video::GetWindowRect ( Rect r)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 168 of file Video.h.

virtual int Video::Height ( ) const
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 135 of file Video.h.

virtual void Video::InvalidateCache ( )
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 203 of file Video.h.

virtual bool Video::IsBumpMapEnabled ( ) const
inlinevirtual

Definition at line 160 of file Video.h.

bool Video::IsFullScreen ( ) const
virtual

Definition at line 57 of file Video.cpp.

virtual bool Video::IsHardware ( ) const
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 150 of file Video.h.

virtual bool Video::IsHardwareTL ( ) const
inlinevirtual

Definition at line 151 of file Video.h.

virtual bool Video::IsModeSupported ( int  width,
int  height,
int  bpp 
) const
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 148 of file Video.h.

virtual bool Video::IsShadowEnabled ( ) const
inlinevirtual

Definition at line 159 of file Video.h.

virtual bool Video::IsSpecMapEnabled ( ) const
inlinevirtual

Definition at line 161 of file Video.h.

bool Video::IsWindowed ( ) const
virtual

Definition at line 46 of file Video.cpp.

virtual int Video::MaxTexAspect ( ) const
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 156 of file Video.h.

virtual int Video::MaxTexSize ( ) const
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 155 of file Video.h.

virtual bool Video::Pause ( )
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 143 of file Video.h.

virtual void Video::PreloadSurface ( Surface s)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 202 of file Video.h.

virtual void Video::PreloadTexture ( Bitmap bmp)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 201 of file Video.h.

virtual bool Video::Present ( )
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 142 of file Video.h.

virtual void Video::RecoverSurfaces ( )
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 138 of file Video.h.

virtual bool Video::Reset ( const VideoSettings vs)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 128 of file Video.h.

virtual bool Video::Resume ( )
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 144 of file Video.h.

virtual bool Video::SetAmbient ( Color  c)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 178 of file Video.h.

virtual bool Video::SetBackgroundColor ( Color  c)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 130 of file Video.h.

virtual bool Video::SetBlendType ( int  blend_type)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 181 of file Video.h.

virtual void Video::SetBumpMapEnabled ( bool  e)
inlinevirtual

Definition at line 164 of file Video.h.

virtual bool Video::SetCamera ( const Camera cam)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 171 of file Video.h.

virtual bool Video::SetEnvironment ( Bitmap **  faces)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 177 of file Video.h.

virtual bool Video::SetGammaLevel ( int  g)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 131 of file Video.h.

virtual bool Video::SetLights ( const List< Light > &  lights)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 179 of file Video.h.

virtual bool Video::SetObjTransform ( const Matrix o,
const Point l 
)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 132 of file Video.h.

virtual bool Video::SetProjection ( float  fov,
float  znear = 1.0f,
float  zfar = 1.0e6f,
DWORD  type = PROJECTION_PERSPECTIVE 
)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 173 of file Video.h.

virtual bool Video::SetRenderState ( RENDER_STATE  state,
DWORD  value 
)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 180 of file Video.h.

virtual void Video::SetShadowEnabled ( bool  e)
inlinevirtual

Definition at line 163 of file Video.h.

virtual void Video::SetSpecMapEnabled ( bool  e)
inlinevirtual

Definition at line 165 of file Video.h.

virtual bool Video::SetVideoSettings ( const VideoSettings vs)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 127 of file Video.h.

virtual bool Video::SetViewport ( int  x,
int  y,
int  w,
int  h 
)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 170 of file Video.h.

virtual bool Video::SetWindowRect ( const Rect r)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 169 of file Video.h.

virtual bool Video::StartFrame ( )
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 182 of file Video.h.

STATUS Video::Status ( ) const
inline

Definition at line 124 of file Video.h.

virtual bool Video::UseMaterial ( Material m)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 195 of file Video.h.

virtual bool Video::UseXFont ( const char *  name,
int  size,
bool  b,
bool  i 
)
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 197 of file Video.h.

virtual DWORD Video::VidMemFree ( ) const
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 153 of file Video.h.

virtual int Video::Width ( ) const
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 134 of file Video.h.

virtual int Video::ZDepth ( ) const
inlinevirtual

Reimplemented in VideoDX9, and VideoDX9.

Definition at line 152 of file Video.h.


Member Data Documentation

bool Video::bump_enabled
protected

Definition at line 215 of file Video.h.

const Camera* Video::camera
protected

Definition at line 212 of file Video.h.

bool Video::shadow_enabled
protected

Definition at line 214 of file Video.h.

bool Video::spec_enabled
protected

Definition at line 216 of file Video.h.

RenderStats Video::stats
protected

Definition at line 211 of file Video.h.

STATUS Video::status
protected

Definition at line 210 of file Video.h.

Video * Video::video_instance = 0
staticprotected

Definition at line 218 of file Video.h.


The documentation for this class was generated from the following files: