|
|
@ -59,16 +59,6 @@ int main(void) |
|
|
|
// Main game loop |
|
|
|
while (!WindowShouldClose()) // Detect window close button or ESC key |
|
|
|
{ |
|
|
|
// Check if screen is resized |
|
|
|
//---------------------------------------------------------------------------------- |
|
|
|
if(IsWindowResized()) |
|
|
|
{ |
|
|
|
screenWidth = GetScreenWidth(); |
|
|
|
screenHeight = GetScreenHeight(); |
|
|
|
float resolution[2] = { (float)screenWidth, (float)screenHeight }; |
|
|
|
SetShaderValue(shader, resolutionLoc, resolution, UNIFORM_VEC2); |
|
|
|
} |
|
|
|
|
|
|
|
// Update |
|
|
|
//---------------------------------------------------------------------------------- |
|
|
|
UpdateCamera(&camera); // Update camera |
|
|
@ -83,6 +73,15 @@ int main(void) |
|
|
|
SetShaderValue(shader, viewEyeLoc, cameraPos, UNIFORM_VEC3); |
|
|
|
SetShaderValue(shader, viewCenterLoc, cameraTarget, UNIFORM_VEC3); |
|
|
|
SetShaderValue(shader, runTimeLoc, &runTime, UNIFORM_FLOAT); |
|
|
|
|
|
|
|
// Check if screen is resized |
|
|
|
if (IsWindowResized()) |
|
|
|
{ |
|
|
|
screenWidth = GetScreenWidth(); |
|
|
|
screenHeight = GetScreenHeight(); |
|
|
|
float resolution[2] = { (float)screenWidth, (float)screenHeight }; |
|
|
|
SetShaderValue(shader, resolutionLoc, resolution, UNIFORM_VEC2); |
|
|
|
} |
|
|
|
//---------------------------------------------------------------------------------- |
|
|
|
|
|
|
|
// Draw |
|
|
|