IGraphicsComponent

Description

interface Tinman.Engine.Rendering.IGraphicsComponent

Base interface for user interface components that interact with an Graphics context.

The order method calls on a IGraphicsComponent is this:

  1. GraphicsAttach

  2. GraphicsResize
    The first call is made right after attach. Each time the screen size changes, the method is called again once.

  3. GraphicsResolution
    The first call is made right after attach. Each time the screen DPI resolution changes, the method is called again once.

  4. GraphicsDetach

Public / Methods

Graphics​Attach


public method GraphicsAttach → (1)

graphics in : Graphics

[not-null]
The graphics context.

Attaches this component to the given Graphics context.

All graphics-related resources should be created here.

Do not use the screen size of graphics in here, as it may not be valid (see IGraphicsContext.Graphics for details). Instead, use the screen size that is provided by GraphicsResize.

RenderException

If a graphics subsystem error has occurred.

Graphics​Detach


public method GraphicsDetach → ()

Detaches this user interface component from its Graphics context.

All graphics-related resources should be disposed here.

Graphics​Resize


public method GraphicsResize → (1)

screenSize in : Vec2I

The new screen size, in pixels.

The screen size has changed.

Graphics​Resolution


public method GraphicsResolution → (1)

resolution in : int32

The new screen resolution, in DPI.

The screen resolution has changed.