extra settings for window

main
Brett 2024-10-27 18:10:55 -04:00
parent 8103a3ad0f
commit 1983a6789e
6 changed files with 38 additions and 5 deletions

View File

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

View File

@ -36,6 +36,10 @@ namespace blt::gfx
std::string title;
std::int32_t width;
std::int32_t height;
GLFWmonitor* monitor = nullptr;
GLFWwindow* share = nullptr;
GLFWwindow* window = nullptr;
std::int32_t maximized = GLFW_FALSE;
window_context context{};
std::int32_t sync_interval = 0;
@ -86,6 +90,12 @@ namespace blt::gfx
sync_interval = sync;
return *this;
}
window_data& setMonitor(GLFWmonitor* monitor);
window_data& setShare(GLFWwindow* share);
window_data& setMaximized(bool b);
};
void init(window_data data);

@ -1 +1 @@
Subproject commit 3003e424e17a5c639a8b89d5c721c94c47f3402a
Subproject commit e81f590f5e4f8c79ec99307fcf7d7cbbfcc83217

@ -1 +1 @@
Subproject commit 4d00bf8add44155a4f6b489538bd77d6214a4432
Subproject commit ccb6646baeac88d276078ebade5616f4c6d7c03a

@ -1 +1 @@
Subproject commit 7ac9a5c2b1264fbba2fff2b67a83d820d5449df7
Subproject commit c2a15a0c7c5ec8dc774b110de1cbe54b26fe0c3f

View File

@ -243,9 +243,11 @@ namespace blt::gfx
glfwWindowHint(GLFW_DOUBLEBUFFER, data.context.DOUBLE_BUFFER);
glfwWindowHint(GLFW_OPENGL_PROFILE, data.context.GL_PROFILE);
glfwWindowHint(GLFW_SAMPLES, data.context.SAMPLES);
glfwWindowHint(GLFW_MAXIMIZED, data.maximized);
/* -- Create the Window -- */
window_state.window = glfwCreateWindow(data.width, data.height, data.title.c_str(), nullptr, nullptr);
window_state.window = glfwCreateWindow(data.width, data.height, data.title.c_str(), data.monitor, data.share);
data.window = window_state.window;
BLT_ASSERT(window_state.window && "Unable to create GLFW window.");
/* -- Set Window Specifics + OpenGL -- */
@ -401,4 +403,25 @@ namespace blt::gfx
glfwSetWindowSize(window_state.window, width, height);
return *this;
}
window_data& window_data::setMonitor(GLFWmonitor* m)
{
window_data::monitor = m;
return *this;
}
window_data& window_data::setShare(GLFWwindow* s)
{
window_data::share = s;
return *this;
}
window_data& window_data::setMaximized(bool b)
{
if (b)
window_data::maximized = GLFW_TRUE;
else
window_data::maximized = GLFW_FALSE;
return *this;
}
}