fix: change renderer to class

This commit is contained in:
2021-09-18 18:58:32 +02:00
parent 519c6e33e7
commit a8b6a646af
10 changed files with 150 additions and 121 deletions

View File

@@ -23,12 +23,13 @@
namespace TowerGui{
static GLFWwindow* window;
static std::unique_ptr<td::client::Client> client = std::make_unique<td::client::Client>();
static std::unique_ptr<td::client::Client> client;
static std::thread* serverThread;
static td::render::Renderer* renderer;
bool serverShouldStop = false;
void init(GLFWwindow* glfw_window){
void init(GLFWwindow* glfw_window, td::render::Renderer* render){
window = glfw_window;
IMGUI_CHECKVERSION();
ImGui::CreateContext();
@@ -39,6 +40,8 @@ void init(GLFWwindow* glfw_window){
ImFontConfig c;
c.SizePixels = 25;
ImGui::GetIO().Fonts->AddFontDefault(&c);
renderer = render;
client = std::make_unique<td::client::Client>(render);
}
void beginFrame(){
@@ -62,7 +65,7 @@ void renderFPSCounter(){
}
static bool isometric = true;
if (ImGui::Checkbox("Vue Isometrique ?", &isometric)){
td::render::Renderer::setIsometricView(isometric);
renderer->setIsometricView(isometric);
}
ImGui::End();
}