static class Graphics

robot_2Generated
code_blocksInput

Description

The Graphics class in the Sandbox namespace is a static class used for rendering operations. It provides a variety of methods and properties to interact with the graphics hardware, allowing you to render scenes, manage textures, and perform other graphical operations. This class is essential for developers looking to create visually rich applications in s&box.

Members

Static Properties

Member NameSummary
IsActiveIf true, rendering is currently active, and the class's contents can be safely used.
LayerTypeIndicates the current layer type, useful for determining if drawing should be opaque, transparent, or shadowed.
ViewportSpecifies the pixel size of the rendering target.
AttributesAccesses the current render context's attributes, used in materials/shaders.
CameraPositionReturns the camera position of the currently rendering view.
RenderTargetGets or sets the current render target, adjusting the viewport accordingly.

Static Methods

Member NameSummary
SetupLightingConfigures lighting for a scene object with specified render attributes.
GrabFrameTextureRetrieves a frame texture with specified attributes and mipmap settings.
GrabDepthTextureRetrieves a depth texture with specified attributes and mipmap settings.
ClearClears the current render target with specified color and depth settings.
RenderToTextureRenders a scene camera's view to a specified texture.
CopyTextureCopies data from one texture to another, with optional mip and array slice specifications.
DrawDraws vertices or indexed vertices using specified materials and attributes.
BlitPerforms a blit operation using a specified material and render attributes.
RenderRenders a scene object with optional transform, color, and material settings.
DrawQuadDraws a quad with specified material and color attributes.
DrawTextRenders text at a specified position with font and color settings.
MeasureTextMeasures the size of text when rendered with specified font settings.
DrawIconDraws an icon within a specified rectangle with color and alignment settings.
DrawRoundedRectangleDraws a rounded rectangle with specified color, corner radius, and border settings.
DrawModelDraws a model with specified transform and render attributes.
DrawModelInstancedDraws multiple instances of a model using specified transforms or count.
DrawModelInstancedIndirectDraws model instances using indirect buffer data.
GenerateMipMapsGenerates mipmaps for a texture using a specified downsample method.
ResourceBarrierTransitionTransitions a resource's state for a texture or buffer.