Add the renderer process
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]>
This commit is contained in:
1 parent
0d126574bf
commit
9a7d7d2908
18 files changed
+491
-57
No files matched your search
@@ -5,6 +5,8 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
struct HWND__; // windows.h's window handle type (HWND is HWND__*)
|
||||
|
||||
namespace t5de::imvu {
|
||||
|
||||
template <class T>
|
||||
@@ -94,6 +96,18 @@ struct PointSpriteVector;
|
||||
// Region lists IMVU passes to texture updates; unknown so far.
|
||||
class CompoundRegion;
|
||||
|
||||
class INativeWindow;
|
||||
struct UiEvent;
|
||||
using NativeWindowHandle = ::HWND__*; // an HWND
|
||||
|
||||
// IMVU's window (SceneWindow.dll's NativeWindow), as far as a renderer needs it: the first methods of its vtable.
|
||||
// Its later methods include overloads, which MSVC lays out unlike their declaration: declare them from the vtable
|
||||
// if they're ever needed.
|
||||
class INativeWindow {
|
||||
public:
|
||||
virtual ~INativeWindow() = default;
|
||||
virtual void handleMessage(UiEvent* event) = 0;
|
||||
virtual int onSetCursor(Vec2i position) = 0;
|
||||
virtual NativeWindowHandle getPlatformWindow() = 0;
|
||||
};
|
||||
|
||||
} // namespace t5de::imvu
|
||||
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
// What the adapter (t5deRenderEngine.dll, in IMVU's 32-bit process) and the renderer process (64-bit) share. Both
|
||||
// are built from this header, for different architectures: fixed-size fields only, no pointers or handles' native
|
||||
// sizes.
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace t5de::protocol {
|
||||
|
||||
inline constexpr std::uint32_t version = 1;
|
||||
|
||||
// A shared memory section the adapter creates for each engine. Its name is passed to the renderer process as
|
||||
// `--channel <name>`; the event "<name>-frame" (auto-reset) is set after each frame the client draws.
|
||||
struct Channel {
|
||||
std::uint32_t version;
|
||||
std::uint32_t closing; // nonzero: the engine is gone, the renderer process should exit
|
||||
std::uint64_t window; // IMVU's 3D window (an HWND; window handles are valid in every process)
|
||||
std::uint64_t frames; // frames the client has drawn
|
||||
};
|
||||
|
||||
static_assert(sizeof(Channel) == 24, "same layout in 32-bit and 64-bit builds");
|
||||
|
||||
inline constexpr wchar_t frameEventSuffix[] = L"-frame";
|
||||
|
||||
} // namespace t5de::protocol
|
||||
Reference in new issue
Block a user