#include <CDisplay.h>
Public Member Functions | |
CDisplay (void) | |
Initialize some members. | |
~CDisplay (void) | |
Does nothing. | |
void | SetWindowHandle (HWND hWnd) |
Set the handle of the window DirectDraw/SDLVideo has to work with. | |
void | SetModuleHandle (HMODULE hModule) |
Set the handle of the module linked to the resources. | |
bool | Create (EDisplayMode DisplayMode) |
(Re)Create the DirectDraw/SDLVideo interface and (re)load the sprite tables given the display mode | |
void | Destroy (void) |
Destroy the DirectDraw/SDLVideo interface and the sprite tables. | |
void | OnWindowMove (void) |
Has to be called when the window moves (WM_MOVE). | |
void | OnPaint (void) |
Has to be called when the window has to be repainted (WM_PAINT). | |
void | Clear (void) |
Make the window's client area black. | |
void | Update (void) |
Draw the sprites that DrawSprite recorded and update the window's client area. | |
void | SetOrigin (int OriginX, int OriginY) |
Set the origin to draw from the game view origin. | |
void | DrawSprite (int PositionX, int PositionY, RECT *pZone, RECT *pClip, int SpriteTable, int Sprite, int SpriteLayer, int PriorityInLayer) |
Record a drawing request that will be executed on next call to Update. | |
void | DrawDebugRectangle (int PositionX, int PositionY, int w, int h, BYTE r, BYTE g, BYTE b, int SpriteLayer, int PriorityInLayer) |
Record a drawing request for debug purposes. | |
void | RemoveAllDebugRectangles (void) |
CSDLVideo & | GetSDLVideo (void) |
bool | IsDisplayModeAvailable (EDisplayMode DisplayMode) |
Private Member Functions | |
bool | Create (int Width, int Height, bool FullScreen) |
(Re)Create the DirectDraw/SDLVideo interface and (re)load the sprite tables given the resolution | |
bool | LoadSprites (int SpriteTableWidth, int SpriteTableHeight, int SpriteWidth, int SpriteHeight, bool Transparent, int BMP_ID) |
Load a sprite table given its bitmap data and its properties. | |
Private Attributes | |
HMODULE | m_hModule |
Connection to the resources. | |
CSDLVideo | m_SDLVideo |
Object used for display. | |
int | m_ViewOriginX |
Top left corner of the game view. | |
int | m_ViewOriginY |
CDisplay::CDisplay | ( | void | ) |
Initialize some members.
CDisplay::~CDisplay | ( | void | ) |
Does nothing.
bool CDisplay::Create | ( | int | Width, | |
int | Height, | |||
bool | FullScreen | |||
) | [private] |
(Re)Create the DirectDraw/SDLVideo interface and (re)load the sprite tables given the resolution
bool CDisplay::LoadSprites | ( | int | SpriteTableWidth, | |
int | SpriteTableHeight, | |||
int | SpriteWidth, | |||
int | SpriteHeight, | |||
bool | Transparent, | |||
int | BMP_ID | |||
) | [private] |
Load a sprite table given its bitmap data and its properties.
void CDisplay::SetWindowHandle | ( | HWND | hWnd | ) | [inline] |
Set the handle of the window DirectDraw/SDLVideo has to work with.
void CDisplay::SetModuleHandle | ( | HMODULE | hModule | ) | [inline] |
Set the handle of the module linked to the resources.
bool CDisplay::Create | ( | EDisplayMode | DisplayMode | ) |
(Re)Create the DirectDraw/SDLVideo interface and (re)load the sprite tables given the display mode
void CDisplay::Destroy | ( | void | ) |
Destroy the DirectDraw/SDLVideo interface and the sprite tables.
void CDisplay::OnWindowMove | ( | void | ) | [inline] |
Has to be called when the window moves (WM_MOVE).
void CDisplay::OnPaint | ( | void | ) | [inline] |
Has to be called when the window has to be repainted (WM_PAINT).
void CDisplay::Clear | ( | void | ) | [inline] |
Make the window's client area black.
void CDisplay::Update | ( | void | ) | [inline] |
Draw the sprites that DrawSprite recorded and update the window's client area.
void CDisplay::SetOrigin | ( | int | OriginX, | |
int | OriginY | |||
) | [inline] |
Set the origin to draw from the game view origin.
void CDisplay::DrawSprite | ( | int | PositionX, | |
int | PositionY, | |||
RECT * | pZone, | |||
RECT * | pClip, | |||
int | SpriteTable, | |||
int | Sprite, | |||
int | SpriteLayer, | |||
int | PriorityInLayer | |||
) | [inline] |
Record a drawing request that will be executed on next call to Update.
void CDisplay::DrawDebugRectangle | ( | int | PositionX, | |
int | PositionY, | |||
int | w, | |||
int | h, | |||
BYTE | r, | |||
BYTE | g, | |||
BYTE | b, | |||
int | SpriteLayer, | |||
int | PriorityInLayer | |||
) | [inline] |
Record a drawing request for debug purposes.
void CDisplay::RemoveAllDebugRectangles | ( | void | ) | [inline] |
CSDLVideo & CDisplay::GetSDLVideo | ( | void | ) | [inline] |
bool CDisplay::IsDisplayModeAvailable | ( | EDisplayMode | DisplayMode | ) |
HMODULE CDisplay::m_hModule [private] |
Connection to the resources.
CSDLVideo CDisplay::m_SDLVideo [private] |
Object used for display.
int CDisplay::m_ViewOriginX [private] |
Top left corner of the game view.
int CDisplay::m_ViewOriginY [private] |