GfxServer Class Reference
[Framework Module]

#include <gfxserver.h>

Inheritance diagram for GfxServer:

RootServer< GfxServer > Root Server< GfxServer > Object TreeNode< Root > Referenced Counted Serialized List< Root > ListNode< Root > OpenGLGfxServer GlfwGfxServer

List of all members.

Detailed Description

GFX server interface.

Public Types

 The visible mouse cursor type. More...
 Minification/Magnification filter. More...
 Buffer Types. More...
enum  Extension { EXT_NONE = 0, EXT_NPOT_TEXTURES = (1 << 0) }
 Graphics extensions. More...
enum  PrimitiveType {
typedef void(* SizeCallbackFun )(ushort_t, ushort_t, bool)
typedef void(* RefreshCallbackFun )(void)
typedef bool(* CloseCallbackFun )(void)

Public Member Functions

 GfxServer (const char *id)
virtual ~GfxServer ()
virtual TextureNewTexture (const string &file_name)
virtual TextureNewTexture (const string &file_name, const string &overlay_name, const vector3 &overlay_color)
virtual TextureNewTexture (ImageFile *image_file)
virtual FontNewFont (const string &file_name, const FontFile::CharSize &char_size)
MeshNewMesh (const string &file_name)
ModelNewModel (const string &file_name)
ModelNewModel (const string &file_name, const vector3 &overlay_color)
AnimationNewAnimation (const string &file_name)
ImageFileNewImageFile (const string &file_name, bool open=false, bool write=false)
FontFileNewFontFile (const string &file_name, bool open=false, bool write=false)
void SetDisplayMode (const DisplayMode &mode)
 Set the prefered display mode.
const DisplayModeGetDisplayMode () const
virtual void SetProjection (const Projection &projection)
virtual void SetViewport (const Viewport &display_viewport)
virtual void PushScreenCoordinates ()
virtual void PopScreenCoordinates ()
virtual ushort_t GetVideoModes (VideoMode *modes, int max_count, VideoMode::Bpp bpp=VideoMode::BPP_UNDEFINED)
byte_t GetExtensions ()
bool IsExtensions (byte_t extensions)
void SetMinMagFilter (MinMagFilter minmag_filter)
void SetMipMapFilter (MinMagFilter mipmap_filter)
MinMagFilter GetMinMagFilter () const
MinMagFilter GetMipMapFilter () const
virtual void SetWindowTitle (const string &window_title)
virtual void SetWindowPosition (const DisplayMode::WidowPosition &position)
virtual const
GetWindowPosition () const
virtual void SetWindowSize (const DisplayMode::WidowSize &size)
virtual const
GetWindowSize () const
virtual void SetWindowVerticalSync (bool vsync)
virtual void MinimizeWindow ()
virtual void RestoreWindow ()
virtual void ToggleFullscreen ()
virtual bool IsWindowMinimized ()
virtual bool IsWindowActive ()
virtual bool IsWindowAccelerated ()
void SetWindowSizeCallback (SizeCallbackFun cbfun)
void SetWindowRefreshCallback (RefreshCallbackFun cbfun)
void SetWindowCloseCallback (CloseCallbackFun cbfun)
virtual bool OpenDisplay ()
virtual void CloseDisplay ()
virtual void PresentScene ()
virtual void WriteInfo ()
virtual void RegisterCallbacks ()
virtual bool Trigger ()
bool IsDisplayOpened ()
virtual void SetCursorVisibility (CursorVisibility type)
CursorVisibility GetCursorVisibility () const
bool TestCursorVisibility (CursorVisibility type) const
byte_t AddCursor (const string &model_file)
void SetCursor (byte_t cursor_id)
virtual bool SaveScreenshot (const string &file_name)
bool SaveImage (const string &file_name, byte_t *data, ImageFile::Format format, ushort_t width, ushort_t height)
void SetMesh (Mesh *mesh)
void SetTexture (Texture *texture)
void SetMapping (vector2 *mapping)
void SetCoordsBuffer (vector2 *coords_buff)
void SetColorsBuffer (vector4 *colors_buff)
void SetFont (Font *font)
const FontGetFont ()
virtual void ResetMatrix ()
virtual void PushMatrix ()
virtual void PopMatrix ()
virtual void Translate (const vector2 &translation)
virtual void Translate (const vector3 &translation)
virtual void Rotate (float rotation)
virtual void Rotate (const vector3 &rotation)
virtual void SetColor (const vector3 &color)
virtual void SetColor (const vector4 &color)
virtual void SetColorMask (bool r, bool g, bool b, bool alpha=true)
virtual void SetClearValues (float red, float green, float blue, float alpha=0.0f, float depth=0.0f, int stencil=0)
virtual void SetBlending (bool blending)
virtual void SetDepthTest (bool depth_test)
void SetColorFilter (float r, float g, float b, float alpha=1.0f)
virtual void ClearBuffers (byte_t buffers)
virtual void RenderShape ()
virtual void RenderPrimitive (PrimitiveType primitive, const vector2 *vertices, uint_t count)
virtual void Print (const vector2 &position, const string &text)
void Print (const string &text)
virtual void ReadPixels (ushort_t x, ushort_t y, ushort_t width, ushort_t height, byte_t *pixels)

Static Public Member Functions

static bool FilterToString (MinMagFilter filter, string &name)
static bool StringToFilter (const string &name, MinMagFilter &filter)

Protected Member Functions

virtual void CheckExtensions ()
void SetClearValues (GfxServer::ClearValues &clear_values)
void ResetRenderObjects ()
bool LoadResources ()
void UnloadResources ()

Protected Attributes

string window_title
DisplayMode display_mode
MinMagFilter minmag_filter
MinMagFilter mipmap_filter
ClearValues clear_values
byte_t extensions
bool blending
bool depth_test
vector4 color_filter
bool display_opened
Ref< ResourceServerresource_server
CursorVisibility cursor_visibility
vector< Model * > cursors
SizeCallbackFun callback_size
RefreshCallbackFun callback_refresh
CloseCallbackFun callback_close
 Pointer to active buffer with animated coords.
 Pointer to active buffer with animated colors.
Ref< Fontfont
 Active font used for printing texts.


struct  ClearValues

Member Typedef Documentation

typedef void(* GfxServer::SizeCallbackFun)(ushort_t, ushort_t, bool)

typedef void(* GfxServer::RefreshCallbackFun)(void)

typedef bool(* GfxServer::CloseCallbackFun)(void)

Member Enumeration Documentation

enum GfxServer::CursorVisibility

The visible mouse cursor type.

CURSOR_HIDDEN  No mouse cursor is visible.
CURSOR_SYSTEM  Use Window's system mouse cursor.
CURSOR_CUSTOM  Use the custom mouse cursor.

enum GfxServer::MinMagFilter

Minification/Magnification filter.

FILTER_NONE  No filter (used only as mip-map filter).
FILTER_NEAREST  Nearest filter.
FILTER_LINEAR  Linear filter.

enum GfxServer::BufferType

Buffer Types.


enum GfxServer::Extension

Graphics extensions.

EXT_NPOT_TEXTURES  Textures with non power of two dimensions.

enum GfxServer::PrimitiveType


Constructor & Destructor Documentation

GfxServer::GfxServer ( const char *  id  ) 

GfxServer::~GfxServer (  )  [virtual]

Member Function Documentation

Texture * GfxServer::NewTexture ( const string &  file_name  )  [virtual]

Creates a shared texture resource object.

Reimplemented in OpenGLGfxServer.

Texture * GfxServer::NewTexture ( const string &  file_name,
const string &  overlay_name,
const vector3 overlay_color 
) [virtual]

Creates a shared texture resource object with overlay image.

Reimplemented in OpenGLGfxServer.

Texture * GfxServer::NewTexture ( ImageFile image_file  )  [virtual]

Creates a shared texture resource object from memory buffer.

Reimplemented in OpenGLGfxServer.

Font * GfxServer::NewFont ( const string &  file_name,
const FontFile::CharSize char_size 
) [virtual]

Creates a shared font resource object.

Reimplemented in OpenGLGfxServer.

Mesh * GfxServer::NewMesh ( const string &  file_name  ) 

Creates a shared mesh resource object.

Model * GfxServer::NewModel ( const string &  file_name  ) 

Creates a shared model resource object.

Model * GfxServer::NewModel ( const string &  file_name,
const vector3 overlay_color 

Creates a shared model resource object.

Animation * GfxServer::NewAnimation ( const string &  file_name  ) 

ImageFile * GfxServer::NewImageFile ( const string &  file_name,
bool  open = false,
bool  write = false 

FontFile * GfxServer::NewFontFile ( const string &  file_name,
bool  open = false,
bool  write = false 

void GfxServer::SetDisplayMode ( const DisplayMode mode  ) 

Set the prefered display mode.

const DisplayMode & GfxServer::GetDisplayMode (  )  const [inline]

void GfxServer::SetProjection ( const Projection projection  )  [virtual]

Reimplemented in OpenGLGfxServer.

void GfxServer::SetViewport ( const Viewport display_viewport  )  [virtual]

Reimplemented in OpenGLGfxServer.

void GfxServer::PushScreenCoordinates (  )  [virtual]

Reimplemented in OpenGLGfxServer.

void GfxServer::PopScreenCoordinates (  )  [virtual]

Reimplemented in OpenGLGfxServer.

ushort_t GfxServer::GetVideoModes ( VideoMode modes,
int  max_count,
VideoMode::Bpp  bpp = VideoMode::BPP_UNDEFINED 
) [virtual]

Reimplemented in GlfwGfxServer.

byte_t GfxServer::GetExtensions (  )  [inline]

bool GfxServer::IsExtensions ( byte_t  extensions  )  [inline]

void GfxServer::SetMinMagFilter ( MinMagFilter  minmag_filter  )  [inline]

void GfxServer::SetMipMapFilter ( MinMagFilter  mipmap_filter  )  [inline]

GfxServer::MinMagFilter GfxServer::GetMinMagFilter (  )  const [inline]

GfxServer::MinMagFilter GfxServer::GetMipMapFilter (  )  const [inline]

void GfxServer::SetWindowTitle ( const string &  window_title  )  [virtual]

Reimplemented in GlfwGfxServer.

void GfxServer::SetWindowPosition ( const DisplayMode::WidowPosition position  )  [virtual]

Reimplemented in GlfwGfxServer.

const DisplayMode::WidowPosition & GfxServer::GetWindowPosition (  )  const [virtual]

void GfxServer::SetWindowSize ( const DisplayMode::WidowSize size  )  [virtual]

Reimplemented in GlfwGfxServer.

const DisplayMode::WidowSize & GfxServer::GetWindowSize (  )  const [virtual]

void GfxServer::SetWindowVerticalSync ( bool  vsync  )  [virtual]

Reimplemented in GlfwGfxServer.

void GfxServer::MinimizeWindow (  )  [virtual]

Reimplemented in GlfwGfxServer.

void GfxServer::RestoreWindow (  )  [virtual]

Reimplemented in GlfwGfxServer.

void GfxServer::ToggleFullscreen (  )  [virtual]

bool GfxServer::IsWindowMinimized (  )  [virtual]

Reimplemented in GlfwGfxServer.

bool GfxServer::IsWindowActive (  )  [virtual]

Reimplemented in GlfwGfxServer.

bool GfxServer::IsWindowAccelerated (  )  [virtual]

Reimplemented in GlfwGfxServer.

void GfxServer::SetWindowSizeCallback ( SizeCallbackFun  cbfun  )  [inline]

void GfxServer::SetWindowRefreshCallback ( RefreshCallbackFun  cbfun  )  [inline]

void GfxServer::SetWindowCloseCallback ( CloseCallbackFun  cbfun  )  [inline]

bool GfxServer::OpenDisplay (  )  [virtual]

Reimplemented in GlfwGfxServer.

void GfxServer::CloseDisplay (  )  [virtual]

Reimplemented in GlfwGfxServer.

void GfxServer::PresentScene (  )  [virtual]

Reimplemented in GlfwGfxServer.

void GfxServer::WriteInfo (  )  [virtual]

Writes basic gfx information to log file.

Reimplemented in OpenGLGfxServer.

void GfxServer::RegisterCallbacks (  )  [virtual]

Reimplemented in GlfwGfxServer.

bool GfxServer::Trigger (  )  [virtual]

Reimplemented from Server< GfxServer >.

Reimplemented in GlfwGfxServer.

bool GfxServer::IsDisplayOpened (  )  [inline]

void GfxServer::SetCursorVisibility ( CursorVisibility  type  )  [virtual]

Reimplemented in GlfwGfxServer.

GfxServer::CursorVisibility GfxServer::GetCursorVisibility (  )  const [inline]

bool GfxServer::TestCursorVisibility ( CursorVisibility  type  )  const [inline]

byte_t GfxServer::AddCursor ( const string &  model_file  ) 

void GfxServer::SetCursor ( byte_t  cursor_id  )  [inline]

bool GfxServer::SaveScreenshot ( const string &  file_name  )  [virtual]

Reimplemented in OpenGLGfxServer.

bool GfxServer::SaveImage ( const string &  file_name,
byte_t data,
ImageFile::Format  format,
ushort_t  width,
ushort_t  height 

void GfxServer::SetMesh ( Mesh mesh  )  [inline]

void GfxServer::SetTexture ( Texture texture  )  [inline]

void GfxServer::SetMapping ( vector2 mapping  )  [inline]

Add parameter with size of array and check the size while rendering. See RenderQuads for using this kind of size.

void GfxServer::SetCoordsBuffer ( vector2 coords_buff  )  [inline]

void GfxServer::SetColorsBuffer ( vector4 colors_buff  )  [inline]

void GfxServer::SetFont ( Font font  ) 

const Font * GfxServer::GetFont (  )  [inline]

void GfxServer::ResetMatrix (  )  [virtual]

Reimplemented in OpenGLGfxServer.

void GfxServer::PushMatrix (  )  [virtual]

Reimplemented in OpenGLGfxServer.

void GfxServer::PopMatrix (  )  [virtual]

Reimplemented in OpenGLGfxServer.

void GfxServer::Translate ( const vector2 translation  )  [virtual]

Reimplemented in OpenGLGfxServer.

void GfxServer::Translate ( const vector3 translation  )  [virtual]

Reimplemented in OpenGLGfxServer.

void GfxServer::Rotate ( float  rotation  )  [virtual]

Reimplemented in OpenGLGfxServer.

void GfxServer::Rotate ( const vector3 rotation  )  [virtual]

Reimplemented in OpenGLGfxServer.

void GfxServer::SetColor ( const vector3 color  )  [virtual]

Sets current color.

Reimplemented in OpenGLGfxServer.

void GfxServer::SetColor ( const vector4 color  )  [virtual]

Sets current color.

Reimplemented in OpenGLGfxServer.

void GfxServer::SetColorMask ( bool  r,
bool  g,
bool  b,
bool  alpha = true 
) [virtual]

Sets current color mask.

Reimplemented in OpenGLGfxServer.

void GfxServer::SetClearValues ( float  red,
float  green,
float  blue,
float  alpha = 0.0f,
float  depth = 0.0f,
int  stencil = 0 
) [virtual]

Sets values for clearing buffers.

Reimplemented in OpenGLGfxServer.

void GfxServer::SetBlending ( bool  blending  )  [virtual]

Reimplemented in OpenGLGfxServer.

void GfxServer::SetDepthTest ( bool  depth_test  )  [virtual]

Reimplemented in OpenGLGfxServer.

void GfxServer::SetColorFilter ( float  r,
float  g,
float  b,
float  alpha = 1.0f 
) [inline]

void GfxServer::ClearBuffers ( byte_t  buffers  )  [virtual]

Clears buffers.

Reimplemented in OpenGLGfxServer.

void GfxServer::RenderShape (  )  [virtual]

Reimplemented in OpenGLGfxServer.

void GfxServer::RenderPrimitive ( PrimitiveType  primitive,
const vector2 vertices,
uint_t  count 
) [virtual]

Reimplemented in OpenGLGfxServer.

void GfxServer::Print ( const vector2 position,
const string &  text 
) [virtual]

Reimplemented in OpenGLGfxServer.

void GfxServer::Print ( const string &  text  ) 

void GfxServer::ReadPixels ( ushort_t  x,
ushort_t  y,
ushort_t  width,
ushort_t  height,
byte_t pixels 
) [virtual]

Reimplemented in OpenGLGfxServer.

bool GfxServer::FilterToString ( MinMagFilter  filter,
string &  name 
) [static]

bool GfxServer::StringToFilter ( const string &  name,
MinMagFilter filter 
) [static]

void GfxServer::CheckExtensions (  )  [protected, virtual]

Reimplemented in GlfwGfxServer.

void GfxServer::SetClearValues ( GfxServer::ClearValues clear_values  )  [inline, protected]

void GfxServer::ResetRenderObjects (  )  [inline, protected]

bool GfxServer::LoadResources (  )  [protected]

void GfxServer::UnloadResources (  )  [protected]

Member Data Documentation

string GfxServer::window_title [protected]

DisplayMode GfxServer::display_mode [protected]

MinMagFilter GfxServer::minmag_filter [protected]

MinMagFilter GfxServer::mipmap_filter [protected]

ClearValues GfxServer::clear_values [protected]

byte_t GfxServer::extensions [protected]

bool GfxServer::blending [protected]

bool GfxServer::depth_test [protected]

vector4 GfxServer::color_filter [protected]

bool GfxServer::display_opened [protected]

Ref<ResourceServer> GfxServer::resource_server [protected]

CursorVisibility GfxServer::cursor_visibility [protected]

vector<Model *> GfxServer::cursors [protected]

Model* GfxServer::cursor_model [protected]

SizeCallbackFun GfxServer::callback_size [protected]

RefreshCallbackFun GfxServer::callback_refresh [protected]

CloseCallbackFun GfxServer::callback_close [protected]

Mesh* GfxServer::mesh [protected]

Texture* GfxServer::texture [protected]

Texture* GfxServer::overlay [protected]

vector2* GfxServer::mapping [protected]

vector2* GfxServer::coords_buff [protected]

Pointer to active buffer with animated coords.

vector4* GfxServer::colors_buff [protected]

Pointer to active buffer with animated colors.

Ref<Font> GfxServer::font [protected]

Active font used for printing texts.

The documentation for this class was generated from the following files:
Generated on Sat Oct 20 14:47:31 2007 for Dark Oberon by  doxygen 1.5.3