add sdl header
This commit is contained in:
@@ -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"
|
||||
1
model.c
1
model.c
@@ -3,6 +3,7 @@
|
||||
#include "stb_ds.h"
|
||||
|
||||
#include "HandmadeMath.h"
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
#include "math.h"
|
||||
#include "time.h"
|
||||
|
||||
13
prosperon.cm
13
prosperon.cm
@@ -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
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define PROSPERON_H
|
||||
|
||||
#include "cell.h"
|
||||
#include <SDL3/SDL.h>
|
||||
#include "HandmadeMath.h"
|
||||
|
||||
struct lrtb {
|
||||
|
||||
Reference in New Issue
Block a user