File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,12 +6,12 @@ using namespace Limitless;
66
77Context::Context (
88 const std::string& title,
9- glm::uvec2 size ,
9+ glm::uvec2 _size ,
1010 const Context* shared,
1111 const WindowHints& hints
1212) : ContextInitializer()
1313 , ContextState()
14- , size {size } {
14+ , size {_size } {
1515 // sets window hints for creation
1616 for (const auto & [hint, value] : hints) {
1717 glfwWindowHint (static_cast <int >(hint), value);
@@ -23,6 +23,13 @@ Context::Context(
2323 throw context_error {" Failed to create window" };
2424 }
2525
26+ // The created window, framebuffer and context may differ from what you requested.
27+ int framebuffer_width = 0 ;
28+ int framebuffer_height = 0 ;
29+ glfwGetFramebufferSize (window, &framebuffer_width, &framebuffer_height);
30+
31+ size = glm::uvec2 (framebuffer_width, framebuffer_height);
32+
2633 if (!glew_inited) {
2734 makeCurrent ();
2835 initializeGLEW ();
You can’t perform that action at this time.
0 commit comments