Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
new: allow makefile to compile demos individually (`MAKE.bat demos/00…
Browse files Browse the repository at this point in the history
…-sprite.c`)

new: profile_setstat()
brk: fullscreen_rgb_quad() > fullscreen_quad_rgb(), fullscreen_ycbcr_quad() > fullscreen_quad_ycbcr()
chg: unify infos for all existing profiler markers
chg: allow tcc builds to display the progress bar screen as well (cook)
chg: print cmdline args into window title as well (window)
new: `nofwk`,`nodemos`,`noeditor` flags to prevent from building extra stuff (MAKE.bat)
chg: increase thread priority for cook thread #0 (cook)
chg: decrease framerate rendering on progress bar screen (cook)
new: app_cmdline()
new: cursors API
new: capture mouse when recording videos
new: fix libm abi issues (tcc64+win)
chg: upgrade tcc(win) to HEAD b4df681-mod (pre-0.9.28)
new: bump up tlse version (TLS10/TLS11/TLS12/TLS13/DTLS10/DTLS12)
new: is(32), is(64), is(debug), is(release)
new: experimental zig-cc compiler support
new: install signal handlers on debug builds automatically (signals_install)
new: do not memory poison on release builds (fwk_memory)
fix: use ASAN on dbg targets when possible (MAKE.bat)
new: clang-cl support (`MAKE clang-cl`)
new: Draft for a fair hybrid p2p model paper (editor/labs.vm/hybrid-p2p.md)
new: Signal traps API
fix: silence warnings (clang-cl)
fix: promote 64 mib static allocation to heap 3rd_https.h
fix: download() + fwk.dll combo (cl,gcc,clang-cl)
chg: generate dev builds by default now (MAKE.bat)
chg: generate symbols on dbg or dev targets now (MAKE.bat)
chg: COOK_DEBUG > COOK_DEBUGLOG
chg: download() > download_file()
del: remove OPTIMIZE, O_FLAG, RELEASE, WITH_DLL, FINAL flags
chg: WITH_XREALLOC_POISON > WITH_MEMORY_POISON, WITH_PROFILE > WITH_PROFILER
fix: workarounds for bool and fmod() on `tcc -m64` (win)
new: SF3 soundfont support (3rd_tsf.h)
new: bump up 3rd_tsf.h (0.8 > 0.9), 3rd_miniaudio.h (0.11.8 > 0.11.11)
fix: silence jo_mp1, 3rd_compress, fwk_string warnings (gcc+clang,ubuntu16)
fix: division by zero (stbtt)
fix: panels and windows incorrectly resizing to a minimum area (tcc+linux only) (fwk_ui)
new: switch to a much better quality soundfont (midi)
new: tweak tcc batch files to emit 64-bit binaries always (win)
fix: rebuild mid2wav (win,lin,osx)
//chg: ui_window() will create maximized windows by default (null arg) when no global ui_menu() is present (fwk_ui)
chg: remove ui_section() separator
chg: ui_context/_end() > ui_contextual/_end()
new: ui_stringf(), ui_double(), ui_unsigned()
new: ini_destroy()
fix: allow `ini()` values to contain `~` char on them
fix: `nk_dtoa()` not parsing UINT_MAX (3rd_nuklear.h)
fix: missing profiler tab when cook_on_demand was enabled (profile_render)
fix: incorrect vfs paths when mounting ./ virtual folders (vfs_load)
chg: simplify project structure again
chg: update roadmap
new: ui_menu_editbox()
fix: multiple ui_string() calls not blurring widget focus when editing was done (enter key)
new: FUR audio modules support
ren: split/ > tools/split/
fix: bug preventing to use --cook-on-demand on lua demos
ren: threadlocal > __thread
new: COOK_ON_DEMAND directive, --cook-on-demand flag (cook limited to 1 thread for now, though)
new: cook.exe flags: --cook-ini, --cook-debug, --cook-additive, --cook-jobs=N, --cook-compressor=type
new: optimization: process malformed cooked assets only once
ren: --with-wine > --cook-wine
ren: --with-camera-smooth > --camera-smooth
ren: --with-vsync > --vsync, --with-vsync-adaptive > --vsync-adaptive
ren: cooker_* API > cook_* API
brk: vfs_*() API handles cooked assets now: use file_*() API for raw file processing.
fix: reenable old implementation for `each_substring()` which is more recursive friendly
fix: crash during audio decoding
fix: allow up to 256 cooks
fix: do not assert when invalid args are provided (cache_insert)
fix: memory stomp on file_pathabs()
new: midi API (no linux, no mingw)
new: timer API
new: AUDIO_11KHZ, AUDIO_8KHZ,
new: tty_attach()
fix: audio_queue() can consume mono samples now
fix: clang warnings (osx)
fix: use a more robust base64 decoder (fwk_data)
new: DOOM game port (demos/ports/doom)
new: Anarch game port (no mouse) (demos/ports/anarch)
fix: improve input_up/down/held/idle() logic rate
brk: new signatures for cook_config(), cook_start()
fix: rebuilt tools/cook (win,lin,osx)
new: COOK_DEBUG flag
ren: FWK_INI,fwk.ini -> COOK_INI,tools/cook.ini
fix: improved cook times (~2s)
fix: improved window creation time
new: ASSERT_ONCE()
fix: ubuntu16 linking flags (MAKE.bat)
fix: update docs
  • Loading branch information
r-lyeh committed Feb 25, 2023
1 parent 9a83c5c commit 45e34d7
Show file tree
Hide file tree
Showing 1,443 changed files with 115,117 additions and 21,177 deletions.
562 changes: 292 additions & 270 deletions MAKE.bat

Large diffs are not rendered by default.

269 changes: 142 additions & 127 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions demos/00-anims.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ int main() {
window_create(75, WINDOW_MSAA8);
window_title(__FILE__);

for(const char **list = vfs_list("fx**.fs"); *list; list++) {
for(const char **list = file_list("./","fx**.fs"); *list; list++) {
fx_load(*list);
}

Expand Down Expand Up @@ -122,7 +122,7 @@ int main() {
if( input(KEY_M) ) a.speed = a.speed + 0.01; // increase anim speed
vec2i anim = a.anims[ a.inuse ];
float delta = window_delta() * 30 * a.speed * !is_dragging_slider; // 30fps anim timer
profile("Skeletal update") if(!window_has_pause()) custom.curframe = model_animate_clip(custom, custom.curframe + delta, anim.min, anim.max, strstri(a.names[a.inuse], "loop"));
profile("Skeletal update") if(!window_has_pause()) custom.curframe = model_animate_clip(custom, custom.curframe + delta, anim.min, anim.max, !!strstri(a.names[a.inuse], "loop"));

// UI
if( ui_panel("Animation", 0)) {
Expand Down
35 changes: 20 additions & 15 deletions demos/00-audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,35 @@

int main() {
// window (80% sized, MSAA x4 flag)
window_create(80, WINDOW_MSAA4);
window_title(__FILE__);
window_create(80, WINDOW_MSAA4 | WINDOW_SQUARE);

// audio (both clips & streams)
audio_t voice1 = audio_clip( "coin.wav" );
audio_t voice2 = audio_clip( "pew.sfxr" );
// audio (both streams & clips)
audio_t stream1 = audio_stream( "wrath_of_the_djinn.xm" );
audio_t stream2 = audio_stream( "larry.mid" );
audio_play(voice2, 0);
audio_play(stream1, 0);
audio_t stream3 = audio_stream( "monkey1.mid" );
audio_t stream4 = audio_stream( "waterworld-map.fur" );
audio_t BGM = stream1;
audio_play(BGM, 0);

audio_t SFX1 = audio_clip( "coin.wav" );
audio_t SFX2 = audio_clip( "pew.sfxr" );
audio_play(SFX1, 0);

// demo loop
while (window_swap() && !input_down(KEY_ESC))
{
if( ui_panel("Audio", 0)) {
while (window_swap() && !input_down(KEY_ESC)) {
static int open = 1;
if( ui_window("Audio", &open)) {
static float bgm = 1, sfx = 1, master = 1;
if( ui_slider2("BGM", &bgm, va("%.2f", bgm))) audio_volume_stream(bgm);
if( ui_slider2("SFX", &sfx, va("%.2f", sfx))) audio_volume_clip(sfx);
if( ui_slider2("Master", &master, va("%.2f", master))) audio_volume_master(master);
if( ui_label2_toolbar("BGM: Wrath of the Djinn", ICON_MD_VOLUME_UP, 24)) audio_stop(stream2), audio_play(stream1, AUDIO_SINGLE_INSTANCE);
if( ui_label2_toolbar("BGM: Leisure Suit Larry 3", ICON_MD_VOLUME_UP, 24)) audio_stop(stream1), audio_play(stream2, AUDIO_SINGLE_INSTANCE);
if( ui_label2_toolbar("SFX: Coin", ICON_MD_VOLUME_UP, 24)) audio_play(voice1, 0);
if( ui_label2_toolbar("SFX: Pew", ICON_MD_VOLUME_UP, 24)) audio_play(voice2, 0);
ui_panel_end();
if( ui_label2_toolbar("BGM: Wrath of the Djinn", ICON_MD_VOLUME_UP, 24)) audio_stop(BGM), audio_play(BGM = stream1, AUDIO_SINGLE_INSTANCE);
if( ui_label2_toolbar("BGM: Leisure Suit Larry", ICON_MD_VOLUME_UP, 24)) audio_stop(BGM), audio_play(BGM = stream2, AUDIO_SINGLE_INSTANCE);
if( ui_label2_toolbar("BGM: Monkey Island", ICON_MD_VOLUME_UP, 24)) audio_stop(BGM), audio_play(BGM = stream3, AUDIO_SINGLE_INSTANCE);
if( ui_label2_toolbar("BGM: Waterworld Map", ICON_MD_VOLUME_UP, 24)) audio_stop(BGM), audio_play(BGM = stream4, AUDIO_SINGLE_INSTANCE);
if( ui_label2_toolbar("SFX: Coin", ICON_MD_VOLUME_UP, 24)) audio_play(SFX1, 0);
if( ui_label2_toolbar("SFX: Pew", ICON_MD_VOLUME_UP, 24)) audio_play(SFX2, 0);
ui_window_end();
}
}
}
31 changes: 16 additions & 15 deletions demos/00-demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ int main() {
window_title(__FILE__);

// load all fx files
for(const char **list = vfs_list("fx**.fs"); *list; list++) {
for(const char **list = file_list("./", "fx**.fs"); *list; list++) {
fx_load(*list);
}

Expand Down Expand Up @@ -77,12 +77,13 @@ int main() {
cam.speed = 0.2f;

// audio (both clips & streams)
audio_t voice1 = audio_clip( "coin.wav" );
audio_t voice2 = audio_clip( "pew.sfxr" );
audio_t stream1 = audio_stream( "wrath_of_the_djinn.xm" );
audio_t stream2 = audio_stream( "larry.mid" );
audio_play(voice1, 0);
audio_play(stream1, 0);
audio_t SFX1 = audio_clip( "coin.wav" );
audio_t SFX2 = audio_clip( "pew.sfxr" );
audio_t BGM1 = audio_stream( "waterworld-map.fur"); // wrath_of_the_djinn.xm" );
audio_t BGM2 = audio_stream( "larry.mid" );
audio_t BGM3 = audio_stream( "monkey1.mid" ), BGM = BGM1;
audio_play(SFX1, 0);
audio_play(BGM, 0);

// demo loop
while (window_swap())
Expand Down Expand Up @@ -201,7 +202,7 @@ int main() {
if(ui_float2("Mouse polarity", do_mouse_polarity.v2)) {}
if(ui_float2("Mouse sensitivity", do_mouse_sensitivity.v2)) {}
if(ui_separator()) {}
if(ui_button("About...")) { do_about = 1; audio_play(voice1, 0); }
if(ui_button("About...")) { do_about = 1; audio_play(SFX1, 0); }
if(ui_dialog("About", __FILE__ "\n" __DATE__ "\n" "Public Domain.", 0, &do_about)) {}
ui_panel_end();
}
Expand All @@ -223,10 +224,11 @@ int main() {
if( ui_slider2("BGM", &bgm, va("%.2f", bgm))) audio_volume_stream(bgm);
if( ui_slider2("SFX", &sfx, va("%.2f", sfx))) audio_volume_clip(sfx);
if( ui_slider2("Master", &master, va("%.2f", master))) audio_volume_master(master);
if( ui_label2_toolbar("BGM: Wrath of the Djinn", ICON_MD_VOLUME_UP, 24)) audio_stop(stream2), audio_play(stream1, AUDIO_SINGLE_INSTANCE);
if( ui_label2_toolbar("BGM: Leisure Suit Larry 3", ICON_MD_VOLUME_UP, 24)) audio_stop(stream1), audio_play(stream2, AUDIO_SINGLE_INSTANCE);
if( ui_label2_toolbar("SFX: Coin", ICON_MD_VOLUME_UP, 24)) audio_play(voice1, 0);
if( ui_label2_toolbar("SFX: Pew", ICON_MD_VOLUME_UP, 24)) audio_play(voice2, 0);
if( ui_label2_toolbar("BGM: Waterworld Map" /*Wrath of the Djinn"*/, ICON_MD_VOLUME_UP, 24)) audio_stop(BGM), audio_play(BGM = BGM1, AUDIO_SINGLE_INSTANCE);
if( ui_label2_toolbar("BGM: Leisure Suit Larry", ICON_MD_VOLUME_UP, 24)) audio_stop(BGM), audio_play(BGM = BGM2, AUDIO_SINGLE_INSTANCE);
if( ui_label2_toolbar("BGM: Monkey Island", ICON_MD_VOLUME_UP, 24)) audio_stop(BGM), audio_play(BGM = BGM3, AUDIO_SINGLE_INSTANCE);
if( ui_label2_toolbar("SFX: Coin", ICON_MD_VOLUME_UP, 24)) audio_play(SFX1, 0);
if( ui_label2_toolbar("SFX: Pew", ICON_MD_VOLUME_UP, 24)) audio_play(SFX2, 0);
ui_panel_end();
}

Expand Down Expand Up @@ -271,9 +273,8 @@ int main() {
}

// network test (https)
FILE *webfile = file_temp();
download(webfile, "https://www.google.com/");
printf("Network test: %d bytes downloaded from google.com\n", (int)ftell(webfile));
array(char) webfile = download("https://www.google.com/");
printf("Network test: %d bytes downloaded from google.com\n", array_count(webfile));

// script test (lua)
script_run( "-- Bye.lua\nio.write(\"script test: Bye world!, from \", _VERSION, \"\\n\")" );
Expand Down
14 changes: 8 additions & 6 deletions demos/00-easing.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,19 @@ struct {
};

int main() {
window_create(0.75, 0);
window_create(0.75, WINDOW_SQUARE);
while(window_swap()) {
static float timer = 0;
if( (timer += 1/60.f) > 2 ) timer = 0; // loops every 2s
if(ui_panel("ease",0)) {
static double timer = 0; timer = fmod(timer+window_delta(), 2); // loops every 2s

static int open = 1;
if( ui_window("ease", &open) ) {
float linear_delta = timer / 2.f; // delta is [0..1]
for( int i = 0; i < countof(easings); ++i) {
float nonlinear_delta = easings[i].ease(linear_delta);
ui_slider(easings[i].name, &nonlinear_delta );
// visualize
ui_slider( easings[i].name, &nonlinear_delta );
}
ui_panel_end();
ui_window_end();
}
}
}
5 changes: 3 additions & 2 deletions demos/00-font.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ int main() {
font_print( "as there are no linefeeds.\n" );

// i18n: pangrams.txt file, line browser
static int counter;
static int counter = 0;
static array(char*) lines; do_once lines = strsplit( vfs_read("pangrams.txt"), "\r\n" );
counter += (counter += input_down(KEY_RIGHT)-input_down(KEY_LEFT)) < 0 ? array_count(lines) : 0;
counter += input_down(KEY_RIGHT)-input_down(KEY_LEFT);
counter += counter < 0 ? array_count(lines) : 0;
font_print( va("<< %s >>\n", lines[counter % array_count(lines)]) );

// this does not work yet. you cant chain alignments yet...
Expand Down
6 changes: 3 additions & 3 deletions demos/00-pbr.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "fwk.h"

#ifdef __TINYC__
#if is(tcc) && !is(win32) // @todo: remove this & test on linux
int log2_64 (uint64_t value) {
const int tab64[64] = {
63, 0, 58, 1, 59, 47, 53, 2,
Expand Down Expand Up @@ -384,7 +384,7 @@ int main( int argc, const char *argv[] ) {
window_create( 75, WINDOW_MSAA2 );

// load all fx files
for(const char **list = vfs_list("fx**.fs"); *list; list++) {
for(const char **list = file_list("./","fx**.fs"); *list; list++) {
fx_load(*list);
}

Expand Down Expand Up @@ -422,7 +422,7 @@ int main( int argc, const char *argv[] ) {
unsigned skysphereShader = shader( vfs_read("Skyboxes/skysphere.vs"), vfs_read("Skyboxes/skysphere.fs"), NULL, NULL );
Model skysphere = { 0 }; ModelLoad(&skysphere, "Skyboxes/skysphere.fbx"); ModelRebind(&skysphere, skysphereShader);

if( ModelLoad( &gModel, argc > 1 ? argv[ 1 ] : "damagedhelmet.gltf" ) ) {
if( ModelLoad( &gModel, argc > 1 && argv[1][0] != '-' ? argv[ 1 ] : "damagedhelmet.gltf" ) ) {
ModelRebind( &gModel, gShader );
}

Expand Down
2 changes: 1 addition & 1 deletion demos/00-scene.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ int main() {
window_title(__FILE__);

// load all fx files
for(const char **list = vfs_list("fx**.fs"); *list; list++) {
for(const char **list = file_list("./","fx**.fs"); *list; list++) {
fx_load(*list);
}

Expand Down
Loading

0 comments on commit 45e34d7

Please sign in to comment.