septag / rizz Goto Github PK
View Code? Open in Web Editor NEWSmall C game development framework
License: BSD 2-Clause "Simplified" License
Small C game development framework
License: BSD 2-Clause "Simplified" License
Hello,
when I rename hello.c to hello.cpp, the following line:
g_stage = the_gfx->stage_register("main", (rizz_gfx_stage){ .id = 0 });
with the following errors:
error C2059: syntax error: '.'
error C2059: syntax error: ')'
as I need to include <string>
, otherwise, if I do not rename c to cpp, std will not be compiled!
thanks
I've tried to recompile a shader on macOS while rizz is running a game plugin, and this causes an assert to fail in dmon.h. Here are the steps to reproduce
./rizz --run lib08-draw3d.dylib
from the bin
directorydraw3d.frag
for frag_color
to something like - frag_color = vec4(1.0, 0.0, 0.0, 1.0);
./tools/darwin/glslcc --vert=examples/08-draw3d/draw3d.vert --frag=examples/08-draw3d/draw3d.frag --lang=msl --reflect --sgs --output=examples/assets/shader s/msl/draw3d.sgs
This will cause the following assertion to fail -
Assertion failed: (strstr(abs_filepath, watch->rootdir) == abs_filepath), function dmon__fsevent_callback, file /Users/zacharycarter/dev/rizz/include/dmon/dmon.h, line 1347.
An AUR package would be helpful for installing through the package manager.
Here are some guides:
https://wiki.archlinux.org/title/Creating_packages
https://gist.github.com/keilmillerjr/dbfd9d60b2cd5fb440274c0a67a7db18
And here is my PKGBUILD for my package:
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=clibasic
When the project is built in debug mode, upon closing the application, the following debug logs are printed:
DEBUG: LEAKED: dmon.h@1182: dmon__cf_malloc: 90 at 0x00007fdd5323eff0
DEBUG: LEAKED: dmon.h@1182: dmon__cf_malloc: 40 at 0x00007fdd5323e3b0
DEBUG: LEAKED: dmon.h@1182: dmon__cf_malloc: 456 at 0x00007fdd5323eda0
DEBUG: LEAKED: dmon.h@1182: dmon__cf_malloc: 85 at 0x00007fdd5322ecb0
DEBUG: LEAKED: dmon.h@1182: dmon__cf_malloc: 40 at 0x00007fdd5322ec00
DEBUG: LEAKED: dmon.h@1182: dmon__cf_malloc: 456 at 0x00007fdd5322e9b0
Fixed with PR #12
Hello, this seems like a nice project.
I am interested in using Wren as a scripting language.
This language is successfully used in other projects such as
https://tic.computer/
https://domeengine.com/
and https://luxeengine.com/
I'm willing to do a PR with a plugin, but I would need some guidance on where to look for integration :)
Thanks ๐
static int rizz__core_thread_func(void* user1, void* user2)
{
typedef int (thread_fn)(void user_data);
thread_fn func = (thread_fn)user2;
sx_assert(func);
int r = func(user1);
// find the any existing thread temp allocator and destroy it
uint32_t tid = sx_thread_tid();
sx_mutex_lock(g_core.tmp_allocs_mtx) {
for (int i = 0, c = sx_array_count(g_core.tmp_allocs); i < c; i++) {
if (g_core.tmp_allocs[i]->tid == tid) {
rizz__release_tmp_alloc_tls(g_core.tmp_allocs[i]);
sx_swap(g_core.tmp_allocs[i], g_core.tmp_allocs[c-1], rizz__tmp_alloc_tls*);
sx_array_pop_last(g_core.tmp_allocs);
break;
}
}
}
return r;
}
"if (g_core.tmp_allocs[i]->tid == tid)", this line will crash.
Thanks for the project, I'm currently building it with MSVC, but it would be great if you can add support for MinGW. In general, the building process runs fine excepting several errors like:
Rizz\src\sx\src\threads.c:493:45: error: operand of ?: changes signedness from 'int' to 'unsigned int' due to unsignedness of other operand [-Werror=sign-compare]
DWORD _msecs = (msecs < 0) ? INFINITE : msecs;
^~~~~
Rizz\src\sx\src\threads.c: In function 'sx_signal_wait':
Rizz\src\sx\src\threads.c:539:45: error: operand of ?: changes signedness from 'int' to 'unsigned int' due to unsignedness of other operand [-Werror=sign-compare]
DWORD _msecs = (msecs < 0) ? INFINITE : msecs;
^~~~~
Rizz\src\sx\src\threads.c: In function 'sx_thread_setname':
Rizz\src\sx\src\threads.c:631:5: error: '__try' undeclared (first use in this function)
__try {
^~~~~
Rizz\src\sx\src\threads.c:631:5: note: each undeclared identifier is reported only once for each function it appears in
Rizz\src\sx\src\threads.c:631:10: error: expected ';' before '{' token
__try {
^~
;
cc1.exe: all warnings being treated as errors
make[2]: *** [src\sx\CMakeFiles\sx.dir\build.make:91: src/sx/CMakeFiles/sx.dir/src/threads.c.obj] Error 1
make[1]: *** [CMakeFiles\Makefile2:596: src/sx/CMakeFiles/sx.dir/all] Error 2
make: *** [Makefile:83: all] Error 2
DrawSprite
seems like there are some problems with loading the resources:
$ ./rizz --run ./lib03-drawsprite.so
version: 0.4-17-gf9b8182
(init) vfs
(init) temp memory: 8x5120 kb
(init) jobs: threads=7, max_fibers=64, stack_size=1024kb
(init) asset system: hot-loading=1
(init) profiler (cpu): port=17815
(init) graphics: OpenGL 3.3
(init) coroutines: max_fibers=64, stack_size=2048kb
(init) http client
vfs: mounted '/cache' on '/d/code/game/rizz/rizz/bin/.cache'
(init) plugin: imgui (libimgui.so) - dear-imgui plugin - v1.77.0
(init) plugin: 2dtools (lib2dtools.so) - 2dtools plugin - v1.0.0
vfs: mounted '/assets' on '/d/code/game/rizz/rizz/examples/assets'
(init) plugin: drawsprite (lib03-drawsprite.so) - - v0.0.0
ERROR: sg_image_desc.width must be > 0
ERROR: sg_image_desc.height must be > 0
ERROR: ^^^^ VALIDATION FAILED, TERMINATING ^^^^
rizz: /d/code/game/rizz/rizz/src/rizz/../../3rdparty/sokol/sokol_gfx.h:12819: _sg_validate_end: Assertion `0' failed.
NBody
Seems like is not built by default ?
Draw3d
$ ./rizz --run ./lib08-draw3d.so
version: 0.4-17-gf9b8182
(init) vfs
(init) temp memory: 8x5120 kb
(init) jobs: threads=7, max_fibers=64, stack_size=1024kb
(init) asset system: hot-loading=1
(init) profiler (cpu): port=17815
(init) graphics: OpenGL 3.3
(init) coroutines: max_fibers=64, stack_size=2048kb
(init) http client
vfs: mounted '/cache' on '/d/code/game/rizz/rizz/bin/.cache'
(init) plugin: imgui (libimgui.so) - dear-imgui plugin - v1.77.0
ERROR: error: vertex shader output `f_color' specifies flat interpolation qualifier, but fragment shader input specifies no interpolation qualifier
ERROR: sg_pipeline_desc.shader missing or invalid
ERROR: ^^^^ VALIDATION FAILED, TERMINATING ^^^^
rizz: /d/code/game/rizz/rizz/src/rizz/../../3rdparty/sokol/sokol_gfx.h:12819: _sg_validate_end: Assertion `0' failed.
ERROR: plugin init failed: ./lib3dtools.so
ERROR: initializing plugins failed
Btw, I couldn't see the imgui windows in any of the examples (unlike the screenshots)
Running the 08-draw3d
example on Windows with VS2019 results in an unresponsive white screen. It appears that the asset system tries to start a job to read and load the a 3d asset, but it gets stuck in a spin waiting for a lock to be released.
rizz.exe!sx_anderson_lock_enter(sx_anderson_lock_t * lock) Line 793
at C:\Work\rizz\src\sx\src\threads.c(793)
rizz.exe!sx_job_dispatch(sx_job_context * ctx, int count, void(*)(int, int, int, void *) callback, void * user, sx_job_priority priority, unsigned int tags) Line 320
at C:\Work\rizz\src\sx\src\jobs.c(320)
rizz.exe!rizz__job_dispatch(int count, void(*)(int, int, int, void *) callback, void * user, sx_job_priority priority, unsigned int tags) Line 1757
at C:\Work\rizz\src\rizz\core.c(1757)
rizz.exe!rizz__asset_on_read(const char * path, sx_mem_block * mem, void * user) Line 328
at C:\Work\rizz\src\rizz\asset.c(328)
rizz.exe!rizz__vfs_async_update() Line 397
at C:\Work\rizz\src\rizz\vfs.c(397)
rizz.exe!rizz__core_frame() Line 1582
at C:\Work\rizz\src\rizz\core.c(1582)
rizz.exe!rizz__app_frame() Line 476
at C:\Work\rizz\src\rizz\app.c(476)
rizz.exe!_sapp_call_frame() Line 1146
at C:\Work\rizz\3rdparty\sokol\sokol_app.h(1146)
rizz.exe!_sapp_frame() Line 1266
at C:\Work\rizz\3rdparty\sokol\sokol_app.h(1266)
rizz.exe!_sapp_run(const sapp_desc * desc) Line 5007
at C:\Work\rizz\3rdparty\sokol\sokol_app.h(5007)
rizz.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Line 5086
at C:\Work\rizz\3rdparty\sokol\sokol_app.h(5086)
If you modify the k_models
array in draw3d.c
to only contain 1 asset, then the main thread is unblocked, but the asset still doesn't load since the thread trying to load the asset is also stuck in a spin.
Commenting out the spin completely to ignore the lock makes everything work and load correctly, but ofc that's bad and not a real workaround.
Thank you for this great framework. I have two questions:
Thanks
What about create a discord channel to development discussions?
Line 653 in cfe3da2
I believe the check here is backwards - it is currently checking if the length of the argument passed to the option is greater than the size of value array of the union (8 bytes). If it is, it currently copies 8 bytes from the argument into the buffer. I believe it should really allocate in this case - unless I'm misunderstanding the intent of this section of code.
I cannot seem to get the IMGUI to show up in the examples - although the rendering seems to mostly work here.
I've tested it both on Intel and AMD gpu hardware with mesa-21.0.3.
Hi, I really love the way of rizz and its provided functionalities, like gfx, jobs, reflection, etc.
however, the compute shader seems not supported yet?
is it possible to support the compute shader so that it would be much convenient to do some advanced rendering tests.
so brilliant!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.