mirror of
https://github.com/gwm17/glfw.git
synced 2024-11-26 20:28:49 -05:00
Fix the found issue. Found needs to be 1.
This is needed for realloc, while index should be 0. So using i for the index, and found for the count.
This commit is contained in:
parent
f306ea2f5d
commit
d300aa3255
|
@ -51,20 +51,19 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
|
|||
out->num_modes &&
|
||||
out->current_mode < out->num_modes)
|
||||
{
|
||||
found++;
|
||||
monitors = realloc(monitors, sizeof(_GLFWmonitor*) * found);
|
||||
monitors[found] = _glfwAllocMonitor("Unknown",
|
||||
monitors[i] = _glfwAllocMonitor("Unknown",
|
||||
out->physical_width_mm,
|
||||
out->physical_height_mm);
|
||||
|
||||
monitors[found]->mir.x = out->position_x;
|
||||
monitors[found]->mir.y = out->position_y;
|
||||
monitors[found]->mir.output_id = out->output_id;
|
||||
monitors[found]->mir.cur_mode = out->current_mode;
|
||||
monitors[i]->mir.x = out->position_x;
|
||||
monitors[i]->mir.y = out->position_y;
|
||||
monitors[i]->mir.output_id = out->output_id;
|
||||
monitors[i]->mir.cur_mode = out->current_mode;
|
||||
|
||||
monitors[found]->modes = _glfwPlatformGetVideoModes(monitors[found],
|
||||
&monitors[found]->modeCount);
|
||||
|
||||
found++;
|
||||
monitors[i]->modes = _glfwPlatformGetVideoModes(monitors[i],
|
||||
&monitors[i]->modeCount);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user