Migrating from RPS UI Framework 1.1
RPS UI Framework 1.1 published three tables through the RPS SDK: the panel
framework (RPSUIFrameworkApi.h, export RPSUI_RequestApi), cooperation
(RPSUICooperationApi.h, RPSUI_RequestCooperationApi) and input
(RPSUIInputApi.h, RPSUI_RequestInputApi). Version 2.0 publishes nine
interfaces at major 2 from RPS UI Framework's include/RPS_UI_Framework/,
found through RPSUI_QueryInterfaceV1. The old exports stay only to refuse:
they return no table, and RPS UI names the mod that called them in
RPS_UI_Framework.log; the game keeps running. A mod built against the SDK headers has
to be rebuilt with the changes on this page.
The largest change is drawing. In 1.1 your mod ran its own Dear ImGui context and DX11 backend and drew into a render target the host passed you. In 2.0 the host owns every panel's ImGui context, renderer, fonts, input and frame, and your mod only issues ImGui calls (section 4).
A mod that also binds ROCK, PAPER or RobCo PALM moves all of them at once;
each has its own guide: ROCK, PAPER, RPS UI Framework, RobCo PALM. Coding agents can follow the rock-1.0-migration skill in ROCK's repository (skills/rock-1.0-migration/SKILL.md), which covers the four together.
1. Build
- Remove the RPS SDK from your build:
find_package(RPS_SDK), include paths ending inSDK/UI/include, and any copy of theRPSUI*Api.hheaders. - Add RPS UI Framework's
include/directory through a CMake cache variable, for exampleRPSUI_INCLUDE_DIR, and include<RPS_UI_Framework/...>. Nothing is linked. - If you draw panels, build Dear ImGui as section 4 describes and drop your DX11 ImGui backend.
- The headers need C++20 and a 64-bit build.
2. Discovery
| 1.1 | 2.0 |
|---|---|
rpsui::sdk::RequestApiV1(), export RPSUI_RequestApi | rpsui::api::acquire(query, framework) with const framework::Api* |
RequestCooperationApiV1(), RPSUI_RequestCooperationApi | acquire(query, cooperation) with const cooperation::Api* |
Input request, RPSUI_RequestInputApi | acquire(query, input) with const input::Api* |
#include <RPS_UI_Framework/Client.h>
#include <RPS_UI_Framework/Framework.h>
const auto module = GetModuleHandleW(rpsui::api::kModuleName);
const auto query = module ? reinterpret_cast<rpsui::api::QueryInterfaceV1>(
GetProcAddress(module, rpsui::api::kQueryExportName)) : nullptr;
const rpsui::api::framework::Api* framework{};
if (rpsui::api::acquire(query, framework) != rpsui::api::Result::Ok) {
// RPS UI absent or refused: run without panels.
}
acquire requests exactly the major, minor and table size your headers
declare. Never probe with trial queries: every refused query is logged as a mismatch.
Feature negotiation is gone: FeatureV1, requestedFeatures,
grantedFeatures, the table's apiFlavor and featureBits are removed.
Every table function is set.
3. Names and records
- The namespace
rpsui::sdkbecomesrpsui::apiwith one namespace per interface (framework,cooperation,input, ...).V1is gone from every type:ResultV1isrpsui::api::Result(same values, plusImGuiBuildMismatchand the discovery results),PanelFlagV1isframework::PanelFlag,PhysicalHandV1isPhysicalHand. - Every record's
structSizeandapiVersionaresizeandversion. Value-initialize records and the defaults are right; a short record returnsInvalidArgumentand another versionVersionMismatch(InvalidArgumenton the Framework registration and presentation calls). Reserved fields are gone. - Capacity grew from 16 consumers and 8 panels to 256 consumers, 1024 panels and 256 input subscriptions.
4. Framework: panels drawn by the host
| 1.1 | 2.0 |
|---|---|
ConsumerRegistrationV1, ConsumerHandleV1 | ConsumerRegistration (consumerId, displayName), ConsumerHandle (ownerToken) |
PanelRegistrationV1.pixelWidth, pixelHeight | layoutWidth, layoutHeight: your drawing size in ImGui units and the panel's default shape. The host picks the texture size from the panel's size in the world and the player's Sharpness setting |
PanelRegistrationV1.renderCallback(PanelRenderFrameV1) | drawCallback(PanelDrawFrame), plus an optional setupCallback(PanelSetup) and imgui = RPSUI_IMGUI_BUILD() |
PanelRenderFrameV1.d3dContext, renderTargetView | Removed: the host renders into the panel's texture. d3dDevice stays for your own textures |
pointerPixelX, pointerPixelY | pointerX, pointerY in layout units; the host has already fed them to ImGui |
backDown (the grip level) | backPressed: 1 on exactly one frame per Back on a ConfigNavigation panel, delivered on the grip's release |
resetPanelSize | resetPanelLayout (size and placement) |
submitPanelPresentation, getPanelState, unregisterPanel, isFrameworkReady | Same names; PanelPose keeps its fields, and its height may be any positive value |
New: PanelFlag::Movable (the player carries the panel by holding grip on it),
pulseHaptic, and themes.
What to change in your drawing code:
- Delete your ImGui context creation,
ImGui_ImplDX11_*calls, font atlas building,NewFrameandRender, and the render target handling. The host does all of it. - Compile Dear ImGui yourself from the revision named in
Dear ImGui integration, with
IMGUI_USER_CONFIG="RPS_UI_Framework/ImGuiBuild.h"and without the DX11 backend.registerPanelrefuses another build withImGuiBuildMismatch, which is logged like an outdated mod. - Expand
RPSUI_IMGUI_BUILD()where you fillPanelRegistration::imgui, with<imgui.h>and<imgui_internal.h>included there. - Start both callbacks with
RPSUI_IMGUI_BIND(frame->imgui)(orsetup->imgui). It makes the host's context current in your copy of ImGui and switches it to the host's allocator. Then issue ImGui calls in layout units:frame->layoutWidthbyframe->layoutHeightis the whole panel. - Load extra fonts, adjust the style and create textures in
setupCallback, which runs once per context. Remake them whencontextGenerationordeviceGenerationchanges. - Draw with the player's theme:
frame->themeholds colour roles and sizes, andframe->fontsthe theme's four faces. Plain ImGui widgets follow the theme without code.
5. Cooperation
The calls keep their names: registerPanel, getSnapshot,
unregisterPanelSafely, unregisterConsumerSafely. Records lose V1:
CooperativePanelRegistrationV1 is cooperation::PanelRegistration and embeds
the 2.0 Framework PanelRegistration (so it carries layoutWidth,
layoutHeight, imgui, setupCallback and drawCallback), and
PanelAgreementV1, ConsumerDirectoryEntryV1, PanelDirectoryEntryV1 and
CooperationSnapshotV1 are PanelAgreement, ConsumerDirectoryEntry,
PanelDirectoryEntry and Snapshot.
6. Input
The calls keep their names: subscribe, unsubscribe, capture,
rawInputReadActive, capturedButtons, setPointerAim. New:
captureKeyboard, for text entry. Records lose V1: InputFrameV1 is
input::Frame, HandInputV1 is HandInput, InputCaptureV1 is Capture,
PointerAimV1 is PointerAim, InputCallbackV1 is Callback.
CaptureandPointerAimgainversion.HandInput.valid,Frame.readyandFrame.leftHandedareuint8instead ofbool: compare them with 0.
7. New interfaces
These did not exist in 1.1. See their pages if you need them:
- WorldDraw: spheres, lines, world-anchored text and meshes. ROCK 1.0 no longer draws for other mods; this replaces ROCK's Diagnostics drawing.
- NumberOverlay: numbers the host draws, such as ammo counters.
- PassivePanel: panels that show and take no input.
- FocusedPanel: fixed-size panels that take input only while pointed at.
- Registry: a paged census of consumers and panels.
- SettingsMenu: open RPS UI's settings menu and add up to eight pages of your own to it.
8. Check the result
- Build against
include/RPS_UI_Framework/with no RPS SDK path left. Fix every compile error with the tables above. - Search your source for leftovers:
rpsui::sdk,RPSUI_Request,structSize,apiVersion,renderCallback,renderTargetView,ImGui_ImplDX11,ImGui::CreateContext,backDown. - Start the game with RPS UI Framework 2.0.
RPS_UI_Framework.lognames no refusal for your DLL, and your panels draw with the player's theme.