Compare commits

..

No commits in common. "4c4c45f79b98b308a7c15356e001c93c5a3191c8" and "8f2eddec479bac085250faf63cdb38a3a51930b9" have entirely different histories.

2 changed files with 3 additions and 48 deletions

View file

@ -1,31 +1,18 @@
# doompanning # doompanning
![sdl_nyan_demo](external/sdl_nyan/sdl_nyan_demo.png)
@oxmox@chaos.social @oxmox@chaos.social
## Requirements ## Requirements
### Linux / FreeBSD gcc/clang, cmake, ninja, sdl2, doom shareware
gcc/clang, cmake, sdl2, doom shareware
See [Dockerfile](Dockerfile) for details. See [Dockerfile](Dockerfile) for details.
### MSYS2 (ucrt64)
```bash
pacman -S mingw-w64-ucrt-x86_64-SDL2 mingw-w64-ucrt-x86_64-toolchain
cd doompanning
mkdir build
cmake -G"MinGW Makefiles" ..
cmake --build . -j
```
## State ## State
Input forwarding to the dooms is currently broken or at least in a bad state. Input forwarding to the dooms is currently broken or at least in a bad state.
Was trying out something, not sure. Was trying out something, not sure.
Run [sdl_nyan_demo](external/sdl_nyan/src/sdl_nyan_demo.cc) for the cats. Run [sdl_nyan_demo](external/sdl_nyan/src/sdl_nyan_demo.cc) for the cats.
![sdl_nyan_demo](external/sdl_nyan/sdl_nyan_demo.png)

View file

@ -19,7 +19,6 @@
#include <signal.h> #include <signal.h>
#ifdef __WIN32 #ifdef __WIN32
#include <windows.h>
#else #else
#include <spawn.h> #include <spawn.h>
#include <sys/wait.h> #include <sys/wait.h>
@ -120,37 +119,6 @@ char **__environ = environ;
#ifdef __WIN32 #ifdef __WIN32
inline void spawn_doom(ControllerContext &ctx) inline void spawn_doom(ControllerContext &ctx)
{ {
(void) ctx;
// Source: https://learn.microsoft.com/en-us/windows/win32/procthread/creating-processes
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
ZeroMemory(&pi, sizeof(pi));
char cmdLine[256];
snprintf(cmdLine, sizeof(cmdLine), "%s", DOOM_EXECUTABLE);
// Start the child process.
if (!CreateProcess(NULL, // No module name (use command line)
cmdLine, // Command line
NULL, // Process handle not inheritable
NULL, // Thread handle not inheritable
FALSE, // Set handle inheritance to FALSE
0, // No creation flags
NULL, // Use parent's environment block
NULL, // Use parent's starting directory
&si, // Pointer to STARTUPINFO structure
&pi) // Pointer to PROCESS_INFORMATION structure
)
{
log_error("CreateProcess failed (%d)", GetLastError());
return;
}
log_info("Spawned new %s, pid=%d", cmdLine, pi.dwProcessId);
} }
#else #else
void spawn_doom_posix_spawn(ControllerContext &ctx) void spawn_doom_posix_spawn(ControllerContext &ctx)