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"
CFLAGS = "-Iimgui"
[dependencies]
rtree = "/Users/john/work/cell-rtree"
dmon = "/Users/john/work/cell-rtree"
rtree = "gitea.pockle.world/john/cell-rtree"
dmon = "gitea.pockle.world/john/cell-watch"

View File

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

View File

@@ -1171,14 +1171,21 @@ prosperon.create_batch = function create_batch(draw_cmds, done) {
if (done) done()
}
var shop = use('shop')
////////// dmon hot reload ////////
function poll_file_changes() {
dmon.poll(e => {
log.console(json.encode(e))
dmon.poll(e => {
if (e.action == 'modify' || e.action == 'create') {
// Check if it's an image file
var ext = e.file.split('.').pop().toLowerCase()
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)) {
// Try to find the full path for this image
@@ -1198,7 +1205,7 @@ function poll_file_changes() {
$_.delay(poll_file_changes, 0.5)
}
var dmon = use('dmon')
var dmon = use('dmon/dmon')
prosperon.dmon = function()
{
if (!dmon) return

View File

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