refactor + auto max atlas resolution

This commit is contained in:
MihailRis
2024-04-10 18:18:55 +03:00
parent befc9cf09c
commit eb70e1c0df
7 changed files with 46 additions and 12 deletions
+8
View File
@@ -3,6 +3,7 @@
#include "Events.h"
#include "../debug/Logger.h"
#include "../graphics/core/ImageData.h"
#include "../graphics/core/Texture.h"
#include <GL/glew.h>
#include <GLFW/glfw3.h>
@@ -145,6 +146,13 @@ int Window::initialize(DisplaySettings& settings){
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
GLint maxTextureSize[1]{static_cast<GLint>(Texture::MAX_RESOLUTION)};
glGetIntegerv(GL_MAX_TEXTURE_SIZE, maxTextureSize);
if (maxTextureSize[0] > 0) {
Texture::MAX_RESOLUTION = maxTextureSize[0];
logger.info() << "max texture size is " << Texture::MAX_RESOLUTION;
}
glfwSetKeyCallback(window, key_callback);
glfwSetMouseButtonCallback(window, mouse_button_callback);
glfwSetCursorPosCallback(window, cursor_position_callback);