Nazaj na multithreadanje - fonti
This commit is contained in:
@@ -2,11 +2,13 @@
|
||||
|
||||
#include <string>
|
||||
#include <SDL3/SDL.h>
|
||||
#include <SDL3_ttf/SDL_ttf.h>
|
||||
#include <iostream>
|
||||
|
||||
#include <thread>
|
||||
#include <utils.hpp>
|
||||
#include <renderer/renderer.hpp>
|
||||
#include <state/gamestate.hpp>
|
||||
#include <game/gamemanager.hpp>
|
||||
|
||||
namespace Game::Window {
|
||||
class Window {
|
||||
@@ -18,11 +20,17 @@ namespace Game::Window {
|
||||
bool init(int width, int height, const std::string& title);
|
||||
void run();
|
||||
|
||||
void setTargetFPS(int fps) { mTargetFPS = fps; }
|
||||
int getTargetFPS() { return mTargetFPS; }
|
||||
|
||||
Renderer::Renderer* getRenderer() { return &mRenderer; }
|
||||
|
||||
private:
|
||||
SDL_Window* mWindow;
|
||||
Renderer::Renderer mRenderer;
|
||||
Game::GameManager mGameManager;
|
||||
std::jthread mGameThread;
|
||||
bool mRunning;
|
||||
int mTargetFPS = 60;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user