aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorsalaaad2 <arthurdurant263@gmail.com>2022-06-13 22:15:48 +0200
committersalaaad2 <arthurdurant263@gmail.com>2022-06-13 22:15:48 +0200
commit95cde5c181b5fd1d9ee3f13db749799c4e8ac9d3 (patch)
tree352480349a46d19ab5b8078ac4ccb79d27166f04 /src/main.cpp
parentmouse is captured again, pretty gud (diff)
downloadyabs-95cde5c181b5fd1d9ee3f13db749799c4e8ac9d3.tar.gz
yabs-95cde5c181b5fd1d9ee3f13db749799c4e8ac9d3.tar.bz2
yabs-95cde5c181b5fd1d9ee3f13db749799c4e8ac9d3.tar.xz
yabs-95cde5c181b5fd1d9ee3f13db749799c4e8ac9d3.tar.zst
yabs-95cde5c181b5fd1d9ee3f13db749799c4e8ac9d3.zip
add raylib to the build chain with -O3 and -march=native
Diffstat (limited to '')
-rw-r--r--src/main.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 0ec23c5..0472a95 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -9,7 +9,8 @@
#include "yabs_core.h"
#include "yabs_utils.h"
-static yabs::gameState game_state;
+static yabs::gameState game_state = yabs::TITLE;
+
static yabs::Scene3D sc3d{
// camera
{{5.0f, 5.0f, 5.0f}, {0.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, 45.0f, 0},
@@ -80,9 +81,6 @@ int main(void) {
break;
}
case (yabs::GAMEPLAY): {
- while (game_state != yabs::NEXT) {
- yabs::core::draw(game_state, model);
- }
break;
}
case (yabs::NEXT): {
@@ -97,13 +95,14 @@ int main(void) {
BeginDrawing();
ClearBackground(GRAY);
BeginMode3D(sc3d.camera);
+
yabs::core::tick(sc3d);
- yabs::core::draw(game_state, model);
+ yabs::core::draw(model);
+
EndMode3D();
DrawFPS(0, 0);
DrawText("Controls: Mouse / WASD / SPACE/CTRL.", YABS_SCREENWIDTH - 400,
0, 20, DARKGRAY);
-
EndDrawing();
}
UnloadTexture(texture);