58 uint16_t
scaleX = glm::packHalf1x16( 1.0f );
59 uint16_t
scaleY = glm::packHalf1x16( 1.0f );
61 float params[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
75 depth = glm::packHalf1x16( aNormalized );
78 void SetColor( uint8_t aR, uint8_t aG, uint8_t aB, uint8_t aA = 255 )
80 r = aR;
g = aG;
b = aB;
a = aA;
85 if( aIndex >= 0 && aIndex < 4 )
94static_assert(
sizeof(
RHI_INSTANCE ) == 40,
"RHI_INSTANCE must be exactly 40 bytes" );
95static_assert(
alignof(
RHI_INSTANCE ) <= 4,
"RHI_INSTANCE must not require more than 4-byte alignment" );
RHI_INSTANCE_FLAG
Instance flags controlling how the shaders draw an element.
@ RHI_INSTANCE_FADE_SMALL
text stroke that fades as its glyph height (param 2) shrinks
@ RHI_INSTANCE_BITMAP_GLYPH
a track that draws the bitmap font glyph named by param 2
@ RHI_INSTANCE_OVERLAY_ALPHA
premultiplied with alpha squared, as the OpenGL overlay leaves it
@ RHI_INSTANCE_LENGTH_PAD
a track longer at each end by param 2 pixels
@ RHI_INSTANCE_PIXEL_CIRCLE
a circle on whole pixels, as the OpenGL canvas draws it
@ RHI_INSTANCE_UNDIMMED
keeps its colour when its layer is dimmed
@ RHI_INSTANCE_GROW_OUTWARD
a PIXEL_CIRCLE stroke grows outward from its inner edge
@ RHI_INSTANCE_SCREEN_SPACE
@ RHI_INSTANCE_SCALE_LOD
a track shown only while the view scale is above param 3
@ RHI_INSTANCE_HARD_EDGE
no antialiased edge, for layers that take a pixel once
RHI_VERTEX_BUFFER_LAYOUT_DESC RhiInstanceLayout()
Per-instance vertex layout of RHI_INSTANCE, starting at location 3 after the RHI_VERTEX attributes.
Per-instance data for instanced 2D rendering, packed into 40 bytes.
void SetDepth(float aNormalized)
void SetFlag(RHI_INSTANCE_FLAG aFlag)
bool HasFlag(RHI_INSTANCE_FLAG aFlag) const
uint16_t pixelPad
extra stroke width in sixteenths of a pixel
void SetColor(uint8_t aR, uint8_t aG, uint8_t aB, uint8_t aA=255)
void SetParam(int aIndex, float aValue)
void ClearFlag(RHI_INSTANCE_FLAG aFlag)
void SetRotation(float aRadians)
void SetPosition(float aX, float aY)
RHI_VERTEX_STEP_MODE stepMode
std::vector< RHI_VERTEX_ATTRIBUTE_DESC > attributes