IScreen Class Reference

Interface class for interacting and manipulating the screen. More...

#include <Graphics/Screen.h>

Inherited by SDLScreen.

List of all members.

Public Member Functions

virtual bool CenterScreen ()=0
 Centers the window on the desktop. NOTE: Only usable in windowed mode.
virtual int Width () const =0
 Gets the width of the drawable screen area.
virtual int Height () const =0
 Gets the height of the drawable screen area.
virtual Rectf GetRect () const =0
 Gets the Rect of the drawable screen area.
virtual std::string GetWindowTitle () const =0
 Gets the title of the window that houses the screen.
virtual bool SaveScreenshot (const std::string &fileName) const =0
 Saves an image of the current screens buffer.
virtual void NormToScreenCoords (float xin, float yin, float &x, float &y) const =0
 Converts normalized device coordinates to absolute screen coordinates.
virtual void ScreenToNormCoords (float xin, float yin, float &x, float &y) const =0
 Converts absolute screen coordinates to normalized device coordinates to.
virtual bool QueueText (FontRef f, const char *str, const Color4f &color, const Point2f &p)=0
 Queues text to be drawn a the end of the frame.
virtual bool QueueText (FontRef f, const char *str, const Color4f &color, Font::TextAlignment align, const Point2f &offset=Point2f(0.0f, 0.0f))=0
 Queues aligned text to be drawn a the end of the frame.
virtual bool BeginBlendMode (BlendMode mode)=0
 Sets the BlendMode all further draw calls Default is BLENDMODE_ALPHA. NOTE: BeginBlendMode/EndBlendMode cannot be nested.
virtual bool EndBlendMode ()=0
 Ends the BlendMode mode being used and reverts back to BLENDMODE_ALPHA.
virtual BlendMode GetBlendMode () const =0
 Gets the currently active blend mode.
virtual bool EnableDrawRegion (Recti area)=0
 Sets the screen area where all subsequent draw calls will be limited to.
virtual bool DisableDrawRegion ()=0
 Disables using the draw engine.
virtual Recti GetDrawRegion () const =0
 Gets the current draw region.

Detailed Description

Interface class for interacting and manipulating the screen.


Member Function Documentation

virtual bool IScreen::BeginBlendMode ( BlendMode  mode  )  [pure virtual]

Sets the BlendMode all further draw calls Default is BLENDMODE_ALPHA. NOTE: BeginBlendMode/EndBlendMode cannot be nested.

Parameters:
[in] mode the BlendMode to use.
Returns:
True if the BlendMode was successfully set. Returns false if the blend mode could not be set. This can occure if BeginBlendMode has already been called but EndBlendMode has not.

Implemented in SDLScreen.

virtual bool IScreen::CenterScreen (  )  [pure virtual]

Centers the window on the desktop. NOTE: Only usable in windowed mode.

Returns:
true if the screen was centered, false otherwise.

NOTE: Currently only supported for WIN32.

Implemented in SDLScreen.

virtual bool IScreen::DisableDrawRegion (  )  [pure virtual]

Disables using the draw engine.

Returns:
true if the draw region was disabled, false otherwise.

Implemented in SDLScreen.

virtual bool IScreen::EnableDrawRegion ( Recti  area  )  [pure virtual]

Sets the screen area where all subsequent draw calls will be limited to.

Parameters:
[in] area the screen rectangle.
Returns:
true if the draw region was created, false otherwise.

NOTE: This can be called without a matching call to DisableDrawRegion().

Implemented in SDLScreen.

virtual bool IScreen::EndBlendMode (  )  [pure virtual]

Ends the BlendMode mode being used and reverts back to BLENDMODE_ALPHA.

Returns:
True the BlendMode has been set back to BLENDMODE_ALPHA, returns false if EndBlendMode is called without first calling BeginBlendMode.

Implemented in SDLScreen.

virtual BlendMode IScreen::GetBlendMode (  )  const [pure virtual]

Gets the currently active blend mode.

Returns:
the active BlendMode.

Implemented in SDLScreen.

virtual Recti IScreen::GetDrawRegion (  )  const [pure virtual]

Gets the current draw region.

Returns:
the draw region.

Implemented in SDLScreen.

virtual Rectf IScreen::GetRect (  )  const [pure virtual]

Gets the Rect of the drawable screen area.

Returns:
The Rect of the drawable screen area.

Implemented in SDLScreen.

virtual std::string IScreen::GetWindowTitle (  )  const [pure virtual]

Gets the title of the window that houses the screen.

Returns:
The title of the window that houses the screen.

Implemented in SDLScreen.

virtual int IScreen::Height (  )  const [pure virtual]

Gets the height of the drawable screen area.

Returns:
The height of the drawable screen area.

Implemented in SDLScreen.

virtual void IScreen::NormToScreenCoords ( float  xin,
float  yin,
float &  x,
float &  y 
) const [pure virtual]

Converts normalized device coordinates to absolute screen coordinates.

Parameters:
[in] xin the normalized device coordinate in x to be converted.
[in] yin the normalized device coordinate in y to be converted.
[out] x the converted value of xin.
[out] y the converted value of yin.
See also:
ScreenToNormCoords

In normalized device coordinates the top left corner of the screen is at position (-1,-1), the bottom right corner of the screen is at position (1,1), and the center of the screen is at position (0,0). In absolute screen coordinates the top left corner of the screen is at position (-width/2,-height/2), the bottom right corner of the screen is at position (width/2,height/2), and the center of the screen is at position (0,0).

Implemented in SDLScreen.

virtual bool IScreen::QueueText ( FontRef  f,
const char *  str,
const Color4f color,
Font::TextAlignment  align,
const Point2f offset = Point2f(0.0f, 0.0f) 
) [pure virtual]

Queues aligned text to be drawn a the end of the frame.

Parameters:
[in] f the font used to draw the text.
[in] str the text to draw.
[in] color the color to draw str.
[in] align the text alignment to use when drawing str. The screen is used as the area to align to.
[in] offset the amount to offset the text. Assumed to be in normalized device coordinates. Defaults to (0,0).

Implemented in SDLScreen.

virtual bool IScreen::QueueText ( FontRef  f,
const char *  str,
const Color4f color,
const Point2f p 
) [pure virtual]

Queues text to be drawn a the end of the frame.

Parameters:
[in] f the font used to draw the text.
[in] str the text to draw.
[in] color the color to draw str.
[in] p the position to draw str. Assumed to be in normalized device coordinates.

Implemented in SDLScreen.

virtual bool IScreen::SaveScreenshot ( const std::string &  fileName  )  const [pure virtual]

Saves an image of the current screens buffer.

Parameters:
[in] fileName the name of the image file to save.
Returns:
True if the image was saved, false otherwise.

Implemented in SDLScreen.

virtual void IScreen::ScreenToNormCoords ( float  xin,
float  yin,
float &  x,
float &  y 
) const [pure virtual]

Converts absolute screen coordinates to normalized device coordinates to.

Parameters:
[in] xin the absolute screen coordinate in x to be converted.
[in] yin the absolute screen coordinate in y to be converted.
[out] x the converted value of xin.
[out] y the converted value of yin.
See also:
NormToScreenCoords

In normalized device coordinates the top left corner of the screen is at position (-1,-1), the bottom right corner of the screen is at position (1,1), and the center of the screen is at position (0,0). In absolute screen coordinates the top left corner of the screen is at position (-width/2,-height/2), the bottom right corner of the screen is at position (width/2,height/2), and the center of the screen is at position (0,0).

Implemented in SDLScreen.

virtual int IScreen::Width (  )  const [pure virtual]

Gets the width of the drawable screen area.

Returns:
The width of the drawable screen area.

Implemented in SDLScreen.


The documentation for this class was generated from the following file:
Generated on Mon Apr 5 19:08:06 2010 for BrickOut |ReDuX| by  doxygen 1.6.3