From 0b97402ab8b8216eae030c0edef6b314ab692c00 Mon Sep 17 00:00:00 2001 From: HumanoidSandvichDispenser Date: Wed, 18 Feb 2026 14:36:39 -0800 Subject: [PATCH] Bootstrap AS3 --- as3/CMakeLists.txt | 12 ++++++++++++ as3/README.md | 35 +++++++++++++++++++++++++++++++++++ as3/as3.cpp | 20 ++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 as3/CMakeLists.txt create mode 100644 as3/README.md create mode 100644 as3/as3.cpp diff --git a/as3/CMakeLists.txt b/as3/CMakeLists.txt new file mode 100644 index 0000000..c41b5d5 --- /dev/null +++ b/as3/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.18) +project(as3 CXX) + +set(CMAKE_CXX_STANDARD 20) + +# adding this option to make clangd work +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +add_subdirectory(../raylib-cpp raylib) + +add_executable(as3 as3.cpp) +target_link_libraries(as3 PUBLIC raylib raylib_cpp) diff --git a/as3/README.md b/as3/README.md new file mode 100644 index 0000000..df4c677 --- /dev/null +++ b/as3/README.md @@ -0,0 +1,35 @@ +# Building and Running + +Clone the repository, navigate to the root of the project, and initialize the +submodules: + +```sh +git clone https://github.com/humanoidsandvichdispenser/cs381.git +cd cs381 +git submodule update --init --recursive +``` + +Navigate to the `as3` directory, create a build directory, and run CMake to +generate the build files: + +```sh +cd as3 +mkdir -p build +cd build +cmake .. +``` + +Compile the code using `make`: + +```sh +make +``` + +This should create an executable named `as3` in the `build` directory. You can +run the executable with the following command: + +```sh +./as3 +``` + +# Instructions on how to use the program diff --git a/as3/as3.cpp b/as3/as3.cpp new file mode 100644 index 0000000..f98e8db --- /dev/null +++ b/as3/as3.cpp @@ -0,0 +1,20 @@ +#include "Color.hpp" +#include "raylib.h" +#include + +int main() { + raylib::Window window(800, 600, "CS381 - Assignment 0"); + window.SetState(FLAG_WINDOW_RESIZABLE); + + window.SetTargetFPS(60); // save cpu cycles + + while (!window.ShouldClose()) { + window.BeginDrawing(); + + window.ClearBackground(raylib::Color::RayWhite()); + + window.EndDrawing(); + } + + return 0; +}