fix issue with width/height not being updated

main
Brett 2024-04-30 01:57:37 -04:00
parent 7d2028cc55
commit 756b6a636e
4 changed files with 11 additions and 5 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.25)
set(BLT_GRAPHICS_VERSION 0.11.6)
set(BLT_GRAPHICS_VERSION 0.11.7)
set(BLT_GRAPHICS_TEST_VERSION 0.0.1)
project(BLT_WITH_GRAPHICS VERSION ${BLT_GRAPHICS_VERSION})

View File

@ -93,9 +93,13 @@ namespace blt::gfx
// texture to use
std::string texture_name;
// color to use
blt::vec4 color;
blt::color4 color;
// how much to blend the texture into the color? note blending is always additive!
blt::vec4 blend;
blt::color4 blend;
// should we outline this object?
bool outline;
// what color should we outline with?
blt::color4 outline_color;
};
class batch_renderer_2d

@ -1 +1 @@
Subproject commit 86fd4a2a9aa18b4dbe8b3688849f7ef81d54f27c
Subproject commit 133728b64100292779df64436c51c61317f608f5

View File

@ -151,10 +151,12 @@ namespace blt::gfx
void loop(void* arg)
{
const auto& data = *((window_data*) arg);
auto& data = *((window_data*) arg);
/* -- Get the current framebuffer size, update the global width/height state, along with OpenGL viewport -- */
glfwGetFramebufferSize(window_state.window, &window_state.width, &window_state.height);
glViewport(0, 0, window_state.width, window_state.height);
data.width = window_state.width;
data.height = window_state.height;
// TODO: user option for this
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);