remove opengl files; macos cblas

This commit is contained in:
2024-12-02 08:04:12 -06:00
parent 166bc48c6b
commit 5e1d37c2b8
9 changed files with 19 additions and 27729 deletions

View File

@@ -1,173 +0,0 @@
# Mum
#### padding
**array**
[
0,
0
]
#### offset
**array**
[
0,
0
]
#### font
**string**
#### selectable
**boolean**
#### selected
**boolean**
#### font_size
**number**
#### text_align
**string**
#### scale
**number**
#### angle
**number**
#### anchor
**array**
[
0,
1
]
#### hovered
**object**
#### text_shadow
**object**
#### text_outline
**number**
#### color
**array**
[
1,
1,
1,
1
]
#### margin
**array**
[
0,
0
]
#### width
**number**
#### height
**number**
#### max_width
**number**
#### max_height
**number**
#### image_repeat
**boolean**
#### image_repeat_offset
**array**
[
0,
0
]
#### debug
**boolean**
#### make(def)
#### prestart()
#### start()
#### extend(def)
#### text(def)
#### button(def)
#### window(def)
#### image(def)
#### column(def)
#### debug_colors
**object**

View File

@@ -1,15 +0,0 @@
# Tween
#### default
**object**
#### start(obj, target, tvals, options)
#### make(obj, target, tvals, options)

View File

@@ -16,7 +16,7 @@ deps = []
if host_machine.system() == 'darwin'
add_project_arguments('-x', 'objective-c', language: 'c')
fworks = ['foundation', 'metal', 'audiotoolbox', 'metalkit', 'avfoundation', 'quartzcore', 'cocoa']
fworks = ['foundation', 'metal', 'audiotoolbox', 'metalkit', 'avfoundation', 'quartzcore', 'cocoa', 'accelerate']
foreach fkit : fworks
deps += dependency('appleframeworks', modules: fkit)
endforeach
@@ -43,7 +43,6 @@ if host_machine.system() == 'emscripten'
link += '-sUSE_WEBGPU'
endif
tracy_opts = ['fibers=true', 'on_demand=true']
quickjs_opts = []
@@ -62,14 +61,17 @@ endif
cmake = import('cmake')
#cmake_ozz = cmake.subproject('ozz')
cmake_sdl3 = cmake.subproject('SDL')
message('CMake targets:\n - ' + '\n - '.join(cmake_sdl3.target_list()))
sdl3_lib = cmake_sdl3.dependency('SDL3-shared')
#deps += dependency('openblas')
deps += dependency('qjs-layout',static:true)
deps += dependency('qjs-nota',static:true)
deps += dependency('qjs-miniz',static:true)
deps += dependency('qjs-soloud',static:true)
deps += dependency('sdl3')
#deps += cc.find_library('openblas')
deps += dependency('cblas')
deps += sdl3_lib
deps += dependency('physfs',static:true)
#deps += cmake_ozz.dependency('ozz_base')
#deps += dependency('sdl2_image')
@@ -89,7 +91,7 @@ if get_option('enet')
endif
sources = []
src += ['anim.c', 'config.c', 'datastream.c','font.c','gameobject.c','HandmadeMath.c','jsffi.c','model.c','render.c','script.c','simplex.c','spline.c','texture.c', 'timer.c', 'transform.c','warp.c','yugine.c', 'glad.c', 'wildmatch.c']
src += ['anim.c', 'config.c', 'datastream.c','font.c','gameobject.c','HandmadeMath.c','jsffi.c','model.c','render.c','script.c','simplex.c','spline.c','texture.c', 'timer.c', 'transform.c','warp.c','yugine.c', 'wildmatch.c']
imsrc = ['GraphEditor.cpp','ImCurveEdit.cpp','ImGradient.cpp','imgui_draw.cpp','imgui_tables.cpp','imgui_widgets.cpp','imgui.cpp','ImGuizmo.cpp','imnodes.cpp','implot_items.cpp','implot.cpp']

View File

@@ -259,7 +259,6 @@ profile.data = {};
profile.curframe = 0;
profile.snapshot = {};
var classes = ["gameobject", "transform", "dsp_node", "texture", "font", "warp_gravity", "warp_damp", "sg_buffer", "datastream", "cpShape", "cpConstraint", "timer", "skin"];
var get_snapshot = function()
{
var snap = profile.snapshot;
@@ -275,14 +274,6 @@ var get_snapshot = function()
snap.memory.texture_vram = game.texture.total_vram();
snap.particles = stat_emitters();
snap.obj ??= {};
for (var i of classes) {
var proto = globalThis[`${i}_proto`];
if (!proto) continue;
snap.obj[i] = proto._count();
snap.obj[i + "_mem"] = proto._count() * proto.memsize();
}
}
var monitors = [];

View File

@@ -104,7 +104,7 @@ struct sFont *MakeFont(void *ttf_buffer, size_t len, int height) {
newfont->Characters[c].Advance = glyph.xadvance; /* x distance from this char to the next */
newfont->Characters[c].leftbearing = glyph.xoff;
newfont->Characters[c].topbearing = -glyph.yoff2;//newfont->ascent - glyph.yoff; -glyph.yoff2;
newfont->Characters[c].topbearing = glyph.yoff2;//newfont->ascent - glyph.yoff; -glyph.yoff2;
newfont->Characters[c].rect = r;
}
@@ -159,7 +159,7 @@ void draw_char_verts(struct text_vert **buffer, struct Character c, HMM_Vec2 cur
// Adds four verts: bottom left, bottom right, top left, top right
text_vert bl;
bl.pos.x = cursor.X + c.leftbearing;
bl.pos.y = cursor.Y + c.topbearing;
bl.pos.y = cursor.Y - c.topbearing;
bl.uv.x = c.rect.x;
bl.uv.y = c.rect.y+c.rect.h;
rgba2floats(bl.color.e, color);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
#include "jsffi.h"
#include "script.h"
#include "script.h"
#include "font.h"
#include "datastream.h"
#include "stb_ds.h"
@@ -32,7 +32,11 @@
#include <SDL3/SDL_gpu.h>
#include <SDL3/SDL_error.h>
#ifdef __APPLE__
#include <Accelerate/Accelerate.h>
#else
#include <cblas.h>
#endif
static JSAtom width_atom;
static JSAtom height_atom;
@@ -1438,7 +1442,7 @@ JSC_SCALL(SDL_Window_make_renderer,
SDL_SetStringProperty(props, SDL_PROP_RENDERER_CREATE_NAME_STRING, str);
SDL_Renderer *r = SDL_CreateRendererWithProperties(props);
SDL_DestroyProperties(props);
if (!r) return JS_ThrowReferenceError(js, SDL_GetError());
if (!r) return JS_ThrowReferenceError(js, "Error creating renderer: %s",SDL_GetError());
SDL_SetRenderDrawBlendMode(r, SDL_BLENDMODE_BLEND);
return SDL_Renderer2js(js,r);
)
@@ -1713,7 +1717,7 @@ JSC_CCALL(renderer_geometry,
}
if (!SDL_RenderGeometryRaw(r, tex, trans_pos, pos_stride,colordata,color_stride,uvdata, uv_stride, vertices, idxdata, count, indices_stride))
ret = JS_ThrowReferenceError(js, SDL_GetError());
ret = JS_ThrowReferenceError(js, "Error rendering geometry: %s",SDL_GetError());
free(trans_pos);
@@ -2607,7 +2611,7 @@ JSC_CCALL(os_make_texture,
SDL_Surface *surf = SDL_CreateSurfaceFrom(width,height,FMT, data, width*n);
if (!surf) {
free(data);
return JS_ThrowReferenceError(js, SDL_GetError());
return JS_ThrowReferenceError(js, "Error creating surface from data: %s",SDL_GetError());
}
ret = SDL_Surface2js(js,surf);

View File

@@ -86,7 +86,7 @@ static JSClassID js_##TYPE##_id;\
static void js_##TYPE##_finalizer(JSRuntime *rt, JSValue val){\
TYPE *n = JS_GetOpaque(val, js_##TYPE##_id);\
TYPE##_free(rt,n);}\
static inline JSClassDef js_##TYPE##_class = {\
static JSClassDef js_##TYPE##_class = {\
#TYPE,\
.finalizer = js_##TYPE##_finalizer,\
};\
@@ -101,7 +101,6 @@ static inline JSValue TYPE##2js(JSContext *js, TYPE *n) { \
JS_SetOpaque(j,n);\
return j; }\
\
static JSValue js_##TYPE##_memid (JSContext *js, JSValue self) { return JS_NewString(js,"p"); } \
#define QJSGLOBALCLASS(NAME) \
JSValue NAME = JS_NewObject(js); \
@@ -114,13 +113,6 @@ JS_NewClassID(&js_##TYPE##_id);\
JS_NewClass(JS_GetRuntime(js), js_##TYPE##_id, &js_##TYPE##_class);\
JSValue TYPE##_proto = JS_NewObject(js); \
JS_SetPropertyFunctionList(js, TYPE##_proto, js_##TYPE##_funcs, countof(js_##TYPE##_funcs)); \
JS_SetPropertyStr(js, TYPE##_proto, "memid", JS_NewCFunction(js, &js_##TYPE##_memid, "memid", 0)); \
JS_SetPropertyStr(js, globalThis, #TYPE "_proto", JS_DupValue(js,TYPE##_proto)); \
JS_SetClassProto(js, js_##TYPE##_id, TYPE##_proto); \
#define PREP_PARENT(TYPE, PARENT) \
TYPE##_proto = JS_NewObject(js); \
JS_SetPropertyFunctionList(js, TYPE##_proto, js_##TYPE##_funcs, countof(js_##TYPE##_funcs)); \
JS_SetPrototype(js, TYPE##_proto, PARENT##_proto); \
#define countof(x) (sizeof(x)/sizeof((x)[0]))