Commit graph

66 commits

Author SHA1 Message Date
d86f701fd0 finally fix dooms not being able to output sound
It was just the empty environment after posix_spawn() that caused
SDL_INIT_AUDIO to fail. __environ fixes that.
2023-02-21 23:03:39 +01:00
da4620aee6 cleanup ib_sound_nng.c There never was an issue there... 2023-02-21 23:01:31 +01:00
e2094cd1ce toggle fullscreen, toggle ui, invert mouse panning 2023-02-20 22:50:17 +01:00
888e9459c5 fix crash due to logging during shutdown from class based DoomState
Crash was double free in ImGui::AppendLog() during shutdown. Will have to
disable the logging callback if logging should happen at that point.
2023-02-20 00:06:28 +01:00
1a0c22ae09 disable texture info debug 2023-02-20 00:01:29 +01:00
957e367c89 ctrl: fix rendering, erase Endooms, implement zooming and panning 2023-02-19 23:52:54 +01:00
e1979a2321 dp_doom: use 4 bytes per pixel and fix the colors 2023-02-19 23:48:02 +01:00
25bea999e2 it's alive! not pretty but alive! also remove the fork() spawner 2023-02-19 16:33:23 +01:00
6f683676be intermittent ctrl commit: fork() based spawn code which makes nng panic 2023-02-19 16:23:29 +01:00
83952d27ff dp_doom: hacky way to run without audio
This needs fixing in the controller. Try something similar to xdg-open
where a doomgrandchild would execvp() the doom.
2023-02-19 16:22:51 +01:00
5072cee454 ctrl: register externally started dooms that introduce themselves
TODO: Check on those via kill(pid, 0) or store the last activity time in
DoomState and let dooms time out if they don't send more updates.
2023-02-19 12:46:17 +01:00
ab6eef1d94 dp_doom: fix silly bug causing only the first frame to be published 2023-02-19 12:40:26 +01:00
c45a799dc5 dp_doom: make errors from IB_StartupSound() non-fatal
Not sure if it actually runs without sound or die horribly. Needs testing.
2023-02-19 12:39:43 +01:00
f612c9190f dp_doom: switch to own sdl sound impl because issues
Wasn't a bug in the sound code at all. This version is just cleaned up
and is not compatible with SDL1 anymore.
2023-02-19 12:38:25 +01:00
e17ad73f74 unique filenames for ib_{sound, system, video}/ implementation files 2023-02-19 10:54:31 +01:00
78cc2c30b6 silence doomsim logging even more 2023-02-19 10:46:26 +01:00
ad19f5a8aa make dp_doom send out framebuffers via nng 2023-02-19 10:46:12 +01:00
af517ab00b ctrl: better networking, can render received frames, still a broken mess 2023-02-19 10:44:57 +01:00
ffbe1177ee fill out some of the doom implementation 2023-02-19 03:08:56 +01:00
24a58fd8a9 rename clowndoom to dp_doom, add skeleton code, fix issues 2023-02-19 02:17:52 +01:00
3869b09a3c add modified clowndoom 2023-02-19 01:52:56 +01:00
5342530c20 Squashed 'src/dp_doom/' content from commit 1909924
git-subtree-dir: src/dp_doom
git-subtree-split: 190992421c7c643afc99d7f7c511c162f65bea85
2023-02-19 01:52:56 +01:00
b93e6bf8f0 and back to spawning doomsims 2023-02-19 01:46:31 +01:00
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