2010-04-21 07:48:36 -07:00
|
|
|
#ifndef USERINTERFACE_H
|
|
|
|
#define USERINTERFACE_H
|
|
|
|
|
2019-03-07 08:12:09 -08:00
|
|
|
#include <irrlicht/irrlicht.h>
|
2010-04-23 01:13:44 -07:00
|
|
|
#include "extlib/CGUITTFont.h"
|
|
|
|
|
2019-03-09 12:42:40 -08:00
|
|
|
// Forward declaration of class Engine
|
|
|
|
class Engine;
|
|
|
|
|
2010-04-21 07:48:36 -07:00
|
|
|
enum UserInterfaceElements
|
|
|
|
{
|
2010-04-23 02:00:07 -07:00
|
|
|
UIE_FILEMENU = 1003,
|
2019-04-10 23:30:48 -07:00
|
|
|
UIE_LOADFILEDIALOG = 1100,
|
|
|
|
// UIE_LOADBUTTON = 1101,
|
|
|
|
UIE_LOADTEXTUREDIALOG = 1200,
|
|
|
|
|
|
|
|
UIE_VIEWMENU = 2000,
|
|
|
|
|
|
|
|
UIE_PLAYBACKWINDOW = 3000,
|
|
|
|
UIE_PLAYBACKSTARTSTOPBUTTON = 3001,
|
|
|
|
UIE_PLAYBACKINCREASEBUTTON = 3002,
|
|
|
|
UIE_PLAYBACKDECREASEBUTTON = 3003,
|
|
|
|
UIE_PLAYBACKSETFRAMEEDITBOX = 3004,
|
|
|
|
UIE_TEXTUREPATHSTATICTEXT = 3005,
|
|
|
|
UIE_TEXTUREPATHEDITBOX = 3006
|
2010-04-21 07:48:36 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
enum UserInterfaceCommands
|
|
|
|
{
|
2019-04-08 19:52:18 -07:00
|
|
|
UIC_FILE_LOAD = 1000,
|
|
|
|
UIC_FILE_QUIT = 1001,
|
|
|
|
UIC_FILE_LOAD_TEXTURE = 1002,
|
2019-04-10 23:30:48 -07:00
|
|
|
UIC_VIEW_WIREFRAME = 2001,
|
|
|
|
UIC_VIEW_LIGHTING = 2002,
|
|
|
|
UIC_VIEW_TEXTURE_INTERPOLATION = 2003
|
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;
|
2019-04-08 19:52:18 -07:00
|
|
|
bool m_TextureInterpolation;
|
2019-04-10 23:30:48 -07:00
|
|
|
irr::gui::IGUIWindow *playbackWindow;
|
2010-04-21 07:48:36 -07:00
|
|
|
public:
|
2019-04-08 19:52:18 -07:00
|
|
|
irr::gui::IGUIContextMenu *menu;
|
|
|
|
irr::gui::IGUIContextMenu *fileMenu;
|
|
|
|
irr::gui::IGUIContextMenu *viewMenu;
|
2019-03-07 21:52:29 -08:00
|
|
|
irr::gui::IGUIButton *playbackStartStopButton;
|
|
|
|
irr::gui::IGUIButton *playbackIncreaseButton;
|
|
|
|
irr::gui::IGUIButton *playbackDecreaseButton;
|
2019-04-03 07:35:27 -07:00
|
|
|
irr::gui::IGUIEditBox *playbackSetFrameEditBox;
|
2019-04-08 19:52:18 -07:00
|
|
|
irr::gui::IGUIStaticText *texturePathStaticText;
|
|
|
|
irr::gui::IGUIEditBox *texturePathEditBox;
|
|
|
|
irr::u32 INDEX_VIEW_TEXTURE_INTERPOLATION;
|
|
|
|
irr::u32 INDEX_VIEW_WIREFRAME_MESH;
|
|
|
|
irr::u32 INDEX_VIEW_LIGHTING;
|
|
|
|
|
2019-03-07 21:52:29 -08:00
|
|
|
|
2010-04-21 07:48:36 -07:00
|
|
|
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;
|
2019-03-07 23:30:06 -08:00
|
|
|
bool loadNextTexture(int direction);
|
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
|