mirror of
https://github.com/glfw/glfw.git
synced 2026-11-18 04:44:54 +00:00
Removed window size DWIM.
This commit is contained in:
+4
-15
@@ -263,22 +263,11 @@ GLFWAPI GLFWwindow glfwCreateWindow(int width, int height,
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
// Check width & height
|
||||
if (width > 0 && height <= 0)
|
||||
if (width <= 0 || height <= 0)
|
||||
{
|
||||
// Set the window aspect ratio to 4:3
|
||||
height = (width * 3) / 4;
|
||||
}
|
||||
else if (width <= 0 && height > 0)
|
||||
{
|
||||
// Set the window aspect ratio to 4:3
|
||||
width = (height * 4) / 3;
|
||||
}
|
||||
else if (width <= 0 && height <= 0)
|
||||
{
|
||||
// Default window size
|
||||
width = 640;
|
||||
height = 480;
|
||||
_glfwSetError(GLFW_INVALID_VALUE,
|
||||
"glfwCreateWindow: Invalid window size");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
window = (_GLFWwindow*) calloc(1, sizeof(_GLFWwindow));
|
||||
|
||||
Reference in New Issue
Block a user