summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuca Sas <sas.luca.alex@gmail.com>2020-10-01 19:17:58 +0100
committerLuca Sas <sas.luca.alex@gmail.com>2020-10-01 19:17:58 +0100
commit45ee5878397822c41b9109d0e3bc2d635c8c8634 (patch)
treee94f7a4c3d7c94760ff5b96886a2632f0d3d5f6b /src
parent224c1c2087195c48d4a116ba9db0faa209e50332 (diff)
downloadgamejam-slgj-2024-45ee5878397822c41b9109d0e3bc2d635c8c8634.tar.gz
gamejam-slgj-2024-45ee5878397822c41b9109d0e3bc2d635c8c8634.tar.bz2
gamejam-slgj-2024-45ee5878397822c41b9109d0e3bc2d635c8c8634.zip
Updated to raylib 3.0
Diffstat (limited to 'src')
-rw-r--r--src/main.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/src/main.c b/src/main.c
index 4fcb802..570fa23 100644
--- a/src/main.c
+++ b/src/main.c
@@ -3,29 +3,20 @@
#define SCREEN_WIDTH (800)
#define SCREEN_HEIGHT (450)
-// Change this depending on the path of your executable relative to the assets folder
-#define ASSET_PATH "assets/"
+// This is set in the cmake file by default, if you don't use cmake you can set this macro to the path to your asset folder
+#ifndef ASSETS_PATH
+#define ASSETS_PATH "assets/"
+#endif
int main(void)
{
- // Initialization
- //--------------------------------------------------------------------------------------
InitWindow(SCREEN_WIDTH, SCREEN_HEIGHT, "Window title");
+ SetTargetFPS(60);
- Texture2D texture = LoadTexture(ASSET_PATH"test.png");
+ Texture2D texture = LoadTexture(ASSETS_PATH"test.png");
- SetTargetFPS(60); // Set our game to run at 60 frames-per-second
-
- // Main game loop
- while (!WindowShouldClose()) // Detect window close button or ESC key
+ while (!WindowShouldClose())
{
- // Update
- //----------------------------------------------------------------------------------
- // TODO: Update your variables here
- //----------------------------------------------------------------------------------
-
- // Draw
- //----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
@@ -39,12 +30,9 @@ int main(void)
DrawText(text, SCREEN_WIDTH / 2 - text_size.x / 2, texture_y + texture.height + text_size.y + 10, 20, BLACK);
EndDrawing();
- //----------------------------------------------------------------------------------
}
- // De-Initialization
- //--------------------------------------------------------------------------------------
- CloseWindow(); // Close window and OpenGL context
+ CloseWindow();
return 0;
} \ No newline at end of file