I've encountered a very weird behavior with c++. My code starts by reading the monitor width and height:
unsigned int width, height;
auto videoMode = glfwGetVideoMode(monitor);
width = videoMode->width; // Width is 1920
height = videoMode->height; // Height is 1080
Then I call the glfwCreateWindow function.
//GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, const char* title, GLFWmonitor* monitor, GLFWwindow* share);
window = glfwCreateWindow(width, height, "Name", monitor, share);
// width is 18
// height is 0
Note that width and height will get past as integers and not as references or pointers, so the original values should stay unchanged from my understanding. But somehow width changes to 18 and height to 0 when calling this function. What is the reason of this variable Change?
Edit: The height seems to be allways set to 0. The width seems to be set to a low random value. It also only happens, if share is set to nullptr.