55 lines
834 B
C++
55 lines
834 B
C++
|
#include "menumanager.h"
|
||
|
|
||
|
MenuManager::MenuManager() {
|
||
|
aktuell = 0;
|
||
|
}
|
||
|
|
||
|
void MenuManager::addMenu(MenuMenu *mm) {
|
||
|
menus.push_back(mm);
|
||
|
if(menus.size()==1)
|
||
|
aktuell = mm;
|
||
|
}
|
||
|
|
||
|
bool MenuManager::changeMenu(MenuMenu *mm) {
|
||
|
for(unsigned int i=0; i<menus.size(); i++) {
|
||
|
if(menus[i]==mm) {
|
||
|
aktuell = mm;
|
||
|
return true;
|
||
|
}
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
void MenuManager::render() {
|
||
|
glEnable(GL_TEXTURE_2D);
|
||
|
GLFontEngine::prepare2DbyPushingMatrix();
|
||
|
if(aktuell)
|
||
|
aktuell->render();
|
||
|
GLFontEngine::regain3DbyPoppingMatrix();
|
||
|
}
|
||
|
|
||
|
void MenuManager::up() {
|
||
|
if(aktuell)
|
||
|
aktuell->up();
|
||
|
}
|
||
|
|
||
|
void MenuManager::down() {
|
||
|
if(aktuell)
|
||
|
aktuell->down();
|
||
|
}
|
||
|
|
||
|
void MenuManager::left() {
|
||
|
if(aktuell)
|
||
|
aktuell->left();
|
||
|
}
|
||
|
|
||
|
void MenuManager::right() {
|
||
|
if(aktuell)
|
||
|
aktuell->right();
|
||
|
}
|
||
|
|
||
|
void MenuManager::select() {
|
||
|
if(aktuell)
|
||
|
aktuell->select();
|
||
|
}
|