Rearrange & setup

This commit is contained in:
2026-05-03 23:00:41 +01:00
parent f953f72322
commit 9e85763f9e
12 changed files with 125 additions and 28 deletions
+25
View File
@@ -0,0 +1,25 @@
#include "binding/ruby.h"
#include "utils.h"
#include "window/window.h"
struct Element {
Vec2<float> position;
float rotation;
Vec2<float> scale;
float z;
Ruby::Block on_click;
Ruby::Block on_update;
Ruby::Block on_hover;
virtual void render(Window &window) {}
};
struct Scene {
std::vector<Element> elements;
};
struct App {
Window window;
App(Vec2<float> size, const char *title) : window(size, title) {}
};
+13
View File
@@ -0,0 +1,13 @@
#include "pch.h"
#include "utils.h"
namespace Ruby {
extern mrb_state *mrb;
struct Block {
mrb_value proc;
Block(mrb_value proc) : proc(proc) {
mrb_gc_protect(mrb, proc);
}
};
}; // namespace Ruby
+40
View File
@@ -1,15 +1,55 @@
#ifndef PCH_H
#define PCH_H
#include "mruby.h"
#include "mruby/array.h"
#include "mruby/compile.h"
#include "mruby/hash.h"
#include "mruby/irep.h"
#include "mruby/string.h"
#include <SDL3/SDL.h>
#include <SDL3/SDL_events.h>
#include <SDL3_image/SDL_image.h>
#include <SDL3_ttf/SDL_ttf.h>
#include <algorithm>
#include <atomic>
#include <cctype>
#include <chrono>
#include <cmath>
#include <cstdarg>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <fcntl.h>
#include <filesystem>
#include <fstream>
#include <functional>
#include <immintrin.h>
#include <limits.h>
#include <map>
#include <mutex>
#include <optional>
#include <queue>
#include <set>
#include <shared_mutex>
#include <signal.h>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <sys/ioctl.h>
#include <sys/poll.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <termios.h>
#include <thread>
#include <unistd.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#endif
+2 -2
View File
@@ -1,8 +1,8 @@
#ifndef WINDOW_H
#define WINDOW_H
#include "../pch.h"
#include "../utils.h"
#include "pch.h"
#include "utils.h"
using ImageID = uint32_t;
using FontID = uint32_t;