Files
dae16-VerhulstBram-GameProject/Engine/BaseGame.h
Bram Verhulst 39c744ba79 Add Imgui, Add TextureManager
From 1.1k texture loads to 5
2024-03-18 12:22:56 +01:00

74 lines
1.3 KiB
C++

#pragma once
#include "structs.h"
#include "SDL.h"
// https://BaseGameprogrammingpatterns.com/subclass-sandbox.html
class BaseGame
{
public:
explicit BaseGame( const Window& window );
BaseGame( const BaseGame& other ) = delete;
BaseGame& operator=( const BaseGame& other ) = delete;
BaseGame(BaseGame&& other) = delete;
BaseGame& operator=(BaseGame&& other) = delete;
virtual ~BaseGame( );
void Run( );
virtual void Update(float elapsedSec)
{
}
virtual void Draw() const
{
}
// Event handling
virtual void ProcessKeyDownEvent(const SDL_KeyboardEvent& e)
{
}
virtual void ProcessKeyUpEvent(const SDL_KeyboardEvent& e)
{
}
virtual void ProcessMouseMotionEvent(const SDL_MouseMotionEvent& e)
{
}
virtual void ProcessMouseDownEvent(const SDL_MouseButtonEvent& e)
{
}
virtual void ProcessMouseUpEvent(const SDL_MouseButtonEvent& e)
{
}
virtual void ProcessImGui(){}
const Rectf& GetViewPort() const
{
return m_Viewport;
}
private:
// DATA MEMBERS
// The window properties
const Window m_Window;
const Rectf m_Viewport;
// The window we render to
SDL_Window* m_pWindow;
// OpenGL context
SDL_GLContext m_pContext;
// Init info
bool m_Initialized;
// Prevent timing jumps when debugging
const float m_MaxElapsedSeconds;
// FUNCTIONS
void InitializeGameEngine( );
void CleanupGameEngine( );
};