80 virtual void Quit() { m_isRunning =
false; }
88 static void SetScreenResolution(
int width,
int height) { s_screenWidth = width; s_screenHeight = height; }
114 virtual void SetFullScreen(
bool isFullScreen) { m_isFullScreen = isFullScreen; }
125 static int s_screenWidth;
126 static int s_screenHeight;
128 static std::string s_windowTitle;
129 static std::string s_contentDirectory;
131 bool m_isInitialized =
false;
132 bool m_isRunning =
false;
133 bool m_isFullScreen =
false;
134 bool m_requireOpenGL =
false;
136 double m_targetFramesPerSecond = 0;
137 double m_inverseTargetFrames = 0;
138 double m_actualFramesPerSec = 0;
139 double m_currentTime = 0;
140 double m_previousTime = 0;
141 float m_frameCounter = 0;
151 Font *m_pFrameCounterFont =
nullptr;
153 bool IsRunning()
const {
return m_isRunning; }
Represents a font or true-type font.
Base class for all games. Provides graphics initialization, game loop, and rendering code....
virtual std::string GetName() const =0
Gets the name of the game.
virtual void SetResourceDirectory(const std::string &path)
Sets the location of the directory where the game's resources are stored.
virtual int Run()
Runs the game instance.
virtual void ResetGameTime()
Resets the game's timing values.
static void SetWindowTitle(std::string title)
Sets the title of the game window.
virtual void DisplayFrameRate()
Displays the game's current frame rate.
static int GetScreenHeight()
Gets the screen width in pixels.
static int GetScreenWidth()
Gets the screen width in pixels.
virtual void SetFrameCounterFont(Font *pFont)
Sets the font for the frame counter.
virtual void SetTargetFramesPerSecond(int const frames)
Sets the target frame rate for the game.
virtual ScreenManager * GetScreenManager() const
Gets a pointer to the ScreenManager, for managing game screens.
virtual void UnloadContent()
Called when resources need to be unloaded. Override this method to unload any game-specific resources...
virtual void SetOpenGLFlag()
Sets the OpenGL flag, which forces OpenGL rendering.
virtual void Quit()
Quits the game.
static Vector2 GetScreenCenter()
Gets the screen size in pixels.
virtual SpriteBatch * GetSpriteBatch() const
Gets a pointer to the SpriteBatch, for rendering.
virtual void Update(const GameTime &gameTime)
Called when the game has determined that game logic needs to be processed.
static void SetScreenResolution(int width, int height)
Sets the screen resolution.
virtual void LoadContent(ResourceManager &resourceManager)
Called when resources need to be loaded.
virtual void InitializeScreenManager()
Initializes the game's ScreenManager.
virtual void Draw(SpriteBatch &spriteBatch)
Called when the game determines it is time to draw a frame.
virtual ResourceManager * GetResourceManager() const
Gets a pointer to the ResourceManager, for loading and managing resources.
virtual void SetFullScreen(bool isFullScreen)
Sets the game to display in fullscreen mode.
Contains timing values for game updates and rendering.
Loads and manages the lifespan of objects from external files.
void SetContentPath(const std::string &path)
Sets the location of the folder where game resources are stored.
Updates, renders, and manages transitions between instances of the Screen class.
Enables a group of sprites to be drawn using the same settings.
Defines a vector with 2 components (x and y).
Katana Engine is a library of classes, interfaces, and value types that provides a foundation for dev...