Skip to content

sco_ui_surfaces_v1.register_surface

Adds a HUD_2D, BILLBOARD_3D or QUAD_3D surface showing one of the caller’s sco.widgets panels and writes its nonzero, never-reused id. desc and pose sizes must cover the 1.0 structs (larger tails ignored); every double finite; per-kind rules: HUD centre and size in viewport fractions with zero normal/up, billboard zero normal and unit up, quad unit normal and unit up perpendicular within 1e-3; 3D extents (0, 1000] m, max_distance [0, 1e7] m (0 = no limit), coordinates within 1e12 m; flags 0 or OCCLUDE_RAYCAST (3D only); panel_id “.” at most 63 bytes. 32 surfaces per plugin, 256 in all. Failure leaves the registry and *out_id unchanged.

sco_result (*)(sco_plugin *, const sco_surface_desc *, uint32_t *)

Service index

Property Value
Symbol sco_ui_surfaces_v1.register_surface
Record ID sco-ui-surfaces-v1-register-surface
Service sco.ui.surfaces
Table sco_ui_surfaces_v1
Version macro SCO_UI_SURFACES_VERSION_1_0
Packed table version 65536
Since / availability size >= 16; 1.0
Complete member extent (x64 bytes) 16
Table size (x64 bytes) 40

Header source

sco_result (*register_surface)(sco_plugin* self, const sco_surface_desc* desc, uint32_t* out_id);
Adds a HUD_2D, BILLBOARD_3D or QUAD_3D surface showing one of the caller’s sco.widgets panels and writes its nonzero, never-reused id. desc and pose sizes must cover the 1.0 structs (larger tails ignored); every double finite; per-kind rules: HUD centre and size in viewport fractions with zero normal/up, billboard zero normal and unit up, quad unit normal and unit up perpendicular within 1e-3; 3D extents (0, 1000] m, max_distance [0, 1e7] m (0 = no limit), coordinates within 1e12 m; flags 0 or OCCLUDE_RAYCAST (3D only); panel_id “.” at most 63 bytes. 32 surfaces per plugin, 256 in all. Failure leaves the registry and *out_id unchanged.

OK; BAD_ARG invalid/released self, NULL or short desc/pose, unknown kind, any field outside the rules, NULL out_id; TOO_MANY per-plugin or host limit, id space exhausted or allocation failure; UNAVAILABLE stopped service. last_error names the refused field.

query_service NOT_FOUND when the host does not publish sco.ui.surfaces (it needs sco.ui started); UNAVAILABLE for an incompatible version. No game capability or renderer requirement.

Host copies the pose and panel_id on success; caller keeps desc, pose and the string. No allocation transfer.

Any thread; registry lock held only for the copy. No callbacks.

No callbacks; desc, pose and panel_id are read during the call only.

No plugin code runs inside the service; calls from several threads are serialized by the registry lock.

No cancellation entrypoint; synchronous. Unregister, plugin unload or crash (through the sco.ui release hook) and service Stop withdraw the surface.

Status labels are copied verbatim from the catalogue: direct is native access; typed-wrapper is wrapper-backed; restricted is a subset/adaptation; unsupported means no supported route is established. No status implies universal safety.

Language Catalogue status Source evidence / wrapper tokens
c direct include/sco_ui_surfaces.h
(*register_surface)
cpp typed-wrapper include/scosdk/ui_surfaces.hpp
return table_->register_surface(self_, &desc, &id);
csharp unsupported docs/contracts.md
C# and Lua sco.ui.surfaces routes are unsupported.
lua unsupported docs/contracts.md
C# and Lua sco.ui.surfaces routes are unsupported.

None identified in the catalogue; this is not proof none can exist.

ABI pins prove layout, not semantic behavior or a live game session.