File tree Expand file tree Collapse file tree 1 file changed +12
-15
lines changed
Expand file tree Collapse file tree 1 file changed +12
-15
lines changed Original file line number Diff line number Diff line change @@ -56,22 +56,19 @@ int main(void)
5656 // Update
5757 //----------------------------------------------------------------------------------
5858
59- // Rebuild monitors array with the new monitor count
60- if (monitorCount != GetMonitorCount ())
59+ // Rebuild monitors array every frame
60+ monitorCount = GetMonitorCount ();
61+ for (int i = 0 ; i < monitorCount ; i ++ )
6162 {
62- monitorCount = GetMonitorCount ();
63- for (int i = 0 ; i < monitorCount ; i ++ )
64- {
65- monitors [i ] = (Monitor ){
66- GetMonitorPosition (i ),
67- GetMonitorName (i ),
68- GetMonitorWidth (i ),
69- GetMonitorHeight (i ),
70- GetMonitorPhysicalWidth (i ),
71- GetMonitorPhysicalHeight (i ),
72- GetMonitorRefreshRate (i )
73- };
74- }
63+ monitors [i ] = (Monitor ){
64+ GetMonitorPosition (i ),
65+ GetMonitorName (i ),
66+ GetMonitorWidth (i ),
67+ GetMonitorHeight (i ),
68+ GetMonitorPhysicalWidth (i ),
69+ GetMonitorPhysicalHeight (i ),
70+ GetMonitorRefreshRate (i )
71+ };
7572 }
7673
7774 if (IsKeyPressed (KEY_ENTER ) && monitorCount > 1 )
You can’t perform that action at this time.
0 commit comments