Bootstrap AS3

master
John Montagu, the 4th Earl of Sandvich 2026-02-18 14:36:39 -08:00
parent 8b385c2172
commit 0b97402ab8
Signed by: sandvich
GPG Key ID: 9A39BE37E602B22D
3 changed files with 67 additions and 0 deletions

12
as3/CMakeLists.txt 100644
View File

@ -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)

35
as3/README.md 100644
View File

@ -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

20
as3/as3.cpp 100644
View File

@ -0,0 +1,20 @@
#include "Color.hpp"
#include "raylib.h"
#include <raylib-cpp.hpp>
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;
}