2010-04-21 07:48:36 -07:00
|
|
|
#ifndef USERINTERFACE_H
|
|
|
|
#define USERINTERFACE_H
|
|
|
|
|
|
|
|
// Forward declaration of class Engine
|
|
|
|
class Engine;
|
|
|
|
|
2010-04-23 00:28:59 -07:00
|
|
|
#include <sstream>
|
2010-04-21 07:48:36 -07:00
|
|
|
#include <string>
|
2019-03-07 08:12:09 -08:00
|
|
|
#include <irrlicht/irrlicht.h>
|
2010-04-21 07:48:36 -07:00
|
|
|
|
|
|
|
#include "Debug.h"
|
|
|
|
#include "Engine.h"
|
|
|
|
|
2010-04-23 01:13:44 -07:00
|
|
|
#include "extlib/CGUITTFont.h"
|
|
|
|
|
2010-04-21 07:48:36 -07:00
|
|
|
enum UserInterfaceElements
|
|
|
|
{
|
2010-04-23 02:00:07 -07:00
|
|
|
UIE_PLAYBACKWINDOW = 1000,
|
|
|
|
UIE_LOADBUTTON = 1001,
|
|
|
|
UIE_LOADFILEDIALOG = 1002,
|
|
|
|
UIE_FILEMENU = 1003,
|
2010-08-16 05:23:20 -07:00
|
|
|
UIE_PLAYBACKSTARTSTOPBUTTON = 1004,
|
2019-03-07 14:17:42 -08:00
|
|
|
UIE_VIEWMENU = 1005,
|
|
|
|
UIE_LOADTEXTUREDIALOG = 1006
|
2010-04-21 07:48:36 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
enum UserInterfaceCommands
|
|
|
|
{
|
2019-03-07 14:17:42 -08:00
|
|
|
UIC_FILE_LOAD = 1000,
|
|
|
|
UIC_FILE_QUIT = 1001,
|
|
|
|
UIC_FILE_LOAD_TEXTURE = 1002,
|
|
|
|
UIC_VIEW_WIREFRAME = 2000,
|
|
|
|
UIC_VIEW_LIGHTING = 2001
|
2010-04-21 07:48:36 -07:00
|
|
|
};
|
|
|
|
|
2019-03-07 19:18:07 -08:00
|
|
|
class UserInterface : public irr::IEventReceiver
|
2010-04-21 07:48:36 -07:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
Engine *m_Engine;
|
2019-03-07 19:18:07 -08:00
|
|
|
irr::gui::IGUIEnvironment *m_Gui;
|
|
|
|
irr::gui::CGUITTFont *m_GuiFont;
|
|
|
|
irr::gui::CGUITTFace *m_GuiFontFace;
|
2010-04-21 07:48:36 -07:00
|
|
|
|
|
|
|
void setupUserInterface();
|
|
|
|
void displayLoadFileDialog();
|
2019-03-07 14:17:42 -08:00
|
|
|
void displayLoadTextureDialog();
|
2019-03-07 19:18:07 -08:00
|
|
|
void handleMenuItemPressed(irr::gui::IGUIContextMenu *menu);
|
2010-04-21 07:48:36 -07:00
|
|
|
|
2010-08-16 05:23:20 -07:00
|
|
|
bool m_WireframeDisplay;
|
|
|
|
bool m_Lighting;
|
|
|
|
|
2010-04-21 07:48:36 -07:00
|
|
|
public:
|
|
|
|
UserInterface( Engine *device );
|
|
|
|
~UserInterface();
|
2019-03-07 19:18:07 -08:00
|
|
|
irr::gui::IGUIEnvironment *getGUIEnvironment() const;
|
2010-04-23 00:28:59 -07:00
|
|
|
void drawStatusLine() const;
|
2010-04-21 07:48:36 -07:00
|
|
|
|
|
|
|
// IEventReceiver
|
2019-03-07 19:18:07 -08:00
|
|
|
virtual bool OnEvent( const irr::SEvent &event );
|
2010-04-21 07:48:36 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // USERINTERFACE_H
|