Test out an optional render callback

This commit is contained in:
Jeffery Myers 2026-06-30 19:42:23 -07:00
commit 200968a2ab
4 changed files with 77 additions and 18 deletions

View file

@ -28,6 +28,18 @@
#include "raylib.h"
bool RunFrame(void)
{
if (WindowShouldClose())
return false;
ClearBackground(RAYWHITE);
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
return true;
}
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
@ -44,24 +56,7 @@ int main(void)
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
// TODO: Update your variables here
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
EndDrawing();
//----------------------------------------------------------------------------------
}
RunGameLoop(RunFrame);
// De-Initialization
//--------------------------------------------------------------------------------------