diff options
| -rw-r--r-- | .gitmodules | 3 | ||||
| -rw-r--r-- | Makefile | 6 | ||||
| -rw-r--r-- | assets/.placeholder | 0 | ||||
| m--------- | dependency/raylib | 0 | ||||
| -rw-r--r-- | src/main.c | 63 |
5 files changed, 72 insertions, 0 deletions
diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..3c46cd4 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "dependency/raylib"] + path = dependency/raylib + url = [email protected]:raysan5/raylib.git diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..02711c9 --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +tux: + @mkdir -p output/tux + zig cc -target native main.c -o output/tux/game -lGL -lm -lpthread -ldl -lrt -lX11 -Idependecy/raylib/src lib/tux/libraylib.a && ./output/tux/game +web: + @mkdir -p output/web + emcc -Os -Wall main.c -o game -Idependency/raylib/src lib/web/libraylib.a -o output/web/index.html -s USE_GLFW=3 -DPLATFORM_WEB --shell-file dependency/raylib/src/minshell.html -s TOTAL_MEMORY=268435456 -s ASYNCIFY --preload-file ./assets diff --git a/assets/.placeholder b/assets/.placeholder new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/assets/.placeholder diff --git a/dependency/raylib b/dependency/raylib new file mode 160000 +Subproject 5ecc2892016cf95fc78209229627fd371bd8df0 diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..0290686 --- /dev/null +++ b/src/main.c @@ -0,0 +1,63 @@ +/******************************************************************************************* +* +* raylib [core] example - Basic window +* +* Welcome to raylib! +* +* To test examples, just press F6 and execute raylib_compile_execute script +* Note that compiled executable is placed in the same folder as .c file +* +* You can find all basic examples on C:\raylib\raylib\examples folder or +* raylib official webpage: www.raylib.com +* +* Enjoy using raylib. :) +* +* This example has been created using raylib 1.0 (www.raylib.com) +* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) +* +* Copyright (c) 2013-2016 Ramon Santamaria (@raysan5) +* +********************************************************************************************/ + +#include "raylib.h" + +int main(void) +{ + // Initialization + //-------------------------------------------------------------------------------------- + const int screenWidth = 800; + const int screenHeight = 450; + + InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window"); + + SetTargetFPS(60); // Set our game to run at 60 frames-per-second + //-------------------------------------------------------------------------------------- + + // 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(); + //---------------------------------------------------------------------------------- + } + + // De-Initialization + //-------------------------------------------------------------------------------------- + CloseWindow(); // Close window and OpenGL context + //-------------------------------------------------------------------------------------- + + return 0; +} + |
