@@ -1521,6 +1521,12 @@ int InitPlatform(void)
1521
1521
SetupFramebuffer (CORE .Window .display .width , CORE .Window .display .height );
1522
1522
1523
1523
platform .handle = glfwCreateWindow (CORE .Window .display .width , CORE .Window .display .height , (CORE .Window .title != 0 )? CORE .Window .title : " " , monitor , NULL );
1524
+ if (!platform .handle )
1525
+ {
1526
+ glfwTerminate ();
1527
+ TRACELOG (LOG_WARNING , "GLFW: Failed to initialize Window" );
1528
+ return -1 ;
1529
+ }
1524
1530
1525
1531
// NOTE: Full-screen change, not working properly...
1526
1532
//glfwSetWindowMonitor(platform.handle, glfwGetPrimaryMonitor(), 0, 0, CORE.Window.screen.width, CORE.Window.screen.height, GLFW_DONT_CARE);
@@ -1535,6 +1541,12 @@ int InitPlatform(void)
1535
1541
int creationHeight = CORE .Window .screen .height != 0 ? CORE .Window .screen .height : 1 ;
1536
1542
1537
1543
platform .handle = glfwCreateWindow (creationWidth , creationHeight , (CORE .Window .title != 0 )? CORE .Window .title : " " , NULL , NULL );
1544
+ if (!platform .handle )
1545
+ {
1546
+ glfwTerminate ();
1547
+ TRACELOG (LOG_WARNING , "GLFW: Failed to initialize Window" );
1548
+ return -1 ;
1549
+ }
1538
1550
1539
1551
// After the window was created, determine the monitor that the window manager assigned.
1540
1552
// Derive display sizes, and, if possible, window size in case it was zero at beginning.
@@ -1558,18 +1570,8 @@ int InitPlatform(void)
1558
1570
return -1 ;
1559
1571
}
1560
1572
1561
- if (platform .handle )
1562
- {
1563
- CORE .Window .render .width = CORE .Window .screen .width ;
1564
- CORE .Window .render .height = CORE .Window .screen .height ;
1565
- }
1566
- }
1567
-
1568
- if (!platform .handle )
1569
- {
1570
- glfwTerminate ();
1571
- TRACELOG (LOG_WARNING , "GLFW: Failed to initialize Window" );
1572
- return -1 ;
1573
+ CORE .Window .render .width = CORE .Window .screen .width ;
1574
+ CORE .Window .render .height = CORE .Window .screen .height ;
1573
1575
}
1574
1576
1575
1577
glfwMakeContextCurrent (platform .handle );
0 commit comments