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

Commit

Permalink
lab: experiments with a OSC message driven UI editor (done: init, loa…
Browse files Browse the repository at this point in the history
…d, save, undo, reset; TODO: framebuffer vis, entity_id, components, systems)

new: increased saturation in hue colors (fwk_ui)
new: auto colorize ui buttons (ui_button*)
new: allow 1-story/oneliners in notifications (ui_notify)
fix: bug preventing single-header distribution to be included twice into single compilation unit
fix: hexdump/f() not displaying empty blobs
fix: fix strcatf() incorrectly not appending an empty input string
fix: fix compilation error (emscripten+swrap)
fix: revert markdeep to v1.13 as newer versions are rendering colors wrongly (docs)
fix: argv(X) will return safe string to parse even if no argument is actually provided (out-of-range args)
fix: udp sockets can be used now even if no window/context is actually created
fix: retry on udp_send() when app failed to send
fix: do not panic on failed udp connections
lab: ui remote tests (osc/udp)
fix: compress source and html files in asset folders now
fix: delete editor/labs/vault/ folder
new: forced display of pushpin button, used alpha to highlight status, right aligned now (3rd_nuklear)
new: changed close button icon, right aligned now (3rd_nuklear)
new: install linux packages only once
new: distribute single-header fwk.h by default
new: sources are split in split/ folder, which can be extra split further by visiting split/split/ folder
new: reorganize project tree layout
fix: fix missing libmath flag required on debian distros (MAKE.bat on linux)
fix: fix dll linkage/symbol visibility (physics demos)(thx sushil!)
fix: fix PBR transparency pass (demo_pbr.c)
  • Loading branch information
r-lyeh committed Dec 31, 2022
1 parent 0e92741 commit dfb9133
Show file tree
Hide file tree
Showing 1,771 changed files with 342,470 additions and 13,418 deletions.
368 changes: 192 additions & 176 deletions MAKE.bat

Large diffs are not rendered by default.

57 changes: 29 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1 align="center"><a href="https://bit.ly/-fwk-">F·W·K</a></h1>
<h1 align="center"><a href="https://bit.ly/F-W-K">F·W·K</a></h1>
<p align="center">3D game framework in C, with Luajit bindings now.</p>

<p align="center">
Expand Down Expand Up @@ -53,7 +53,7 @@ editor1 | editor2
- [x] Disk cache.
- [x] Scene handling.
- [x] Profiler, stats and leaks finder.
- [x] [Documentation (wip)](https://bit.ly/-fwk-).
- [x] [Documentation (wip)](https://bit.ly/F-W-K).

## Roadmap ᕕ(ᐛ)ᕗ (in order of arrival; ✱: partial support)
- [ ] Editor: gizmos✱, scene tree, property editor✱, load/save✱, undo/redo✱, copy/paste. <!-- editor = tree of nodes. levels and objects are nodes, and widgets are also nodes --><!-- you can perform actions on nodes, with or without descendants, top-bottom or bottom-top --><!-- operations include load/save, reset, undo/redo, play/render vis on/off/alpha logic on/off/other ddraw on/off log on/off, etc -->
Expand Down Expand Up @@ -185,18 +185,18 @@ R. Documentation pass: API, functions, samples, examples, pipeline. #5

## Gallery
<p align="center">
<img src="https://raw.githubusercontent.com/r-lyeh/FWK/master/art/demos/demo_script.png" width="204px" title="Script."/>
<img src="https://raw.githubusercontent.com/r-lyeh/FWK/master/art/demos/demo_font.png" width="204px" title="Fonts."/>
<img src="https://raw.githubusercontent.com/r-lyeh/FWK/master/art/demos/demo_collide.png" width="204px" title="Collision."/>
<img src="https://raw.githubusercontent.com/r-lyeh/FWK/master/art/demos/demo_model.png" width="204px" title="Model."/>
<img src="https://raw.githubusercontent.com/r-lyeh/FWK/master/art/demos/demo_scene.png" width="204px" title="Scene."/>
<img src="https://raw.githubusercontent.com/r-lyeh/FWK/master/art/demos/demo_sprite.png" width="204px" title="Sprite."/>
<img src="https://raw.githubusercontent.com/r-lyeh/FWK/master/art/demos/demo_shadertoy.png" width="204px" title="Shadertoy."/>
<img src="https://raw.githubusercontent.com/r-lyeh/FWK/master/art/demos/demo_cubemap.png" width="204px" title="Cubemaps and SH."/>
<img src="https://raw.githubusercontent.com/r-lyeh/FWK/master/art/demos/demo_video.png" width="204px" title="Video."/>
<img src="https://raw.githubusercontent.com/r-lyeh/FWK/master/art/demos/demo_pbr.png" width="204px" title="PBR."/>
<img src="https://raw.githubusercontent.com/r-lyeh/FWK/master/art/demos/demo_instanced.png" width="204px" title="Instancing."/>
<img src="https://raw.githubusercontent.com/r-lyeh/FWK/master/art/demos/editor.png" width="204px" title="Editor."/>
<img src="https://raw.githubusercontent.com/r-lyeh/FWK/master/demos/demo_script.png" width="204px" title="Script."/>
<img src="https://raw.githubusercontent.com/r-lyeh/FWK/master/demos/demo_font.png" width="204px" title="Fonts."/>
<img src="https://raw.githubusercontent.com/r-lyeh/FWK/master/demos/demo_collide.png" width="204px" title="Collision."/>
<img src="https://raw.githubusercontent.com/r-lyeh/FWK/master/demos/demo_model.png" width="204px" title="Model."/>
<img src="https://raw.githubusercontent.com/r-lyeh/FWK/master/demos/demo_scene.png" width="204px" title="Scene."/>
<img src="https://raw.githubusercontent.com/r-lyeh/FWK/master/demos/demo_sprite.png" width="204px" title="Sprite."/>
<img src="https://raw.githubusercontent.com/r-lyeh/FWK/master/demos/demo_shadertoy.png" width="204px" title="Shadertoy."/>
<img src="https://raw.githubusercontent.com/r-lyeh/FWK/master/demos/demo_cubemap.png" width="204px" title="Cubemaps and SH."/>
<img src="https://raw.githubusercontent.com/r-lyeh/FWK/master/demos/demo_video.png" width="204px" title="Video."/>
<img src="https://raw.githubusercontent.com/r-lyeh/FWK/master/demos/demo_pbr.png" width="204px" title="PBR."/>
<img src="https://raw.githubusercontent.com/r-lyeh/FWK/master/demos/demo_instanced.png" width="204px" title="Instancing."/>
<img src="https://raw.githubusercontent.com/r-lyeh/FWK/master/editor/editor.png" width="204px" title="Editor."/>
<br/>
</p>

Expand Down Expand Up @@ -259,45 +259,46 @@ echo OSX && cc -ObjC -dynamiclib -o libfwk.dylib fwk.c -framework cocoa -fr
## Cook
- Most asset types need to be cooked before being used in your application. Other assets like `.png` do not.
- Cooker is already embedded into you application and will scan for new contents & cook assets automatically.
- In order to achieve this, your binary needs to keep both [`fwk.ini` file](fwk.ini) and [`tools/` folder](art/editor/tools/) close together.
- In order to achieve this, your binary needs to keep both [`fwk.ini` file](fwk.ini) and [`tools/` folder](tools/) close together.
- Cooked assets will be written into .zipfiles close to your executable, and mounted before entering game loop.
- When distributing your game, only your binary and these .zipfiles are required.

## Amalgamation
- Depending on your IDE, you might need to [split all amalgamated](#Amalgamation) files when debugging FWK.
- Split FWK into separate files by running `MAKE.bat split` (or `sh MAKE.bat split` in Linux/OSX).
- Merge those files back into FWK by running `MAKE.bat join` (or `sh MAKE.bat join` in Linux/OSX).
- Optionally, generate a single-header distribution by executing following script:
- Optionally, generate a single-header distribution by executing `MAKE.bat amalgamation` or following script:

```lua
echo // This C file is a header that you can #include. Do #define FWK_C > fwk-single-header.h
echo // early in **one** C compilation unit to unroll the implementation >> fwk-single-header.h
echo // The FWK_C symbol **must be defined in a C file**; C++ wont work. >> fwk-single-header.h
type art\editor\tools\3rd\3rd_glad.h >> fwk-single-header.h
type fwk.h >> fwk-single-header.h
echo #ifdef FWK_C >> fwk-single-header.h
echo #pragma once >> fwk-single-header.h
echo #define FWK_3RD >> fwk-single-header.h
type fwk >> fwk-single-header.h
type fwk.c >> fwk-single-header.h
echo #endif // FWK_C >> fwk-single-header.h
echo #pragma once >> fwk-single-header.h
type split\split\3rd_glad.h >> fwk-single-header.h
type split\fwk.h >> fwk-single-header.h
echo #ifdef FWK_C >> fwk-single-header.h
echo #pragma once >> fwk-single-header.h
echo #define FWK_3RD >> fwk-single-header.h
type split\fwk >> fwk-single-header.h
type split\fwk.c >> fwk-single-header.h
echo #endif // FWK_C >> fwk-single-header.h
```

## Extra tips
- Any ico/png file matching the executable name will be automatically used as app icon.
- Dropped files into game window will be imported & saved into [`art/import`](art/import) folder.
- Update the gamepad controller database by upgrading the [`gamecontrollerdb.txt`](art/editor/input) file.
- Dropped files into game window will be imported & saved into [`editor/import`](editor/import) folder.
- Update the gamepad controller database by upgrading the [`gamecontrollerdb.txt`](editor/input) file.
- Cancel entire cooking stage by pressing `ESC key` (not recommended).
- Disable automatic cooking by using `--with-cook-jobs=0` flag (not recommended).
- Cook from command-line by running [`cook.*` binaries](art/editor/tools/).
- Cook directly from command-line by running supplied [`tools/cook` standalone binary](tools/).
- Linux/OSX users can optionally install wine and use the Windows pipeline instead (by using `--with-wine` flag).
- Generate a Visual Studio solution by dropping `fwk.h, fwk.c and fwk` files into it.
- Faster builds by typing `MAKE.bat tcc` (Win/Linux).
- Get smaller .exes by compiling with `/Os /Ox /O2 /Oy /GL /GF /MT /DNDEBUG /Gw /link /OPT:ICF /LTCG` (vc).
<!-- - On windows + vc, you can use `make bindings` or `make docs` to generate everything prior to a release -->

## Bindings
- Luajit: Luajit bindings are provided in the [auto-generated fwk.lua file](art/demos/lua/fwk.lua).
- Luajit: Luajit bindings are provided in the [auto-generated fwk.lua file](demos/lua/fwk.lua).
- Nelua: [Nelua bindings](https://github.com/Rabios/nelua-fun/tree/main/fwk) provided by Rabia Alhaffar.

## Credits (Artwork + demos)
Expand Down
1 change: 0 additions & 1 deletion art/demos/physics/MAKE.bat

This file was deleted.

208 changes: 0 additions & 208 deletions art/editor/icons/free_logo_2.ai

This file was deleted.

Binary file removed art/editor/icons/free_logo_2.ico
Binary file not shown.
Binary file removed art/editor/icons/free_logo_2.png
Binary file not shown.
2 changes: 0 additions & 2 deletions art/editor/icons/free_logo_2.txt

This file was deleted.

1 change: 0 additions & 1 deletion art/editor/labs/vault/; ds

This file was deleted.

8 changes: 0 additions & 8 deletions art/editor/labs/vault/_test.c

This file was deleted.

19 changes: 0 additions & 19 deletions art/editor/labs/vault/all.c

This file was deleted.

10 changes: 0 additions & 10 deletions art/editor/labs/vault/bin.c

This file was deleted.

Loading

0 comments on commit dfb9133

Please sign in to comment.