Commit Graph

6 Commits

Author SHA1 Message Date
Bill Currie f0fab885d4 [ui] Get canvas into a usable state
Canvas_SortComponentPool now takes the raw canvas component id as it is
specialized to the canvas subpools.

Canvas_SetLen resizes the root view and then updates the hierarchy for
every canvas in the system.

Canvas_InitSys sets up the component system with the systems it needs
(canvas, view, text). This is required to ensure view_href is just past
the canvas components as it is needed for retrieving the actual canvas
component (and thus sub-pool range ids) from arbitrary views in the
canvas.

Entities are fetched with the correct offset from the pool entities.
2023-01-21 03:26:02 +09:00
Bill Currie 32cead5f88 [ui] Add a function to create a new canvas entity
The entity has only a canvas component and (root) view component
attached. The plan is to use it for screen-space canvases.
2023-01-20 15:57:29 +09:00
Bill Currie 4e1ddaa964 [renderer] Add fitted pic rendering
The pic is scaled to fill the specified rect (then clipped to the
screen (effectively)). Done just for the console background for now, but
it will be used for slice-pics as well.

Not implemented for vulkan yet as I'm still thinking about the
descriptor management needed for the instanced rendering.

Making the conback rendering conditional gave an approximately 3% speed
boost to glsl with the GL stub (~12200fps to ~12550fps), for either
conback render method.
2023-01-17 11:33:47 +09:00
Bill Currie 8833518826 [ecs] Support sorting subpools
Sorting the whole pool when subpools are in use could break the
subpools (very high probability, depending on the sort criteria and
subpool criteria).
2023-01-16 11:32:12 +09:00
Bill Currie b5912bba9b [ui] Clean up the canvas component
It turns out only the range ids are needed in the canvas component at
this stage, and moving the canvas system base into canvas_system_t makes
sense.
2022-12-21 01:54:10 +09:00
Bill Currie 6decbd18c4 [ui] Add a canvas system
This is the beginning of supporting 2d rendering in 3d space. The idea
is that a canvas can be in 2d orthographic space (not attached to any
entity with a 3d transform), or in 3d perspective space (attached to an
entity with a 3d transform, either as a child of the camera, or of some
object in 3d space).

It will replace the current HUD code when it's working.
2022-12-20 19:45:48 +09:00