Forums
This is the online documentation for Colossus Entertainments Pixie Game Engine

Platform_Win32_Screen Class Reference

Inheritance diagram for Platform_Win32_Screen:

Platform_Screen System

List of all members.


Detailed Description

Author:
Mattias Gustavsson

Definition at line 22 of file Platform_Win32_Screen.h.


Public Member Functions

 SYSTEM_IMPLEMENTATION (Platform_Win32_Screen)
 Platform_Win32_Screen ()
virtual void Initialize ()
virtual void Start ()
virtual void Stop ()
virtual void Terminate ()
virtual void Present (Bitmap *bitmap, unsigned short modulate=0xffff, unsigned short backgroundColor=0x0000)
virtual void SetInterpolationMode (bool enabled)
virtual bool GetInterpolationMode ()
virtual void SetRetroFilter (bool enabled)
virtual bool GetRetroFilter ()
virtual void SetFullscreen (bool fullscreen)
virtual bool GetFullscreen ()
virtual void SetSize (int width, int height)
virtual int GetWidth ()
virtual int GetHeight ()
void OnWmSize (int width, int height)
void OnMinimize ()
void OnLoseFocus ()
void OnGainFocus ()
void OnRestore ()

Constructor & Destructor Documentation

Platform_Win32_Screen::Platform_Win32_Screen (  ) 

Definition at line 20 of file Platform_Win32_Screen.cpp.


Member Function Documentation

Platform_Win32_Screen::SYSTEM_IMPLEMENTATION ( Platform_Win32_Screen   ) 

void Platform_Win32_Screen::Initialize (  )  [virtual]

Reimplemented from System.

Definition at line 37 of file Platform_Win32_Screen.cpp.

void Platform_Win32_Screen::Start (  )  [virtual]

Reimplemented from System.

Definition at line 65 of file Platform_Win32_Screen.cpp.

void Platform_Win32_Screen::Stop (  )  [virtual]

Reimplemented from System.

Definition at line 98 of file Platform_Win32_Screen.cpp.

void Platform_Win32_Screen::Terminate (  )  [virtual]

Reimplemented from System.

Definition at line 106 of file Platform_Win32_Screen.cpp.

void Platform_Win32_Screen::Present ( Bitmap bitmap,
unsigned short  modulate = 0xffff,
unsigned short  backgroundColor = 0x0000 
) [virtual]

Displays the specified bitmap on the screen. This is generally implemented in the fastest way possible for the platform, and the bitmap does not have to match the screen size, as it will do what it can to make it fit (stretch/shrink with or without interpolation, depending on settings and the current platform).

Implements Platform_Screen.

Definition at line 123 of file Platform_Win32_Screen.cpp.

void Platform_Win32_Screen::SetInterpolationMode ( bool  enabled  )  [virtual]

Enables or disables interpolation mode. If interpolation mode is on, it means that bitmaps of a size that doesn't match the screen size, and therefor needs to be scaled, will be interpolated using some interpolation scheme available on the platform (for example, it might use bilinear interpolation) which makes the image smoother, but a bit more blurry. If interpolation mode is off, there will be no interpolation applied to the bitmap, and it will also not be scaled by fractional amounts (meaning it might be scaled x2, x3, x4 etc, but not, for example, x2.5). You're likely to get larger border areas with interpolation turned off, but your pixels will stay sharp and crisp, with no distorting.

In general, you want to turn off interpolation if the graphics for your game falls into the "pixel art" category, and leave it on (which is the default) for highres or rendered art.

Note that interpolation might not be available on all platforms, and in that case, toggling this setting will have no effect.

Implements Platform_Screen.

Definition at line 266 of file Platform_Win32_Screen.cpp.

bool Platform_Win32_Screen::GetInterpolationMode (  )  [virtual]

This method is used to determine if interpolation mode is currently on or off. See SetInterpolationMode method for an explanation of the interpolation mode

Returns:
True if interpolation mode is on, False if interpolation mode is off

Implements Platform_Screen.

Definition at line 284 of file Platform_Win32_Screen.cpp.

void Platform_Win32_Screen::SetRetroFilter ( bool  enabled  )  [virtual]

Implements Platform_Screen.

Definition at line 292 of file Platform_Win32_Screen.cpp.

bool Platform_Win32_Screen::GetRetroFilter (  )  [virtual]

Implements Platform_Screen.

Definition at line 310 of file Platform_Win32_Screen.cpp.

void Platform_Win32_Screen::SetFullscreen ( bool  fullscreen  )  [virtual]

Enables or disables fullscreen mode. On some platforms, it is possible to run the game in a window, instead of having it cover the whole screen (which is the default behavior, unless you specify the command line parameter -window in which case the default will be to run in windowed mode).

When the game is running in windowed mode, the values set by the SetSize method are used for the size of the window (when running in fullscreen mode, those values will be ignored, and the Bitmap passed to Present will be scaled to fill the actual screen).

On some platforms, it is possible for the user to change the window size when running in windowed mode. This will be handled automatically, and the GetWidth and GetHeight methods can be used to retrieve the current window size. If you need to override the users change, you can call SetSize to adjust the window dimensions.

Note that windowed mode might not be available on all platforms, and in that case, toggling this setting will have no effect.

Implements Platform_Screen.

Definition at line 318 of file Platform_Win32_Screen.cpp.

bool Platform_Win32_Screen::GetFullscreen (  )  [virtual]

This method is used to determine if the game is running in windowed or fullscreen mode. See the SetFullscreen method for an explanation of windowed and fullscreen mode.

Returns:
True if running in fullscreen mode, False if running in windowed mode

Implements Platform_Screen.

Definition at line 353 of file Platform_Win32_Screen.cpp.

void Platform_Win32_Screen::SetSize ( int  width,
int  height 
) [virtual]

Implements Platform_Screen.

Definition at line 361 of file Platform_Win32_Screen.cpp.

int Platform_Win32_Screen::GetWidth (  )  [virtual]

Implements Platform_Screen.

Definition at line 389 of file Platform_Win32_Screen.cpp.

int Platform_Win32_Screen::GetHeight (  )  [virtual]

Implements Platform_Screen.

Definition at line 402 of file Platform_Win32_Screen.cpp.

void Platform_Win32_Screen::OnWmSize ( int  width,
int  height 
)

Definition at line 423 of file Platform_Win32_Screen.cpp.

void Platform_Win32_Screen::OnMinimize (  ) 

Definition at line 459 of file Platform_Win32_Screen.cpp.

void Platform_Win32_Screen::OnLoseFocus (  ) 

Definition at line 472 of file Platform_Win32_Screen.cpp.

void Platform_Win32_Screen::OnGainFocus (  ) 

Definition at line 489 of file Platform_Win32_Screen.cpp.

void Platform_Win32_Screen::OnRestore (  ) 

Definition at line 415 of file Platform_Win32_Screen.cpp.