TextureObject
Generated from engine/render/texture_object.h at 862e08b. The text under each declaration is the header's own comment, word for word. About the reference says how these pages are made.
#include "engine/render/texture_object.h" · namespace labrador
class TextureObject
Section titled “class TextureObject”One still frame out of a sprite sheet.
The frame name is resolved against the sheet once, at construction, and what is kept is a handle: an index into that sheet's frame table. Drawing is then two indexed loads - the sheet out of its registry slot, the frame out of the sheet - with no string touched on the way.
NO CAMERA PARAMETER. The list holds the camera (renderer.h, DrawList::set_camera), so a caller wanting screen space sets nothing and a caller wanting a player's view sets it once for the range rather than passing it down through every signature.
TextureObject
Section titled “TextureObject”TextureObject(const std::string& sheet_name, const std::string& frame_name, float rotation = 0.0f, float layer_depth = 0.0f);frame (protected)
Section titled “frame (protected)”set_frame (protected)
Section titled “set_frame (protected)”void set_frame(const std::string& sheet_name, const std::string& frame_name);void set_frame(const std::string& frame_name);Both setters resolve, and the two-argument one moves sheet and frame together because a frame handle taken from one sheet indexes nothing meaningful in another. There is deliberately no way to change the sheet on its own.
It is not atomic: a bad frame name throws with the sheet already moved. That is tolerable only because an unresolvable name is fatal - the worker's exception is rethrown on the joining thread (ThreadPool::wait_for_tasks_to_complete) and the process goes down, so nothing ever draws the mismatched pair.
draw (protected)
Section titled “draw (protected)”virtual void draw(DrawList& draw_list,draw_with (protected)
Section titled “draw_with (protected)” float rotation) const;Draws reading only one per-draw member, layer_depth, which orders nothing on any backend - so callers can compute frame / colour / origin / flip / rotation into locals instead of assigning them to this object first.
A SCENE RUNS draw() ON THE SAME OBJECT FROM EVERY RENDER WORKER AT ONCE, so "set members, then draw" is an unsynchronised data race - and with a std::string element it is concurrent free/allocate on one control block, i.e. heap corruption. The frame is a handle, so passing it costs a register rather than a string copy. The fan-out this describes is engine/scene/scene.cpp's and is pinned by tests/scene/fanout_tests.cpp.
Related types
Section titled “Related types”Named in the public declarations above: Colour, DrawList, RectangleF, RenderResources, SpriteFlip, SpriteSheet, SpriteSheetObject, Vector2F.
In the samples and tests
Section titled “In the samples and tests”No sample or test includes this header directly.
Development documentation (unreleased). Built from Labrador 862e08b of 2026-10-08.