b3view/Engine.h

78 lines
1.5 KiB
C
Raw Normal View History

2010-04-21 07:48:36 -07:00
#ifndef ENGINE_H
#define ENGINE_H
// Forward declaration of class UserInterface
class UserInterface;
class View;
#include <string>
2010-04-22 01:44:10 -07:00
#include <sstream>
2010-04-21 07:48:36 -07:00
#include <iostream>
2019-03-07 08:12:09 -08:00
#include <irrlicht/irrlicht.h>
2010-04-21 07:48:36 -07:00
#include "EventHandler.h"
#include "UserInterface.h"
#include "View.h"
#include "extlib/CGUITTFont.h"
2010-04-21 07:48:36 -07:00
using std::cout;
using std::endl;
using std::wstring;
2010-04-22 01:44:10 -07:00
using std::wstringstream;
2010-04-21 07:48:36 -07:00
using namespace irr;
using namespace irr::core;
using namespace irr::scene;
using namespace irr::video;
using namespace irr::gui;
enum SceneItemID
{
SIID_LIGHT = 1,
SIID_CAMERA = 2,
SIID_MODEL = 3
};
class Engine
{
friend class UserInterface;
friend class View;
2019-03-07 14:17:42 -08:00
wstring previousMeshPath;
2010-04-21 07:48:36 -07:00
private:
IrrlichtDevice *m_Device;
IVideoDriver *m_Driver;
ISceneManager *m_Scene;
IAnimatedMeshSceneNode *m_LoadedMesh;
2010-08-16 05:23:20 -07:00
ILightSceneNode *m_SceneLight;
CGUITTFont *m_AxisFont;
CGUITTFace *m_AxisFontFace;
2010-04-21 07:48:36 -07:00
dimension2d<u32> *m_WindowSize;
bool m_RunEngine;
EventHandler *m_EventHandler;
UserInterface *m_UserInterface;
View *m_View;
void setupScene();
void drawAxisLines();
void drawBackground();
void checkResize();
2010-04-22 05:16:15 -07:00
IGUIEnvironment *getGUIEnvironment() const;
s32 getNumberOfVertices();
2010-04-21 07:48:36 -07:00
public:
Engine();
~Engine();
2019-03-07 14:17:42 -08:00
void run();
2019-03-07 10:23:54 -08:00
void loadMesh( const wstring &fileName );
2019-03-07 14:17:42 -08:00
void loadTexture( const wstring &fileName );
2010-08-16 05:23:20 -07:00
void setMeshDisplayMode( bool wireframe = false, bool lighting = true );
2010-04-21 07:48:36 -07:00
};
#endif // ENGINE_H