#include <Menu.h>
Inherits GLInterface.
Inheritance diagram for Menu:
Public Member Functions | |
Menu (Window *p_window) | |
Standard constructor. | |
virtual | ~Menu () |
Standard destructor. | |
std::string | getLevelName (std::string p_directory, std::string p_mask) |
Displays the Menu and will return as soon as a level has been choosen. | |
eGameMode | getGameMode () |
Displays the Menu and will return as soon as a game mode has been selected. | |
std::string | getString (std::string p_display, std::string p_default=std::string("")) |
Displays the Menu and returns a free text from the user. | |
Protected Member Functions | |
std::vector< std::string > | getLevelFiles (std::string p_filemask) |
Reads all files by a given wildcard mask. | |
std::string | getSelectedItem (std::vector< std::string > &p_options, int p_maxOption=-1) |
Selects the Menuentry. | |
int | renderSelectionList (std::vector< std::string > &p_options, unsigned int p_currentElement) |
Technically renders the Menu as selection list and highlight the selected Entry. | |
int | renderInputText (std::string p_display, std::string p_input) |
Technically renders an Textinputfield. | |
Private Member Functions | |
int | writeText (std::vector< std::string > p_text, int p_highlightedLine) |
Writes the given text on the screen. | |
int | initGL () |
Initializes OpenGL for menu output. |
Definition at line 44 of file Menu.h.
Menu::Menu | ( | Window * | p_window | ) |
std::string Menu::getLevelName | ( | std::string | p_directory, | |
std::string | p_mask | |||
) |
Displays the Menu and will return as soon as a level has been choosen.
Definition at line 37 of file Menu.cpp.
References getLevelFiles(), and getSelectedItem().
Referenced by WinMain().
Here is the call graph for this function:
eGameMode Menu::getGameMode | ( | ) |
std::string Menu::getString | ( | std::string | p_display, | |
std::string | p_default = std::string("") | |||
) |
Displays the Menu and returns a free text from the user.
p_display | Text for the prompt. | |
p_default | Text that will be entered per default. |
Definition at line 86 of file Menu.cpp.
References Window::checkMessages(), Window::clearCurrent(), initGL(), GLInterface::inputMessages, renderInputText(), and GLInterface::window.
Referenced by WinMain().
Here is the call graph for this function:
std::vector< std::string > Menu::getLevelFiles | ( | std::string | p_filemask | ) | [protected] |
Reads all files by a given wildcard mask.
p_filemask | The wildcard mask for the files to collect. |
Definition at line 203 of file Menu.cpp.
Referenced by getLevelName().
std::string Menu::getSelectedItem | ( | std::vector< std::string > & | p_options, | |
int | p_maxOption = -1 | |||
) | [protected] |
Selects the Menuentry.
p_options | The options to show. | |
p_maxOption | The maximum number for selecting. |
Definition at line 125 of file Menu.cpp.
References Window::checkMessages(), Window::clearCurrent(), initGL(), GLInterface::inputMessages, renderSelectionList(), sleep(), and GLInterface::window.
Referenced by getGameMode(), and getLevelName().
Here is the call graph for this function:
int Menu::renderSelectionList | ( | std::vector< std::string > & | p_options, | |
unsigned int | p_currentElement | |||
) | [protected] |
Technically renders the Menu as selection list and highlight the selected Entry.
p_options | All options to display | |
p_currentElement | Index of the highlighted element. |
Definition at line 186 of file Menu.cpp.
References writeText().
Referenced by getSelectedItem().
Here is the call graph for this function:
int Menu::renderInputText | ( | std::string | p_display, | |
std::string | p_input | |||
) | [protected] |
Technically renders an Textinputfield.
Definition at line 193 of file Menu.cpp.
References writeText().
Referenced by getString().
Here is the call graph for this function:
int Menu::writeText | ( | std::vector< std::string > | p_text, | |
int | p_highlightedLine | |||
) | [private] |
Writes the given text on the screen.
It also highlights one entry.
p_text | The lines to wirte on the screen. | |
p_highlightedLine | The number of the line which should be highlighted. |
Definition at line 231 of file Menu.cpp.
References GLInterface::glPrint2d(), Window::height, Window::swapBuffers(), Window::width, and GLInterface::window.
Referenced by renderInputText(), and renderSelectionList().
Here is the call graph for this function:
int Menu::initGL | ( | ) | [private, virtual] |
Initializes OpenGL for menu output.
Here the characters will be generated.
Reimplemented from GLInterface.
Definition at line 224 of file Menu.cpp.
References GLInterface::initGL().
Referenced by getSelectedItem(), and getString().
Here is the call graph for this function: