Rearrange & setup
This commit is contained in:
@@ -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) {}
|
||||
};
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user