]> git.seodisparate.com - jumpartifact.com_demo_0/commitdiff
Keep all "draw commands" in Game
authorStephen Seo <seo.disparate@gmail.com>
Mon, 31 Jul 2023 06:28:01 +0000 (15:28 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Mon, 31 Jul 2023 06:28:01 +0000 (15:28 +0900)
src/game.cc
src/main.cc

index 77a0b4a96898225ee4c355e51386de5d881e7d01..41ce4aeea11f6307cc68b464ef6e16ccce08826a 100644 (file)
@@ -7,4 +7,9 @@ Game::Game() {}
 
 void Game::update() {}
 
-void Game::draw() { DrawText("Testing...", 100, 100, 30, RAYWHITE); }
+void Game::draw() {
+  BeginDrawing();
+  ClearBackground(BLACK);
+  DrawText("Testing...", 100, 100, 30, RAYWHITE);
+  EndDrawing();
+}
index f62ab94ca83ce56bc8a8d605b3424322313da40a..36e814241756e826eb5db9ead2c3724bc3a14102 100644 (file)
@@ -33,11 +33,7 @@ void jumpartifact_demo_update(void *ud) {
   Game *game = (Game *)ud;
 
   game->update();
-
-  BeginDrawing();
-  ClearBackground(BLACK);
   game->draw();
-  EndDrawing();
 }
 
 int main() {