The renderer becomes two programs: the adapter (t5deRenderEngine.dll, 32-bit, in IMVU's process) and a 64-bit renderer process (t5de-renderer.exe) drawing with Diligent Engine, fetched with FetchContent and pinned. For now a spike: the adapter starts the renderer process for each engine and signals each frame through a shared memory channel, and the renderer process draws a box into a child window in the client's 3D view. Co-Authored-By: Claude Opus 5.5 <[email protected]>
36 lines
950 B
C++
36 lines
950 B
C++
#pragma once
|
|
// The renderer process (t5de-renderer.exe, 64-bit) an engine draws through: started with the engine, told about
|
|
// each frame through a shared memory channel (include/t5de/protocol/channel.hpp), and told to exit with it.
|
|
|
|
#include <windows.h>
|
|
|
|
#include <cstdint>
|
|
#include <memory>
|
|
|
|
#include "t5de/protocol/channel.hpp"
|
|
|
|
namespace t5de {
|
|
|
|
class RendererProcess {
|
|
public:
|
|
// Starts t5de-renderer.exe from this DLL's folder, drawing into window; null if it can't.
|
|
static std::unique_ptr<RendererProcess> start(HWND window);
|
|
|
|
RendererProcess(const RendererProcess&) = delete;
|
|
RendererProcess& operator=(const RendererProcess&) = delete;
|
|
~RendererProcess();
|
|
|
|
// The client drew a frame.
|
|
void frameDrawn();
|
|
|
|
private:
|
|
RendererProcess() = default;
|
|
|
|
HANDLE mapping_ = nullptr;
|
|
HANDLE frameEvent_ = nullptr;
|
|
HANDLE process_ = nullptr;
|
|
protocol::Channel* channel_ = nullptr;
|
|
};
|
|
|
|
} // namespace t5de
|