Interface class for interacting and manipulating the screen. More...
#include <Graphics/Screen.h>
Inherited by SDLScreen.
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. |
Interface class for interacting and manipulating the screen.
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.
[in] | mode | the BlendMode to use. |
Implemented in SDLScreen.
virtual bool IScreen::CenterScreen | ( | ) | [pure virtual] |
Centers the window on the desktop. NOTE: Only usable in windowed mode.
NOTE: Currently only supported for WIN32.
Implemented in SDLScreen.
virtual bool IScreen::DisableDrawRegion | ( | ) | [pure virtual] |
Disables using the draw engine.
Implemented in SDLScreen.
virtual bool IScreen::EnableDrawRegion | ( | Recti | area | ) | [pure virtual] |
Sets the screen area where all subsequent draw calls will be limited to.
[in] | area | the screen rectangle. |
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.
Implemented in SDLScreen.
virtual BlendMode IScreen::GetBlendMode | ( | ) | const [pure virtual] |
virtual Recti IScreen::GetDrawRegion | ( | ) | const [pure virtual] |
virtual Rectf IScreen::GetRect | ( | ) | const [pure virtual] |
Gets 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.
Implemented in SDLScreen.
virtual int IScreen::Height | ( | ) | const [pure virtual] |
Gets 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.
[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. |
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.
[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.
[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.
[in] | fileName | the name of the image file to save. |
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.
[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. |
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.
Implemented in SDLScreen.