Draw render targets in the renderer process
CI / build (push) Successful in 48s

While the renderer process runs, the adapter makes the client's render targets
itself and the renderer process draws frames into them: texture targets are
drawn with like any texture, and a pixmap target's frame is read back through
the channel into its Pixmap (protocol version 4: BeginFrame names its target,
CreateRenderTarget, Channel::readSize and the -read event). Frames into render
targets are drawn even while the window is hidden.

The client uses pixmap targets for snapshots (outfit pictures, photos), checked
to look right. The render target interfaces are declared from IMVU's vtables.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
dhkatzandClaude Opus 5.5 committed 2026-10-28 19:09:48 -07:00
1 parent fa883892db
commit 6e4fe589e5
18 files changed
+523 -58

No files matched your search

+26 -2
View File
@@ -1,6 +1,8 @@
#pragma once
// Reading IMVU's images (Pixmap) through pixmap.dll's exported methods, rather than depending on their layout.
// IMVU's images (Pixmap), through pixmap.dll's exported methods rather than depending on their layout (only their
// size, for making our own).
#include <cstddef>
#include <cstdint>
#include <optional>
@@ -12,10 +14,32 @@ struct PixmapPixels {
std::uint32_t width;
std::uint32_t height;
std::uint32_t rowBytes;
const std::uint32_t* pixels; // 0xAARRGGBB, rows rowBytes apart
std::uint32_t* pixels; // 0xAARRGGBB, rows rowBytes apart
};
// Null if pixmap.dll's methods can't be found.
std::optional<PixmapPixels> pixmap_pixels(const imvu::Pixmap& pixmap);
// A Pixmap of our own, made and destroyed by pixmap.dll.
class OwnedPixmap {
public:
// Width by height; invalid if pixmap.dll's methods can't be found.
OwnedPixmap(int width, int height);
OwnedPixmap(const OwnedPixmap&) = delete;
OwnedPixmap& operator=(const OwnedPixmap&) = delete;
~OwnedPixmap();
[[nodiscard]] bool valid() const { return valid_; }
[[nodiscard]] const imvu::Pixmap& get() const { return *reinterpret_cast<const imvu::Pixmap*>(storage_); }
// Constructs a copy in result (raw memory for a Pixmap, as for a Pixmap returned by value); an empty Pixmap if
// this one isn't valid.
imvu::Pixmap* copyTo(imvu::Pixmap* result) const;
private:
// sizeof(Pixmap) in pixmap.dll: its constructors set 7 fields.
alignas(4) std::byte storage_[28];
bool valid_ = false;
};
} // namespace t5de