SQCSimulator2023/SQCSim2021/engine.h
Marc-Eric Martel c3c432c369 GUI
2021-10-26 17:28:37 -04:00

62 lines
1.6 KiB
C++

#ifndef ENGINE_H__
#define ENGINE_H__
#include "define.h"
#include "openglcontext.h"
#include "texture.h"
#include "transformation.h"
#include "shader.h"
#include "player.h"
#include "chunk.h"
#include "skybox.h"
#include "audio.h"
#include "textureatlas.h"
class Engine : public OpenglContext
{
public:
Engine();
virtual ~Engine();
virtual void Init();
virtual void DeInit();
virtual void LoadResource();
virtual void UnloadResource();
virtual void Render(float elapsedTime);
virtual void KeyPressEvent(unsigned char key);
virtual void KeyReleaseEvent(unsigned char key);
virtual void MouseMoveEvent(int x, int y);
virtual void MousePressEvent(const MOUSE_BUTTON &button, int x, int y);
virtual void MouseReleaseEvent(const MOUSE_BUTTON &button, int x, int y);
private:
bool LoadTexture(Texture& texture, const std::string& filename, bool stopOnError = true);
void DrawHud(float elapsedTime);
void PrintText(unsigned int x, unsigned int y, const std::string& t);
int GetFps(float elapsedTime) const;
private:
bool m_wireframe = false;
Texture m_textureFloor;
Texture m_textureSkybox;
Texture m_textureFont;
Texture m_textureCrosshair;
Texture m_textureCube1;
TextureAtlas m_textureAtlas = TextureAtlas(128);
Skybox m_skybox;
Shader m_shader01;
Chunk m_testChunk;
Audio m_audio = Audio(AUDIO_PATH "music01.wav");
Player m_player = Player(Vector3f(0, 0, 0));
bool m_keyW = false;
bool m_keyA = false;
bool m_keyS = false;
bool m_keyD = false;
bool m_keylshift = false;
bool m_keySpace = false;
};
#endif // ENGINE_H__