b3view/UserInterface.h

74 lines
1.8 KiB
C
Raw Normal View History

2010-04-21 07:48:36 -07:00
#ifndef USERINTERFACE_H
#define USERINTERFACE_H
// Forward declaration of class Engine
class Engine;
#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"
#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,
2019-03-07 21:52:29 -08:00
UIE_LOADTEXTUREDIALOG = 1006,
UIE_PLAYBACKINCREASEBUTTON = 1007,
UIE_PLAYBACKDECREASEBUTTON = 1008
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
};
class UserInterface : public irr::IEventReceiver
2010-04-21 07:48:36 -07:00
{
private:
Engine *m_Engine;
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();
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-03-07 21:52:29 -08:00
bool KeyIsDown[irr::KEY_KEY_CODES_COUNT];
irr::s32 keyState[irr::KEY_KEY_CODES_COUNT];
irr::s32 LMouseState,RMouseState;
2010-04-21 07:48:36 -07:00
public:
2019-03-07 21:52:29 -08:00
irr::gui::IGUIButton *playbackStartStopButton;
irr::gui::IGUIButton *playbackIncreaseButton;
irr::gui::IGUIButton *playbackDecreaseButton;
2010-04-21 07:48:36 -07:00
UserInterface( Engine *device );
~UserInterface();
irr::gui::IGUIEnvironment *getGUIEnvironment() const;
void drawStatusLine() const;
bool loadNextTexture(int direction);
2010-04-21 07:48:36 -07:00
// IEventReceiver
virtual bool OnEvent( const irr::SEvent &event );
2010-04-21 07:48:36 -07:00
};
#endif // USERINTERFACE_H