From eb90e2e2d220b770f6b59dfad4315b477901a24d Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 15 Apr 2022 22:25:23 +0200 Subject: Initialized with a game stub --- .gitignore | 1 + CMakeLists.txt | 13 +++++++++++++ main.cpp | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 main.cpp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a5309e6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build*/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..2ce53a0 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.16) +project(bullethell) +set(CMAKE_C_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_EXTENSIONS No) +if(EMSCRIPTEN) + set(CMAKE_PREFIX_PATH "$ENV{HOME}/.emscripten_cache/sysroot;/usr/lib/emscripten/system") + set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s ASYNCIFY") + set(raylib_USE_STATIC_LIBS ON) +endif() +find_package(raylib 3 REQUIRED) +add_executable(${PROJECT_NAME} main.cpp) +target_link_libraries(${PROJECT_NAME} raylib) diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..6b7a251 --- /dev/null +++ b/main.cpp @@ -0,0 +1,33 @@ +#include "raylib.h" + +#ifdef PLATFORM_WEB +#include +#endif + + +void Loop(); + + +int main() +{ + InitWindow(800, 600, "bullethell2022"); +#ifdef PLATFORM_WEB + emscripten_set_main_loop(Loop, 0, 1); +#else + SetTargetFPS(60); + while (!WindowShouldClose()) + { + Loop(); + } +#endif // PLATFORM_WEB + CloseWindow(); +} + + +void Loop() +{ + BeginDrawing(); + ClearBackground(RAYWHITE); + DrawText("bullethell2022", 190, 200, 20, LIGHTGRAY); + EndDrawing(); +} -- cgit v1.1