add sdl header

This commit is contained in:
2025-12-06 12:29:03 -06:00
parent 4e6f64a28e
commit a82e93dabf
4 changed files with 14 additions and 5 deletions

View File

@@ -2,5 +2,5 @@
LDFLAGS = "-lSDL3" LDFLAGS = "-lSDL3"
CFLAGS = "-Iimgui" CFLAGS = "-Iimgui"
[dependencies] [dependencies]
rtree = "/Users/john/work/cell-rtree" rtree = "gitea.pockle.world/john/cell-rtree"
dmon = "/Users/john/work/cell-rtree" dmon = "gitea.pockle.world/john/cell-watch"

View File

@@ -3,6 +3,7 @@
#include "stb_ds.h" #include "stb_ds.h"
#include "HandmadeMath.h" #include "HandmadeMath.h"
#include <SDL3/SDL.h>
#include "math.h" #include "math.h"
#include "time.h" #include "time.h"

View File

@@ -1171,14 +1171,21 @@ prosperon.create_batch = function create_batch(draw_cmds, done) {
if (done) done() if (done) done()
} }
var shop = use('shop')
////////// dmon hot reload //////// ////////// dmon hot reload ////////
function poll_file_changes() { function poll_file_changes() {
dmon.poll(e => { dmon.poll(e => {
log.console(json.encode(e))
if (e.action == 'modify' || e.action == 'create') { if (e.action == 'modify' || e.action == 'create') {
// Check if it's an image file // Check if it's an image file
var ext = e.file.split('.').pop().toLowerCase() var ext = e.file.split('.').pop().toLowerCase()
var imageExts = ['png', 'jpg', 'jpeg', 'gif', 'bmp', 'tga', 'webp', 'qoi', 'ase', 'aseprite'] var imageExts = ['png', 'jpg', 'jpeg', 'gif', 'bmp', 'tga', 'webp', 'qoi', 'ase', 'aseprite']
if (ext == 'cm') {
var info = shop.file_info(e.file)
var pkg = info.package == 'local' ? null : info.package
log.console(`hot reloading ${info.name} in ${pkg}`)
shop.module_reload(info.name, pkg)
}
if (imageExts.includes(ext)) { if (imageExts.includes(ext)) {
// Try to find the full path for this image // Try to find the full path for this image
@@ -1198,7 +1205,7 @@ function poll_file_changes() {
$_.delay(poll_file_changes, 0.5) $_.delay(poll_file_changes, 0.5)
} }
var dmon = use('dmon') var dmon = use('dmon/dmon')
prosperon.dmon = function() prosperon.dmon = function()
{ {
if (!dmon) return if (!dmon) return

View File

@@ -2,6 +2,7 @@
#define PROSPERON_H #define PROSPERON_H
#include "cell.h" #include "cell.h"
#include <SDL3/SDL.h>
#include "HandmadeMath.h" #include "HandmadeMath.h"
struct lrtb { struct lrtb {