![]() |
Dragonfly 2.2
A text-based game engine
|
Public Member Functions | |
| int | startUp () |
| Get terminal ready for text-based display. | |
| void | shutDown () |
| Revert back to normal terminal display. | |
| int | swapBuffers () |
| Render current display buffer. | |
| int | drawCh (Position world_pos, char ch) |
| Draw a character at screen location (x,y) (with default color). | |
| int | drawCh (Position world_pos, char ch, int color) |
| Draw a character at screen location (x,y) with color. | |
| int | drawFrame (Position world_pos, Frame frame, bool centered, int color) |
| Draw single sprite frame at screen location (x,y) with color. | |
| int | drawString (Position world_pos, string str, Justification just, int color) |
| Draw string at screen location (x,y) with default color. | |
| int | getHorizontal () |
| Return display's horizontal maximum. | |
| int | getVertical () |
| Return display's vertical maximum. | |
| WINDOW * | getCurrentWindow () |
| WINDOW * | getBackWindow () |
Static Public Member Functions | |
| static GraphicsManager & | getInstance () |
| Get the one and only instance of the GraphicsManager. | |
Protected Attributes | |
| WINDOW * | win1 |
| WINDOW * | win2 |
| Two window buffers for drawing. | |
| WINDOW * | curr_win |
| Current drawing buffer. | |
| int | window_horiz |
| Max window width. | |
| int | window_vert |
| Max window height. | |
Private Member Functions | |
| GraphicsManager () | |
| Private since a singleton. | |
| GraphicsManager (GraphicsManager const &) | |
| Don't allow copy. | |
| void | operator= (GraphicsManager const &) |
| Don't allow assignment. | |
| int GraphicsManager::drawCh | ( | Position | world_pos, |
| char | ch | ||
| ) |
Draw a character at screen location (x,y) (with default color).
Return 0 if ok, else -1.
| int GraphicsManager::drawCh | ( | Position | world_pos, |
| char | ch, | ||
| int | color | ||
| ) |
Draw a character at screen location (x,y) with color.
Return 0 if ok, else -1.
Draw single sprite frame at screen location (x,y) with color.
If centered true then center frame at (x,y). Return 0 if ok, else -1.
| int GraphicsManager::drawString | ( | Position | world_pos, |
| string | str, | ||
| Justification | just, | ||
| int | color | ||
| ) |
Draw string at screen location (x,y) with default color.
Justified LEFT, CENTER or RIGHT. Return 0 if ok, else -1.
| int GraphicsManager::startUp | ( | ) | [virtual] |
Get terminal ready for text-based display.
Return 0 if ok, else return negative number.
Reimplemented from Manager.
| int GraphicsManager::swapBuffers | ( | ) |
Render current display buffer.
Return 0 if ok, else -1.
1.7.3