Commit graph

43 commits

Author SHA1 Message Date
a9f054968d intermittent commit: do not spawn doomsim instances to test rendering
Without spawning doomsims the SDL_UpdateTexture()+SDL_RenderCopy() way does
scale well: with 1024 non-spawned dooms I'm at 19.4 fps, 51.5 ms/frame.
A single core is maxed out all the time and it's nicely jumping between
cores.
2023-02-19 01:45:51 +01:00
5502ab3b53 work on rendering - can draw rectangles into buffers and display those
Approach is to have one SDL_Texture per doom and use SDL_RenderCopy() with
different destination rectangles to compose the layout. Apart from
SDL_UpdateTexture() and SDL_RenderCopy() no work is done per doom.

This scales up to ~200 doomsim instances. After that the frametime
increases rapidly and all my cores are maxed out.

TODO: test without spawning doomsim processes!
2023-02-19 01:24:52 +01:00
c2726d1881 rename QuitDoom -> Endoom :) 2023-02-18 23:04:34 +01:00
2f18d5771d slight render call rearrangement 2023-02-18 22:41:05 +01:00
3ab1f6eee3 get rid of the doomId concept, use the pid instead
The internal unique id should not be needed, the pid is unique enough :)

Also this can allow starting dooms externally without having to pass an id
parameter that's not already in use. The externally started doom sends its
pid with the DoomReady message and the controller can add a new entry if it
needs to. Of course the controller will not be able to kill() these
externally started dooms.
2023-02-18 22:28:15 +01:00
26c7f69b42 build tiny messaging infrastructure, refactor, hack till it sort of works
When usleep()'ing in doomsim it misses most of the quit messages. I think
it's because the controller spams RunDoom all the time and the quit
messages get discarded while doomsim is sleeping.
2023-02-18 22:08:12 +01:00
acb679caf1 make logc an OBJECT library and enable clang-tidy for my code 2023-02-18 12:30:53 +01:00
913b97bd15 fix two "No newline at end of file" warnings 2023-02-18 12:30:53 +01:00
ccfd99b5a5 playing with clang-tidy, needs more love 2023-02-18 12:30:53 +01:00
7d8978f6b8 caturday work: leak fixes, can now tell dooms to quit, nng util functions 2023-02-18 12:30:53 +01:00
76beee977d use _Static_assert to ensure DP_DoomState_Strings matches DP_Doomstate enum 2023-02-18 12:30:53 +01:00
ecc2111adf cmake: turn imgui from an INTERFACE library into an OBJECT library
Saves us from compiling imgui multiple times and makes cmake invoked
clang-tidy automatically skip the imgui header and implementation files
because they are not directly part of our targets.
2023-02-18 12:30:53 +01:00
3d9da20335 posix_spawn() doomsims
The doomsim startup routine or the controller startup publish are broken.
The doomsims never transition from DP_DS_Ready state.
2023-02-18 12:30:53 +01:00
3ac66aa3fc remove the 'src/' prefix from file:line log output 2023-02-18 12:30:53 +01:00
17ba021843 add comment to ExampleAppLog and mini refactoring 2023-02-18 12:30:53 +01:00
d9edeb5344 fix broken debugging due to -ffile-prefix-map 2023-02-18 12:30:53 +01:00
c583573b0b fix build under msys2 2023-02-18 12:30:40 +01:00
09d2bd715b add first ui input elements and in-game logging 2023-02-12 22:21:06 +01:00
4a3dce5ef5 custom imgui window title! 2023-02-12 16:12:01 +01:00
1674946bed First steps with Dear ImGui. It's awesome! 2023-02-12 15:48:15 +01:00
0f83e60fc5 add test binary to make sure dp_common can be used from C 2023-02-12 13:46:52 +01:00
fcd47b7aa5 mini refactoring and cleanup 2023-02-12 13:40:41 +01:00
5673974566 add an imgui demo app + cmake cleanup 2023-02-12 13:39:48 +01:00
b75fb8961e add my standard typedefs for integrals 2023-02-12 13:38:54 +01:00
d1ef384fdb turn imgui into an interface library 2023-02-12 13:37:50 +01:00
53775fbdf2 build and use imgui from externals, make the imgui demo work 2023-02-12 04:47:48 +01:00
65bba95f4c add imgui-v1.89.2 2023-02-12 03:32:19 +01:00
dc09ac17a1 Squashed 'external/imgui/' content from commit d7c8516a4
git-subtree-dir: external/imgui
git-subtree-split: d7c8516a4b848c0291e3d75b627c0843f515f591
2023-02-12 03:32:19 +01:00
de463a6747 ctrl: write some broken sdl and imgui code 2023-02-12 03:32:02 +01:00
aa6438783a doomsim updates: state machine, nng_recvmsg/nng_sendmsg, first actual logic 2023-02-11 23:52:20 +01:00
929ab1978b nng: fix warning: comparison of integer expressions of different signedness 2023-02-10 18:40:27 +01:00
ec041cf83b refactoring all the things
- Move from spdlog to log.c by rxi
- Create dp_common c library
- Create empty doomsim executable
2023-02-08 06:39:23 +01:00
dc754c2885 buggy pub sub code 2023-02-04 01:56:30 +01:00
ae93002731 actually use the in-tree, patched version of nng 2023-02-04 01:56:09 +01:00
20dafc44c8 nng: make nng_set_resolve_thread_max() apply on posix
Note: things will break if nng_set_resolve_thread_max() is modified at
runtime and more resolver are spawned. Not sure if this can actually
happen.
2023-02-04 00:00:14 +01:00
ef97762930 create cmake project structure and c++ test app 2023-02-03 23:33:37 +01:00
618510bef7 add spdlog-v1.11.0 2023-02-03 22:02:26 +01:00
28354841a7 Squashed 'external/spdlog/' content from commit ad0e89cb
git-subtree-dir: external/spdlog
git-subtree-split: ad0e89cbfb4d0c1ce4d097e134eb7be67baebb36
2023-02-03 22:02:26 +01:00
04a36e9a14 apply patch to nng to be able to control the number of threads used
Patch author: bionicbeagle
Patch source: https://gist.github.com/bionicbeagle/4891eba6279ead5db5f501a60ff2b194
Discussion: https://github.com/nanomsg/nng/issues/1572#issuecomment-1332740743
2023-02-03 21:33:39 +01:00
aae8b059b3 .gitignore things 2023-02-03 21:31:17 +01:00
e9d781d591 add nng-v1.5.2 2023-02-03 21:18:59 +01:00
810e2cc699 Squashed 'external/nng/' content from commit 169221da
git-subtree-dir: external/nng
git-subtree-split: 169221da8d53b2ca4fda76f894bee8505887a7c6
2023-02-03 21:18:59 +01:00
71649817b5 Initial commit. This is not going to be useful to you for anything. Ever. 2023-02-03 21:15:57 +01:00