Nazaj na multithreadanje - fonti

This commit is contained in:
2026-03-12 16:18:51 +01:00
parent 834f0b29c3
commit 74159a6fda
20 changed files with 254 additions and 43 deletions

View File

@@ -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;
};
}