Namespace: dmGraphics
Language: C++
Type: Defold C++
File: graphics.h
Source: engine/graphics/src/dmsdk/graphics/graphics.h
Include: dmsdk/graphics/graphics.h
Graphics API
Type: ENUM Graphics adapter family. Identifies the type of graphics backend used by the rendering system
Members
ADAPTER_FAMILY_NONE - <div class="codehilite"><pre> No adapter detected. Used as an error state or uninitialized value
</pre></div>ADAPTER_FAMILY_NULL - <div class="codehilite"><pre> Null (dummy) backend. Used for headless operation, testing, or environments where rendering output is not required
</pre></div>ADAPTER_FAMILY_OPENGL - OpenGL desktop backend. Common on Windows, macOS and Linux systemsADAPTER_FAMILY_OPENGLES - OpenGL ES backend. Primarily used on mobile devices (Android, iOS), as well as WebGL (browser)ADAPTER_FAMILY_VULKAN - Vulkan backend. Cross-platform modern graphics API with explicit control over GPU resources and multithreadingADAPTER_FAMILY_VENDOR - Vendor-specific backend. A placeholder for proprietary or experimental APIs tied to a particular GPU vendor.ADAPTER_FAMILY_WEBGPU - WebGPU backend. Modern web graphics API designed as the successor to WebGLADAPTER_FAMILY_DIRECTX - DirectX backend. Microsoft’s graphics API used on Windows and XboxADAPTER_FAMILY_METAL - <div class="codehilite"><pre>Metal backend. Apples graphics API used on OSX and iOS
</pre></div>Type: FUNCTION Adds a stream to a vertex stream declaration
Parameters
name (const char*) - the name of the streamsize (uint32_t) - the size of the stream, i.e number of componentstype (dmGraphics::Type) - the data type of the streamnormalize (bool) - true if the stream should be normalized in the 0..1 rangeType: FUNCTION Adds a stream to a vertex stream declaration
Parameters
name_hash (dmhash_t) - the name hash of the streamsize (uint32_t) - the size of the stream, i.e number of componentstype (dmGraphics::Type) - the data type of the streamnormalize (bool) - true if the stream should be normalized in the 0..1 rangeType: ENUM Defines how an attachment should be treated at the start and end of a render pass
Members
ATTACHMENT_OP_DONT_CARE - Ignore existing content, no guarantees about the resultATTACHMENT_OP_LOAD - <div class="codehilite"><pre> Preserve the existing contents of the attachment
</pre></div>ATTACHMENT_OP_STORE - <div class="codehilite"><pre>Store the attachment’s results after the pass finishes
</pre></div>ATTACHMENT_OP_CLEAR - <div class="codehilite"><pre>Clear the attachment to a predefined value at the beginning of the pass
</pre></div>Type: FUNCTION Begins frame rendering. Prepares the graphics context for rendering a new frame. This should be called at the start of each frame.
Parameters
context (dmGraphics::HContext) - Graphics contextType: ENUM Blend equation operations. Determines how source and destination colors are combined during blending
Members
BLEND_EQUATION_ADD - <div class="codehilite"><pre> Source + Destination
</pre></div>BLEND_EQUATION_SUBTRACT - <div class="codehilite"><pre> Source - Destination
</pre></div>BLEND_EQUATION_REVERSE_SUBTRACT - Destination - SourceBLEND_EQUATION_MIN - <div class="codehilite"><pre> Min(Source, Destination)
</pre></div>BLEND_EQUATION_MAX - <div class="codehilite"><pre> Max(Source, Destination)
</pre></div>Type: ENUM Blend factors for color blending. Defines how source and destination colors are combined
Members
BLEND_FACTOR_ZERO - <div class="codehilite"><pre> Always use 0.0
</pre></div>BLEND_FACTOR_ONE - <div class="codehilite"><pre> Always use 1.0
</pre></div>BLEND_FACTOR_SRC_COLOR - <div class="codehilite"><pre> Use source color
</pre></div>BLEND_FACTOR_ONE_MINUS_SRC_COLOR - <div class="codehilite"><pre> Use (1 - source color)
</pre></div>BLEND_FACTOR_DST_COLOR - <div class="codehilite"><pre> Use destination color
</pre></div>BLEND_FACTOR_ONE_MINUS_DST_COLOR - <div class="codehilite"><pre> Use (1 - destination color)
</pre></div>BLEND_FACTOR_SRC_ALPHA - <div class="codehilite"><pre> Use source alpha
</pre></div>BLEND_FACTOR_ONE_MINUS_SRC_ALPHA - <div class="codehilite"><pre> Use (1 - source alpha)
</pre></div>BLEND_FACTOR_DST_ALPHA - <div class="codehilite"><pre> Use destination alpha
</pre></div>BLEND_FACTOR_ONE_MINUS_DST_ALPHA - <div class="codehilite"><pre> Use (1 - destination alpha)
</pre></div>BLEND_FACTOR_SRC_ALPHA_SATURATE - <div class="codehilite"><pre> Use min(srcAlpha, 1 - dstAlpha)
</pre></div>BLEND_FACTOR_CONSTANT_COLORBLEND_FACTOR_ONE_MINUS_CONSTANT_COLORBLEND_FACTOR_CONSTANT_ALPHABLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHAType: ENUM
Members
BUFFER_ACCESS_READ_ONLYBUFFER_ACCESS_WRITE_ONLYBUFFER_ACCESS_READ_WRITEType: ENUM Buffer usage hints. Indicates how often the data in a buffer will be updated. Helps the driver optimize memory placement
Members
BUFFER_USAGE_STREAM_DRAW - <div class="codehilite"><pre>Updated every frame, used once (e.g. dynamic geometry)
</pre></div>BUFFER_USAGE_DYNAMIC_DRAW - Updated occasionally, used many timesBUFFER_USAGE_STATIC_DRAW - <div class="codehilite"><pre>Set once, used many times (e.g. meshes, textures). Preferred for buffers that never change
</pre></div>Type: FUNCTION Clears the render target buffers. Fills the specified buffers with predefined values. Commonly used at the beginning of a frame to clear the screen to a specific color and depth.
Parameters
context (dmGraphics::HContext) - Graphics contextflags (uint32t) - Bitmask specifying which buffers to clear (BUFFER_TYPE*)red (uint8_t) - Red component value (0-255)green (uint8_t) - Green component value (0-255)blue (uint8_t) - Blue component value (0-255)alpha (uint8_t) - Alpha component value (0-255)depth (float) - Depth value to clear depth buffer tostencil (uint32_t) - Stencil value to clear stencil buffer toType: FUNCTION Closes the window associated with the graphics context. If a window is open, this will close it and clean up associated resources.
Parameters
context (dmGraphics::HContext) - Graphics contextType: ENUM Depth and alpha test comparison functions. Defines how incoming values are compared against stored ones
Members
COMPARE_FUNC_NEVER - <div class="codehilite"><pre> Never passes.
</pre></div>COMPARE_FUNC_LESS - <div class="codehilite"><pre> Passes if incoming < stored
</pre></div>COMPARE_FUNC_LEQUAL - <div class="codehilite"><pre> Passes if incoming <= stored
</pre></div>COMPARE_FUNC_GREATER - <div class="codehilite"><pre> Passes if incoming > stored
</pre></div>COMPARE_FUNC_GEQUAL - <div class="codehilite"><pre> Passes if incoming >= stored
</pre></div>COMPARE_FUNC_EQUAL - <div class="codehilite"><pre> Passes if incoming == stored
</pre></div>COMPARE_FUNC_NOTEQUAL - <div class="codehilite"><pre>Passes if incoming != stored
</pre></div>COMPARE_FUNC_ALWAYS - <div class="codehilite"><pre> Always passes (ignores stored values)
</pre></div>Type: STRUCT Graphics context creation parameters. Defines the configuration for creating a new graphics context. This structure is used when initializing the graphics system and specifies window association, job system context, texture filtering defaults, resolution, memory limits, and various debugging/validation options.
Members
m_Window (dmPlatform::HWindow) - Platform window handle to associate with the graphics contextm_JobContext (dmJobSystem::HJobContext) - Job system context for asynchronous operationsm_DefaultTextureMinFilter (dmGraphics::TextureFilter) - Default minification filter for texturesm_DefaultTextureMagFilter (dmGraphics::TextureFilter) - Default magnification filter for texturesm_Width (uint32_t) - Initial width of the rendering surfacem_Height (uint32_t) - Initial height of the rendering surfacem_GraphicsMemorySize (uint32_t) - Maximum allowed graphics memory in bytes (0 for default/unlimited) (Switch)m_SwapInterval (uint32_t) - Vertical synchronization interval (1 for 60Hz, 2 for 30Hz, etc.) (Default = 1)m_GraphicsApiVersionMajorHint (uint16_t) - Requested graphics API major version hint. A value of 0 lets the platform use its default.m_GraphicsApiVersionMinorHint (uint16_t) - Requested graphics API minor version hint.m_VerifyGraphicsCalls (bool) - Enable API call verification for debuggingm_PrintDeviceInfo (bool) - Print graphics device information at startupm_UseValidationLayers (bool) - Enable validation layers for debugging (Vulkan/DirectX 12 only)Type: FUNCTION Destroys a graphics context. Cleans up all resources associated with the graphics context. The context becomes invalid after this call.
Parameters
context (dmGraphics::HContext) - Graphics context to destroyType: FUNCTION Delete the index buffer
Parameters
buffer (dmGraphics::HIndexBuffer) - the index bufferType: FUNCTION Destroys a shader program and frees associated resources. Cleans up GPU memory and resources associated with the program handle. The handle becomes invalid after this call.
Parameters
context (dmGraphics::HContext) - Graphics contextprogram (dmGraphics::HProgram) - Program handle to destroyType: FUNCTION
Parameters
context (dmGraphics::HContext) - Graphics contextrender_target (dmGraphics::HRenderTarget)Type: FUNCTION Delete texture
Parameters
context (dmGraphics::HContext) - Graphics contexttexture (dmGraphics::HTexture) - Texture handleType: FUNCTION Delete vertex buffer
Parameters
buffer (dmGraphics::HVertexBuffer) - the bufferType: FUNCTION Delete vertex declaration
Parameters
vertex_declaration (dmGraphics::HVertexDeclaration) - the vertex declarationType: FUNCTION Delete vertex stream declaration
Parameters
stream_declaration (dmGraphics::HVertexStreamDeclaration) - the vertex stream declarationType: FUNCTION Deactivates the currently bound shader program. Unbinds any active program from the graphics pipeline, returning to the default state where no custom shader program is active.
Parameters
context (dmGraphics::HContext) - Graphics contextType: FUNCTION
Parameters
context (dmGraphics::HContext) - Graphics contextstate (dmGraphics::State) - Render stateType: FUNCTION Disable a texture bound to a texture unit. Unbinds the given texture handle from the specified unit, releasing the association in the graphics pipeline. This is useful to prevent unintended reuse of textures, or to free up texture units for other bindings.
Parameters
context (dmGraphics::HContext) - Graphics contextunit (uint32_t) - Texture unit index to disable. Must match the one previously used in dmGraphics::EnableTexturetexture (dmGraphics::HTexture) - Handle to the texture object to disableType: FUNCTION Unbinds a vertex buffer from the graphics pipeline. Removes the association between a vertex buffer and its binding index, freeing up the binding slot for other buffers.
Parameters
context (dmGraphics::HContext) - Graphics contextvertex_buffer (dmGraphics::HVertexBuffer) - Vertex buffer handle to unbindType: FUNCTION Unbinds a vertex declaration from the graphics pipeline. Removes the association between a vertex declaration and its binding index, freeing up the binding slot for other declarations.
Parameters
context (dmGraphics::HContext) - Graphics contextvertex_declaration (dmGraphics::HVertexDeclaration) - Vertex declaration handle to unbindType: FUNCTION Draws non-indexed primitives. Renders geometry using vertex data directly from the bound vertex buffers without index buffer indirection. The vertices are processed sequentially from the specified starting point.
Parameters
context (dmGraphics::HContext) - Graphics contextprim_type (dmGraphics::PrimitiveType) - Type of primitives to drawfirst (uint32_t) - Index of the first vertex to drawcount (uint32_t) - Number of vertices to drawinstance_count (uint32_t) - Number of instances to draw (for instanced rendering)Type: FUNCTION Draws indexed primitives. Renders geometry using indices from the supplied index buffer. The first argument is a byte offset into the index buffer.
Parameters
context (dmGraphics::HContext) - Graphics contextprim_type (dmGraphics::PrimitiveType) - Type of primitives to drawfirst (uint32_t) - Byte offset of the first index to drawcount (uint32_t) - Number of indices to drawtype (dmGraphics::Type) - Index element typeindex_buffer (dmGraphics::HIndexBuffer) - Index buffer handleinstance_count (uint32_t) - Number of instances to draw (for instanced rendering)Type: FUNCTION Activates a shader program for rendering. Binds the specified program to the graphics pipeline, making it the active program for all subsequent rendering operations until another program is activated or disabled.
Parameters
context (dmGraphics::HContext) - Graphics contextprogram (dmGraphics::HProgram) - Program handle to activateType: FUNCTION
Parameters
context (dmGraphics::HContext) - Graphics contextstate (dmGraphics::State) - Render stateType: FUNCTION Enable and bind a texture to a texture unit. Associates a texture object with a specific texture unit in the graphics context, making it available for sampling in shaders. Multiple textures can be active simultaneously by binding them to different units. The shader must reference the correct unit (via sampler uniform) to access the bound texture
Parameters
context (dmGraphics::HContext) - Graphics contextunit (uint32_t) - Texture unit index to bind the texture to. Valid range depends on GPU capabilities (commonly 0–15 for at least 16 texture units)id_index (uint8_t) - Index for internal tracking or binding variation. Typically used when multiple texture IDs are managed within the same unit (e.g. array textures or multi-bind)texture (dmGraphics::HTexture) - Handle to the texture object to enable and bindType: FUNCTION Binds a vertex buffer for rendering. Associates a vertex buffer with a specific binding index in the graphics pipeline. The buffer provides the actual vertex data that will be processed according to the active vertex declaration for that binding index.
Parameters
context (dmGraphics::HContext) - Graphics contextvertex_buffer (dmGraphics::HVertexBuffer) - Vertex buffer handlebinding_index (uint32_t) - Binding index to associate with this bufferType: FUNCTION Binds a vertex declaration for rendering. Associates a vertex declaration with a specific binding index in the graphics pipeline. The declaration defines how vertex data is interpreted and laid out in memory.
Parameters
context (dmGraphics::HContext) - Graphics contextvertex_declaration (dmGraphics::HVertexDeclaration) - Vertex declaration handlebinding_index (uint32_t) - Binding index to associate with this declarationbase_offset (uint32_t) - Byte offset to add to all vertex attribute pointersprogram (dmGraphics::HProgram) - Shader program to use with this declarationType: ENUM
Members
FACE_WINDING_CCWFACE_WINDING_CWType: FUNCTION Finalizes the graphics system. Cleans up global graphics resources and shuts down the graphics system. This should be called when the application is exiting.
Type: FUNCTION Finds the location of a uniform variable in a shader program by name hash. Returns the uniform location that can be used with other uniform-setting functions. This is the preferred method when the uniform name is known at compile time as it avoids runtime string hashing.
Parameters
program (dmGraphics::HProgram) - Shader program handlename_hash (dmhash_t) - Hash of the uniform variable nameReturns
location (dmGraphics::HUniformLocation) - Uniform location handle, or INVALID_UNIFORM_LOCATION if not foundType: FUNCTION Finds the location of a uniform variable in a shader program by name string. Returns the uniform location that can be used with other uniform-setting functions. This method is useful when the uniform name is only known at runtime.
Parameters
program (dmGraphics::HProgram) - Shader program handlename (const char*) - Name of the uniform variableReturns
location (dmGraphics::HUniformLocation) - Uniform location handle, or INVALID_UNIFORM_LOCATION if not foundType: FUNCTION Flips screen buffers. Presents the rendered frame to the display. This should be called at the end of each frame after all rendering is complete.
Parameters
context (dmGraphics::HContext) - Graphics contextType: FUNCTION Gets the adapter family from a string name. Converts a string identifier to the corresponding AdapterFamily enum value.
Parameters
adapter_name (const char*) - String name of the adapter (e.g., “opengl”, “vulkan”)Returns
family (dmGraphics::AdapterFamily) - Corresponding adapter family enum valueType: FUNCTION Get the scale factor of the display. The display scale factor is usally 1.0 but will for instance be 2.0 on a macOS Retina display.
Parameters
context (dmGraphics::HContext) - Graphics contextReturns
scale_factor (float) - Display scale factorType: FUNCTION Returns the specified height of the opened window, which might differ from the actual window width.
Parameters
context (dmGraphics::HContext) - Graphics contextReturns
height (uint32_t) - Specified height of the window. If no window is opened, 0 is always returned.Type: FUNCTION Get installed graphics adapter family
Returns
family (dmGraphics::AdapterFamily) - Installed adapter familyType: FUNCTION
Returns
context (dmGraphics::HContext) - Installed graphics contextType: FUNCTION Get the max number of indices allowed by the system in an index buffer
Parameters
context (dmGraphics::HContext) - the contextReturns
count (uint32_t) - the countType: FUNCTION Get the max number of vertices allowed by the system in a vertex buffer
Parameters
context (dmGraphics::HContext) - the contextReturns
count (uint32_t) - the countType: FUNCTION Get maximum supported size in pixels of non-array texture
Parameters
context (dmGraphics::HContext) - Graphics contextReturns
max_texture_size (uint32_t) - Maximum texture size supported by GPUType: FUNCTION
Parameters
context (dmGraphics::HContext) - the contextReturns
count (uint32_t) - the number of supported extensionsType: FUNCTION Get how many platform-dependent texture handle used for engine texture handle. Applicable only for OpenGL/ES backend. All other backends return 1.
Parameters
context (dmGraphics::Context) - Graphics contexttexture (dmGraphics::HTexture) - Texture handleReturns
handles_amount (uint8_t) - Platform-dependent handles amountType: FUNCTION Get texture original (before uploading to GPU) height
Parameters
context (dmGraphics::HContext) - Graphics contexttexture (dmGraphics::HTexture) - Texture handleReturns
original_height (uint16_t)Type: FUNCTION Get texture original (before uploading to GPU) width
Parameters
context (dmGraphics::HContext) - Graphics contexttexture (dmGraphics::HTexture) - Texture handleReturns
original_width (uin16_t) - Texture’s original widthType: FUNCTION
Parameters
context (dmGraphics::HContext) - Graphics contextReturns
pipeline_state (dmGraphics::PipelineState)Type: FUNCTION Get the attachment texture from a render target. Returns zero if no such attachment texture exists.
Parameters
context (dmGraphics::HContext) - Graphics contextrender_target (dmGraphics::HRenderTarget) - the render targetattachment_type (dmGraphics::RenderTargetAttachment) - the attachment to getReturns
attachment (dmGraphics::HTexture) - the attachment textureType: FUNCTION
Parameters
context (dmGraphics::HContext) - Graphics contextrender_target (dmGraphics::HRenderTarget)Returns
sample_count (uint32_t) - the effective, adapter-conformed sample countType: FUNCTION
Parameters
context (dmGraphics::HContext) - Graphics contextrender_target (dmGraphics::HRenderTarget)buffer_type (dmGraphics::BufferType)width (uint32_t&)height (uint32_t&)Type: FUNCTION
Parameters
context (dmGraphics::HContext) - Graphics contextrender_target (dmGraphics::HRenderTarget)buffer_type (dmGraphics::BufferType)Returns
render_target_texture (dmGraphics::HTexture)Type: FUNCTION get the supported extension
Parameters
context (dmGraphics::HContext) - the contextindex (uint32_t) - the index of the extensionReturns
extension (const char*) - the extension. 0 if index was out of boundsType: FUNCTION Get texture depth. applicable for 3D and cube map textures
Parameters
context (dmGraphics::HContext) - Graphics contexttexture (dmGraphics::HTexture) - Texture handleReturns
depth (uint16_t) - Texture’s depthType: FUNCTION Get string representation of texture format
Parameters
format (dmGraphics::TextureFormat) - Texture formatReturns
literal_format (const char*) - String representation of formatType: FUNCTION Get the native graphics API texture object from an engine texture handle. This depends on the graphics backend and is not guaranteed to be implemented on the currently running adapter.
Parameters
texture (dmGraphics::HTexture) - the texture handleout_handle (void**) - a pointer to where the raw object should be storedReturns
handle_result (dmGraphics::HandleResult) - the result of the queryType: FUNCTION Get texture height
Parameters
context (dmGraphics::HContext) - Graphics contexttexture (dmGraphics::HTexture) - Texture handleReturns
height (uint16_t) - Texture’s heightType: FUNCTION Get texture mipmap count
Parameters
context (dmGraphice::HContext) - Graphics contexttexture (dmGraphics::HTexture) - Texture handleReturns
count (uint8_t) - Texture mipmap countType: FUNCTION Get approximate size of how much memory texture consumes
Parameters
context (dmGraphics::HContext) - Graphics contexttexture (dmGraphics::HTexture) - Texture handleReturns
data_size (uint32_t) - Resource data size in bytesType: FUNCTION Get status of texture
Parameters
context (dmGraphics::HContext) - Graphics contexttexture (dmGraphics::HTexture) - Texture handleReturns
flags (dmGraphics::TextureStatusFlags) - Enumerated status bit flagsType: FUNCTION Get texture type
Parameters
context (dmGraphics::HContext) - Graphics contexttexture (dmGraphics::HTexture) - Texture handleReturns
type (dmGraphics::TextureType) - Texture typeType: FUNCTION Get string representation of texture type
Parameters
texture_type (dmGraphics::TextureType) - Texture typeReturns
literal_type (const char*) - String representation of typeType: FUNCTION Query usage hint flags for a texture. Retrieves the bitwise usage flags that were assigned to a texture when it was created. These flags indicate the intended role(s) of the texture in the rendering pipeline and allow the graphics backend to apply optimizations or enforce restrictions
Parameters
context (dmGraphics::HContext) - Graphics contexttexture (dmGraphics::HTexture) - Texture handleReturns
flags (uint32_t) - A bitwise OR of usage flags describing how the texture may be used. Applications can test specific flags using bitmask operationsType: FUNCTION Get texture width
Parameters
context (dmGraphics::HContext) - Graphics contexttexture (dmGraphics::HTexture) - Texture handleReturns
width (uint16_t) - Texture’s widthType: FUNCTION Get the physical offset into the vertex data for a particular stream
Parameters
vertex_declaration (dmGraphics::HVertexDeclaration) - the vertex declarationname_hash (dmhash_t) - the name hash of the vertex stream (as passed into AddVertexStream())Returns
Offset - in bytes into the vertex or INVALID_STREAM_OFFSET if not foundType: FUNCTION Get viewport’s parameters
Parameters
context (dmGraphics::HContext) - the contextx (int32_t) - x-coordinate of the viewport’s originy (int32_t) - y-coordinate of the viewport’s originwidth (uint32_t) - viewport’s widthheight (uint32_t) - viewport’s heightType: FUNCTION Returns the specified width of the opened window, which might differ from the actual window width.
Parameters
context (dmGraphics::HContext) - Graphics contextReturns
width (uint32_t) - Specified width of the window. If no window is opened, 0 is always returned.Type: FUNCTION Return the height of the opened window, if any.
Parameters
context (dmGraphics::HContext) - Graphics contextReturns
window_height (uint32_t) - Height of the window. If no window is opened, 0 is always returnedType: FUNCTION Return the width of the opened window, if any.
Parameters
context (dmGraphics::HContext) - Graphics contextReturns
window_width (uint32_t) - Width of the window. If no window is opened, 0 is always returnedType: CONSTANT Name used when registering the graphics context with the engine context registry.
Type: ENUM Function’s call result code
Members
HANDLE_RESULT_OK - <div class="codehilite"><pre> The function's call succeeded and returned a valid result
</pre></div>HANDLE_RESULT_NOT_AVAILABLE - The function is not supported by the current graphics backendHANDLE_RESULT_ERROR - <div class="codehilite"><pre> An error occurred while function call
</pre></div>Type: TYPEDEF Context handle
Type: TYPEDEF Index buffer handle
Type: TYPEDEF Program handle
Type: TYPEDEF Rendertarget handle
Type: TYPEDEF Storage buffer handle
Type: TYPEDEF Texture handle
Type: TYPEDEF Uniform location handle
Type: TYPEDEF Vertex buffer handle
Type: TYPEDEF Vertex declaration handle
Type: TYPEDEF Vertex stream declaration handle
Type: ENUM Index buffer element types. Defines the integer size used for vertex indices
Members
INDEXBUFFER_FORMAT_16 - 16-bit unsigned integers (max 65535 vertices)INDEXBUFFER_FORMAT_32 - 32-bit unsigned integers (supports larger meshes)Type: FUNCTION Installs a graphics adapter. Initializes the specified graphics backend (OpenGL, Vulkan, etc.). This must be called before creating any graphics context.
Parameters
family (dmGraphics::AdapterFamily) - Graphics adapter family to installReturns
success (bool) - True if the adapter was successfully installed, false otherwiseType: CONSTANT Invalid program handle constant. Used to represent an uninitialized or invalid program handle. Can be used to check if program creation or loading failed.
Type: CONSTANT Invalid stream offset
Type: CONSTANT Invalid uniform location constant. Used to represent an uninitialized or invalid uniform location. Can be used to check if uniform location lookup failed.
Type: FUNCTION check if an extension is supported
Parameters
context (dmGraphics::HContext) - the contextextension (const char*) - the extension.Returns
result (bool) - true if the extension was supportedType: FUNCTION Check if the index format is supported
Parameters
context (dmGraphics::HContext) - the contextformat (dmGraphics::IndexBufferFormat) - the formatresult (bool) - true if the format is supoprtedType: FUNCTION check if a specific texture format is supported
Parameters
context (dmGraphics::HContext) - the contextformat (dmGraphics::TextureFormat) - the texture format.Returns
result (bool) - true if the texture format was supportedType: CONSTANT Max buffer color attachments
Type: FUNCTION Creates a new graphics context. Initializes the graphics system with the specified parameters. Only one graphics context can be active at a time.
Parameters
params (const dmGraphics::ContextParams&) - Context creation parametersReturns
context (dmGraphics::HContext) - New graphics context handle, or null on failureType: FUNCTION Create new index buffer with initial data
Notes
Parameters
context (dmGraphics::HContext) - the contextsize (uint32_t) - the size of the buffer (in bytes). May be 0data (void*) - the databuffer_usage (dmGraphics::BufferUsage) - the usageReturns
buffer (dmGraphics::HIndexBuffer) - the index bufferType: FUNCTION Creates a new shader program from a shader description. Compiles and links shader sources defined in the ShaderDesc into a GPU program. Returns a program handle that can be used for rendering.
Parameters
context (dmGraphics::HContext) - Graphics contextddf (dmGraphics::ShaderDesc*) - Shader description containing source code and parameterserror_buffer (char*) - Buffer to receive error messages (can be null)error_buffer_size (uint32_t) - Size of the error bufferReturns
program (dmGraphics::HProgram) - New program handle, or INVALID_PROGRAM_HANDLE on failureType: FUNCTION
Parameters
context (dmGraphics::HContext) - Graphics contextbuffer_type_flags (uint32_t)params (dmGraphics::const RenderTargetCreationParams)Returns
render_target (dmGraphics::HRenderTarget) - Newly created render targetType: FUNCTION Create new texture
Parameters
context (HContext) - Graphics contextparams (const dmGraphics::TextureCreationParams&) - Creation parametersReturns
texture_handle (dmGraphics::HTexture) - Opaque texture handleType: FUNCTION Create new vertex buffer with initial data
Parameters
context (dmGraphics::HContext) - the contextsize (uint32_t) - the size of the buffer (in bytes). May be 0data (void*) - the databuffer_usage (dmGraphics::BufferUsage) - the usageReturns
buffer (dmGraphics::HVertexBuffer) - the vertex bufferType: FUNCTION Create new vertex declaration from a vertex stream declaration
Parameters
context (dmGraphics::HContext) - the contextstream_declaration (dmGraphics::HVertexStreamDeclaration) - the vertex stream declarationReturns
declaration (dmGraphics::HVertexDeclaration) - the vertex declarationType: FUNCTION Create new vertex declaration from a vertex stream declaration and an explicit stride value, where the stride is the number of bytes between each consecutive vertex in a vertex buffer
Parameters
context (dmGraphics::HContext) - the contextstream_declaration (dmGraphics::HVertexStreamDeclaration) - the vertex stream declarationstride (uint32_t) - the stride between the start of each vertex (in bytes)Returns
declaration (dmGraphics::HVertexDeclaration) - the vertex declarationType: FUNCTION Create new vertex stream declaration. A stream declaration contains a list of vertex streams that should be used to create a vertex declaration from.
Parameters
context (dmGraphics::HContext) - the contextReturns
declaration (dmGraphics::HVertexStreamDeclaration) - the vertex declarationType: FUNCTION Create new vertex stream declaration. A stream declaration contains a list of vertex streams that should be used to create a vertex declaration from.
Parameters
context (dmGraphics::HContext) - the contextstep_function (dmGraphics::VertexStepFunction) - the vertex step function to useReturns
declaration (dmGraphics::HVertexStreamDeclaration) - the vertex declarationType: ENUM Primitive drawing modes. Defines how vertex data is assembled into primitives
Members
PRIMITIVE_LINES - <div class="codehilite"><pre> Each pair of vertices forms a line
</pre></div>PRIMITIVE_TRIANGLES - <div class="codehilite"><pre> Each group of 3 vertices forms a triangle
</pre></div>PRIMITIVE_TRIANGLE_STRIP - Connected strip of triangles (shares vertices)Type: FUNCTION Read frame buffer pixels in BGRA format
Parameters
context (dmGraphics::HContext) - the contextx (int32_t) - x-coordinate of the starting positiony (int32_t) - y-coordinate of the starting positionwidth (uint32_t) - width of the regionheight (uint32_t) - height of the regionbuffer (void*) - buffer to read tobuffer_size (uint32_t) - buffer sizeType: ENUM Attachment points for render targets
Members
ATTACHMENT_COLOR - <div class="codehilite"><pre>A color buffer attachment (used for rendering visible output)
</pre></div>ATTACHMENT_DEPTH - <div class="codehilite"><pre>A depth buffer attachment (used for depth testing)
</pre></div>ATTACHMENT_STENCIL - A stencil buffer attachment (used for stencil operations)Type: FUNCTION
Parameters
num_pixels (uint32_t)rgb (uint8_t*)rgba (uint8_t*)Type: FUNCTION Set separate blend equations for color and alpha channels.
Parameters
context (dmGraphics::HContext)equation_color (dmGraphics::BlendEquation)equation_alpha (dmGraphics::BlendEquation)Type: FUNCTION
Parameters
context (dmGraphics::HContext) - Graphics contextsource_factor (gmGraphics::BlendFactor)destination_factor (dmGraphics::BlendFactor)Type: FUNCTION Set separate blend factors for color and alpha channels.
Parameters
context (dmGraphics::HContext)src_factor_color (dmGraphics::BlendFactor)dst_factor_color (dmGraphics::BlendFactor)src_factor_alpha (dmGraphics::BlendFactor)dst_factor_alpha (dmGraphics::BlendFactor)Type: FUNCTION
Parameters
context (dmGraphics::HContext) - Graphics contextred (bool)green (bool)blue (bool)alpha (bool)Type: FUNCTION Sets one or more mat4 uniform values. Updates a shader uniform or uniform-buffer member starting at the supplied uniform location.
Parameters
context (dmGraphics::HContext) - Graphics contextdata (const dmVMath::Matrix4*) - Matrix data to uploadcount (int) - Number of mat4 values to uploadbase_location (dmGraphics::HUniformLocation) - Uniform locationType: FUNCTION Sets one or more vec4 uniform values. Updates a shader uniform or uniform-buffer member starting at the supplied uniform location.
Parameters
context (dmGraphics::HContext) - Graphics contextdata (const dmVMath::Vector4*) - Vector data to uploadcount (int) - Number of vec4 values to uploadbase_location (dmGraphics::HUniformLocation) - Uniform locationType: FUNCTION
Parameters
context (dmGraphics::HContext) - Graphics contextface_type (dmGraphics::FaceType)Type: FUNCTION
Parameters
context (dmGraphics::HContext) - Graphics contextfunc (dmGraphics::CompareFunc)Type: FUNCTION
Parameters
context (dmGraphics::HContext) - Graphics contextenable_mask (bool)Type: FUNCTION Set index buffer data
Parameters
buffer (dmGraphics::HIndexBuffer) - the buffersize (uint32_t) - the size of the buffer (in bytes). May be 0data (void*) - the databuffer_usage (dmGraphics::BufferUsage) - the usageType: FUNCTION Set subset of index buffer data
Parameters
buffer (dmGraphics::HVertexBuffer) - the bufferoffset (uint32_t) - the offset into the desination buffer (in bytes)size (uint32_t) - the size of the buffer (in bytes). May be 0data (void*) - the dataType: FUNCTION
Parameters
context (dmGraphics::HContext) - Graphics contextrender_target (dmGraphics::HRenderTarget)transient_buffer_types (uint32_t)Type: FUNCTION
Parameters
context (dmGraphics::HContext) - Graphics contextrender_target (dmGraphics::HRenderTarget)width (uint32_t)height (uint32_t)Type: FUNCTION Binds a texture sampler to a texture unit. Associates a texture with a specific sampler uniform in the shader, allowing the shader to access the texture data during rendering.
Parameters
context (dmGraphics::HContext) - Graphics contextlocation (dmGraphics::HUniformLocation) - Uniform location of the samplerunit (int32_t) - Texture unit index to bind toType: FUNCTION Sets the scissor rectangle for rendering. Defines the rectangular pixel region that rendering is clipped to when STATE_SCISSOR_TEST is enabled.
Parameters
context (dmGraphics::HContext) - Graphics contextx (int32_t) - X coordinate of the scissor rectangle’s origin (in pixels)y (int32_t) - Y coordinate of the scissor rectangle’s origin (in pixels)width (int32_t) - Width of the scissor rectangle (in pixels)height (int32_t) - Height of the scissor rectangle (in pixels)Type: FUNCTION
Parameters
context (dmGraphics::HContext) - Graphics contextfunc (dmGraphics::CompareFunc)ref (uint32_t)mask (uint32_t)Type: FUNCTION
Parameters
context (dmGraphics::HContext) - Graphics contextface_type (dmGraphics::FaceType)func (dmGraphics::CompareFunc)ref (uint32_t)mask (uint32_t)Type: FUNCTION
Parameters
context (dmGraphics::HContext) - Graphics contextmask (uint32_t)Type: FUNCTION
Parameters
context (dmGraphics::HContext) - Graphics contextsfail (dmGraphics::StencilOp)dpfail (dmGraphics::StencilOp)dppass (dmGraphics::StencilOp)Type: FUNCTION
Parameters
context (dmGraphics::HContext) - Graphics contextface_type (dmGraphics::FaceType)sfail (dmGraphics::StencilOp)dpfail (dmGraphics::StencilOp)dppass (dmGraphics::StencilOp)Type: FUNCTION Set texture data. For textures of type TEXTURE_TYPE_CUBE_MAP it’s assumed that 6 mip-maps are present contiguously in memory with stride m_DataSize
Parameters
context (dmGraphics::HContext) - Graphics contexttexture (dmGraphics::HTexture) - Texture handleparams (const dmGraphics::TextureParams&)Type: FUNCTION Set texture data asynchronously. For textures of type TEXTURE_TYPE_CUBE_MAP it’s assumed that 6 mip-maps are present contiguously in memory with stride m_DataSize
Parameters
context (dmGraphics::HContext) - Graphics contexttexture (dmGraphics::HTexture) - Texture handleparams (const dmGraphics::TextureParams&) - Texture parameters. Texture will be recreated if parameters differ from creation parameterscallback (dmGraphics::SetTextureAsyncCallback) - Completion callbackuser_data (void*) - User data that will be passed to completion callbackType: TYPEDEF Function called when a texture has been set asynchronously
Parameters
texture (dmGraphics::HTexture) - Texture handleuser_data (void*) - User data that will be passed to the SetTextureAsyncCallbackType: FUNCTION Set texture parameters, including the W wrapping mode used by 3D textures.
Parameters
context (dmGraphics::HContext) - Graphics contexttexture (dmGraphics::HTexture) - Texture handlemin_filter (dmGraphics::TextureFilter) - Minification filter typemag_filter (dmGraphics::TextureFilter) - Magnification filter typeuwrap (dmGraphics::TextureWrap) - Wrapping mode for the U (X) texture coordinate.vwrap (dmGraphics::TextureWrap) - Wrapping mode for the V (Y) texture coordinatewwrap (dmGraphics::TextureWrap) - Wrapping mode for the W (Z) texture coordinatemax_anisotropy (float)Type: FUNCTION Set texture parameters using the legacy U/V wrapping interface. The U wrapping mode is also applied to the W texture coordinate.
Parameters
context (dmGraphics::HContext) - Graphics contexttexture (dmGraphics::HTexture) - Texture handlemin_filter (dmGraphics::TextureFilter) - Minification filter typemag_filter (dmGraphics::TextureFilter) - Magnification filter typeuwrap (dmGraphics::TextureWrap) - Wrapping mode for the U (X) and W (Z) texture coordinatesvwrap (dmGraphics::TextureWrap) - Wrapping mode for the V (Y) texture coordinatemax_anisotropy (float)Type: FUNCTION Set vertex buffer data
Parameters
buffer (dmGraphics::HVertexBuffer) - the buffersize (uint32_t) - the size of the buffer (in bytes). May be 0data (void*) - the databuffer_usage (dmGraphics::BufferUsage) - the usageType: FUNCTION Set subset of vertex buffer data
Parameters
buffer (dmGraphics::HVertexBuffer) - the bufferoffset (uint32_t) - the offset into the desination buffer (in bytes)size (uint32_t) - the size of the buffer (in bytes). May be 0data (void*) - the dataType: FUNCTION Sets the viewport for rendering. Defines the affine transformation from normalized device coordinates to window coordinates. This affects all subsequent rendering operations.
Parameters
context (dmGraphics::HContext) - Graphics contextx (int32_t) - X coordinate of the viewport’s origin (in pixels)y (int32_t) - Y coordinate of the viewport’s origin (in pixels)width (int32_t) - Width of the viewport (in pixels)height (int32_t) - Height of the viewport (in pixels)Type: STRUCT Shader program description (from graphics_ddf.h)
Type: ENUM Stencil test actions. Defines what happens to a stencil buffer value depending on the outcome of the stencil/depth test.
Members
STENCIL_OP_KEEP - <div class="codehilite"><pre> Keep the current stencil value
</pre></div>STENCIL_OP_ZERO - <div class="codehilite"><pre> Set stencil value to 0
</pre></div>STENCIL_OP_REPLACE - <div class="codehilite"><pre> Replace stencil value with reference value
</pre></div>STENCIL_OP_INCR - <div class="codehilite"><pre> Increment stencil value (clamps at max)
</pre></div>STENCIL_OP_INCR_WRAP - <div class="codehilite"><pre> Increment stencil value, wrapping around
</pre></div>STENCIL_OP_DECR - <div class="codehilite"><pre> Decrement stencil value (clamps at 0)
</pre></div>STENCIL_OP_DECR_WRAP - <div class="codehilite"><pre> Decrement stencil value, wrapping around
</pre></div>STENCIL_OP_INVERT - <div class="codehilite"><pre> Bitwise invert stencil value
</pre></div>Type: STRUCT Texture creation parameters. Defines how a texture is created, initialized, and used. This structure is typically passed when allocating GPU memory for a new texture. It controls dimensions, format, layering, mipmapping, and intended usage.
Members
m_Type (dmGraphics::TextureType) - Texture type. Defines the dimensionality and interpretation of the texture (2D, 3D, cube map, array)m_Width (uint16_t) - Width of the texture in pixels at the base mip levelm_Height (uint16_t) - Height of the texture in pixels at the base mip levelm_Depth (uint16_t) - Depth of the texture. Used for 3D textures or texture arrays. For standard 2D textures, this is typically 1m_OriginalWidth (uint16_t) - Width of the original source data before scaling or compressionm_OriginalHeight (uint16_t) - Height of the original source data before scaling or compressionm_OriginalDepth (uint16_t) - Depth of the original source datam_LayerCount (uint8_t) - Number of layers in the texture. Used for array textures (TEXTURE_TYPE_2D_ARRAY). For standard 2D textures, this is 1m_MipMapCount (uint8_t) - Number of mipmap levels. A value of 1 means no mipmaps (only the base level is stored). Larger values allow for mipmapped sampling.m_UsageHintBits (uint8_t) - Bitfield of usage hints. Indicates how the texture will be used (e.g. sampling, render target, storage image). See dmGraphics::TextureUsageFlagType: ENUM Texture filtering modes. Controls how texels are sampled when scaling or rotating textures
Members
TEXTURE_FILTER_DEFAULT - <div class="codehilite"><pre> Default texture filtering mode. Depeneds on graphics backend (for example, for OpenGL - TEXTURE_FILTER_LINEAR)
</pre></div>TEXTURE_FILTER_NEAREST - <div class="codehilite"><pre> Nearest-neighbor sampling (blocky look, fastest)
</pre></div>TEXTURE_FILTER_LINEAR - <div class="codehilite"><pre> Linear interpolation between texels (smooth look)
</pre></div>TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST - Nearest mipmap level, nearest texelTEXTURE_FILTER_NEAREST_MIPMAP_LINEAR - <div class="codehilite"><pre>Linear blend between two mipmap levels, nearest texel
</pre></div>TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST - <div class="codehilite"><pre>Nearest mipmap level, linear texel
</pre></div>TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR - <div class="codehilite"><pre> Linear blend between mipmap levels and texels (trilinear)
</pre></div>Type: ENUM Pixel formats supported by textures. Includes uncompressed, compressed, and floating-point variants
Members
TEXTURE_FORMAT_LUMINANCE - <div class="codehilite"><pre> Single-channel grayscale
</pre></div>TEXTURE_FORMAT_LUMINANCE_ALPHA - <div class="codehilite"><pre> Two-channel grayscale + alpha
</pre></div>TEXTURE_FORMAT_RGB - <div class="codehilite"><pre> Standard 24-bit RGB color
</pre></div>TEXTURE_FORMAT_RGBA - <div class="codehilite"><pre> Standard 32-bit RGBA color
</pre></div>TEXTURE_FORMAT_RGB_16BPP - <div class="codehilite"><pre> Packed 16-bit RGB (lower precision, saves memory)
</pre></div>TEXTURE_FORMAT_RGBA_16BPP - <div class="codehilite"><pre> Packed 16-bit RGBA
</pre></div>TEXTURE_FORMAT_DEPTH - <div class="codehilite"><pre> Depth buffer texture (used for depth testing)
</pre></div>TEXTURE_FORMAT_STENCIL - <div class="codehilite"><pre> Stencil buffer texture
</pre></div>TEXTURE_FORMAT_RGB_PVRTC_2BPPV1 - <div class="codehilite"><pre>PVRTC compressed RGB at 2 bits per pixel
</pre></div>TEXTURE_FORMAT_RGB_PVRTC_4BPPV1 - <div class="codehilite"><pre>PVRTC compressed RGB at 4 bits per pixel
</pre></div>TEXTURE_FORMAT_RGBA_PVRTC_2BPPV1 - PVRTC compressed RGBA at 2 bits per pixelTEXTURE_FORMAT_RGBA_PVRTC_4BPPV1 - PVRTC compressed RGBA at 4 bits per pixelTEXTURE_FORMAT_RGB_ETC1 - <div class="codehilite"><pre> ETC1 compressed RGB (no alpha support)
</pre></div>TEXTURE_FORMAT_R_ETC2 - <div class="codehilite"><pre> ETC2 single-channel
</pre></div>TEXTURE_FORMAT_RG_ETC2 - <div class="codehilite"><pre> ETC2 two-channel
</pre></div>TEXTURE_FORMAT_RGBA_ETC2 - <div class="codehilite"><pre> ETC2 four-channel (with alpha)
</pre></div>TEXTURE_FORMAT_RGBA_ASTC_4X4 - <div class="codehilite"><pre> ASTC block-compressed 4×4
</pre></div>TEXTURE_FORMAT_RGB_BC1 - <div class="codehilite"><pre> BC1/DXT1 compressed RGB
</pre></div>TEXTURE_FORMAT_RGBA_BC3 - <div class="codehilite"><pre> BC3/DXT5 compressed RGBA
</pre></div>TEXTURE_FORMAT_R_BC4 - <div class="codehilite"><pre> BC4 single-channel
</pre></div>TEXTURE_FORMAT_RG_BC5 - <div class="codehilite"><pre> BC5 two-channel
</pre></div>TEXTURE_FORMAT_RGBA_BC7 - <div class="codehilite"><pre> BC7 high-quality compressed RGBA
</pre></div>TEXTURE_FORMAT_RGB16F - <div class="codehilite"><pre> Half-precision float RGB
</pre></div>TEXTURE_FORMAT_RGB32F - <div class="codehilite"><pre> Full 32-bit float RGB
</pre></div>TEXTURE_FORMAT_RGBA16F - <div class="codehilite"><pre> Half-precision float RGBA
</pre></div>TEXTURE_FORMAT_RGBA32F - <div class="codehilite"><pre> Full 32-bit float RGBA
</pre></div>TEXTURE_FORMAT_R16F - <div class="codehilite"><pre> Half-precision float single channel
</pre></div>TEXTURE_FORMAT_RG16F - <div class="codehilite"><pre> Half-precision float two channels
</pre></div>TEXTURE_FORMAT_R32F - <div class="codehilite"><pre> Full 32-bit float single channel
</pre></div>TEXTURE_FORMAT_RG32F - <div class="codehilite"><pre> Full 32-bit float two channels
</pre></div>TEXTURE_FORMAT_RGBA32UI - <div class="codehilite"><pre> Internal: 32-bit unsigned integer RGBA (not script-exposed)
</pre></div>TEXTURE_FORMAT_BGRA8U - <div class="codehilite"><pre> Internal: 32-bit BGRA layout
</pre></div>TEXTURE_FORMAT_R32UI - <div class="codehilite"><pre> Internal: 32-bit unsigned integer single channel
</pre></div>TEXTURE_FORMAT_RGBA_ASTC_5X4 - <div class="codehilite"><pre> ASTC 5x4 block compression
</pre></div>TEXTURE_FORMAT_RGBA_ASTC_5X5 - <div class="codehilite"><pre> ASTC 5x5 block compression
</pre></div>TEXTURE_FORMAT_RGBA_ASTC_6X5 - <div class="codehilite"><pre> ASTC 6x5 block compression
</pre></div>TEXTURE_FORMAT_RGBA_ASTC_6X6 - <div class="codehilite"><pre> ASTC 6x6 block compression
</pre></div>TEXTURE_FORMAT_RGBA_ASTC_8X5 - <div class="codehilite"><pre> ASTC 8x5 block compression
</pre></div>TEXTURE_FORMAT_RGBA_ASTC_8X6 - <div class="codehilite"><pre> ASTC 8x6 block compression
</pre></div>TEXTURE_FORMAT_RGBA_ASTC_8X8 - <div class="codehilite"><pre> ASTC 8x8 block compression
</pre></div>TEXTURE_FORMAT_RGBA_ASTC_10X5 - <div class="codehilite"><pre> ASTC 10x5 block compression
</pre></div>TEXTURE_FORMAT_RGBA_ASTC_10X6 - <div class="codehilite"><pre> ASTC 10x6 block compression
</pre></div>TEXTURE_FORMAT_RGBA_ASTC_10X8 - <div class="codehilite"><pre> ASTC 10x8 block compression
</pre></div>TEXTURE_FORMAT_RGBA_ASTC_10X10 - <div class="codehilite"><pre> ASTC 10x10 block compression
</pre></div>TEXTURE_FORMAT_RGBA_ASTC_12X10 - <div class="codehilite"><pre> ASTC 12x10 block compression
</pre></div>TEXTURE_FORMAT_RGBA_ASTC_12X12 - <div class="codehilite"><pre> ASTC 12x12 block compression
</pre></div>Type: STRUCT Texture update parameters. Defines a block of pixel data to be uploaded to a texture, along with filtering, wrapping, and sub-region update options. Typically used when calling texture upload/update functions after a texture object has been created with TextureCreationParams
Members
m_Data (const void*) - Pointer to raw pixel data in CPU memory. The format is defined by m_Formatm_DataSize (uint32_t) - Size of the pixel data in bytes. Must match the expected size from width, height, depth, and formatm_Format (dmGraphics::TextureFormat) - Format of the pixel data (e.g. RGBA, RGB, compressed formats). Dictates how the GPU interprets the memory pointed by m_Datam_MinFilter (dmGraphics::TextureFilter) - Minification filter (applied when shrinking). Determines how pixels are sampled when the texture is displayed smaller than its native resolutionm_MagFilter (dmGraphics::TextureFilter) - Magnification filter (applied when enlarging). Determines how pixels are sampled when the texture is displayed larger than its native resolutionm_UWrap (dmGraphics::TextureWrap) - Wrapping mode for U (X) texture coordinate. Controls behavior when texture coordinates exceed [0,1]m_VWrap (dmGraphics::TextureWrap) - Wrapping mode for V (Y) texture coordinate. Controls behavior when texture coordinates exceed [0,1]m_WWrap (dmGraphics::TextureWrap) - Wrapping mode for W (Z) texture coordinate. Controls behavior when texture coordinates exceed [0,1]m_X (uint32_t) - X offset in pixels for sub-texture updates. Defines the left edge of the destination regionm_Y (uint32_t) - Y offset in pixels for sub-texture updates. Defines the top edge of the destination regionm_Z (uint32_t) - Z offset (depth layer) for 3D textures. Ignored for standard 2D texturesm_Slice (uint32_t) - Slice index in an array texture where the data should be uploadedm_Width (uint16_t) - Width of the pixel data block in pixels. Used for both full uploads and sub-updatesm_Height (uint16_t) - Height of the pixel data block in pixels. Used for both full uploads and sub-updatesm_Depth (uint16_t) - Depth of the pixel data block in pixels. Only relevant for 3D texturesm_LayerCount (uint8_t) - Number of layers to update. For array textures, this specifies how many pages are updatedm_MipMap (uint8_t) - Only 7 bit available Mipmap level to update. Level 0 is the base level, higher levels are progressively downscaled versionsm_SubUpdate (uint8_t) - If true, this represents a partial texture update (sub-region), using m_X, m_Y, m_Z, and m_Slice offsets. If false, the entire texture/mipmap level is replacedType: ENUM Texture data upload status flags
Members
TEXTURE_STATUS_OK - <div class="codehilite"><pre> Texture updated and ready-to-use
</pre></div>TEXTURE_STATUS_DATA_PENDING - Data upload to the texture is in progressType: ENUM Texture types
Members
TEXTURE_TYPE_2DTEXTURE_TYPE_2D_ARRAYTEXTURE_TYPE_3DTEXTURE_TYPE_CUBE_MAPTEXTURE_TYPE_IMAGE_2DTEXTURE_TYPE_IMAGE_3DTEXTURE_TYPE_SAMPLERTEXTURE_TYPE_TEXTURE_2DTEXTURE_TYPE_TEXTURE_2D_ARRAYTEXTURE_TYPE_TEXTURE_3DTEXTURE_TYPE_TEXTURE_CUBEType: ENUM Texture addressing/wrapping modes. Controls behavior when texture coordinates fall outside the [0,1] range
Members
TEXTURE_WRAP_CLAMP_TO_BORDER - <div class="codehilite"><pre>Clamp to the color defined as 'border'
</pre></div>TEXTURE_WRAP_CLAMP_TO_EDGE - <div class="codehilite"><pre> Clamp to the edge pixel of the texture
</pre></div>TEXTURE_WRAP_MIRRORED_REPEAT - <div class="codehilite"><pre>Repeat texture, mirroring every other repetition
</pre></div>TEXTURE_WRAP_REPEAT - <div class="codehilite"><pre> Repeat texture in a tiled fashion
</pre></div>Type: ENUM Data type. Represents scalar, vector, matrix, image, or sampler types used for vertex attributes, uniforms, and shader interface definitions
Members
TYPE_BYTE - <div class="codehilite"><pre> Signed 8-bit integer. Compact storage, often used for colors, normals, or compressed vertex attributes
</pre></div>TYPE_UNSIGNED_BYTE - <div class="codehilite"><pre> Unsigned 8-bit integer. Common for color channels (0–255) or normalized texture data
</pre></div>TYPE_SHORT - <div class="codehilite"><pre> Signed 16-bit integer. Used for medium-range numeric attributes such as bone weights or coordinates with normalization
</pre></div>TYPE_UNSIGNED_SHORT - <div class="codehilite"><pre> Unsigned 16-bit integer. Often used for indices or normalized attributes when extra precision over bytes is required
</pre></div>TYPE_INT - <div class="codehilite"><pre> Signed 32-bit integer. Typically used for uniform values, shader constants, or counters
</pre></div>TYPE_UNSIGNED_INT - <div class="codehilite"><pre> Unsigned 32-bit integer. Used for indices, IDs, or GPU counters
</pre></div>TYPE_FLOAT - <div class="codehilite"><pre> 32-bit floating point. Standard for most vertex attributes and uniform values (positions, UVs, weights)
</pre></div>TYPE_FLOAT_VEC4 - <div class="codehilite"><pre> 4-component floating-point vector (`vec4` in GLSL). Typically used for homogeneous coordinates, colors (RGBA), or combined attributes
</pre></div>TYPE_FLOAT_MAT4 - <div class="codehilite"><pre> 4x4 floating-point matrix (`mat4` in GLSL). Standard for 3D transformations (model, view, projection)
</pre></div>TYPE_SAMPLER_2D - <div class="codehilite"><pre> 2D texture sampler. Standard type for most texture lookups
</pre></div>TYPE_SAMPLER_CUBE - <div class="codehilite"><pre> Cube map sampler. Used for environment mapping, reflections, and skyboxes
</pre></div>TYPE_SAMPLER_2D_ARRAY - Array of 2D texture samplers. Enables efficient texture indexing when using multiple layers (e.g. terrain textures, sprite atlases)TYPE_FLOAT_VEC2 - <div class="codehilite"><pre> 2-component floating-point vector (`vec2` in GLSL). Commonly used for texture coordinates or 2D positions
</pre></div>TYPE_FLOAT_VEC3 - <div class="codehilite"><pre> 3-component floating-point vector (`vec3` in GLSL). Used for positions, normals, and directions in 3D space
</pre></div>TYPE_FLOAT_MAT2 - <div class="codehilite"><pre> 2x2 floating-point matrix (`mat2` in GLSL). Used in transformations (e.g. 2D rotations, scaling)
</pre></div>TYPE_FLOAT_MAT3 - <div class="codehilite"><pre> 3x3 floating-point matrix (`mat3` in GLSL). Commonly used for normal matrix calculations in lighting
</pre></div>TYPE_IMAGE_2D - <div class="codehilite"><pre> 2D image object. Unlike samplers, images allow read/write access in shaders (e.g. compute shaders or image load/store operations)
</pre></div>TYPE_TEXTURE_2D - <div class="codehilite"><pre> 2D texture object handle. Represents an actual GPU texture resource
</pre></div>TYPE_SAMPLER - <div class="codehilite"><pre> Generic sampler handle, used as a placeholder for texture units without specifying the dimension
</pre></div>TYPE_TEXTURE_2D_ARRAY - 2D texture array object handleTYPE_TEXTURE_CUBE - <div class="codehilite"><pre> Cube map texture object handle
</pre></div>TYPE_SAMPLER_3D - <div class="codehilite"><pre> 3D texture sampler. Used for volumetric effects, noise fields, or voxel data
</pre></div>TYPE_TEXTURE_3D - <div class="codehilite"><pre> 3D texture object handle
</pre></div>TYPE_IMAGE_3D - <div class="codehilite"><pre> 3D image object. Used for compute-based volume processing
</pre></div>TYPE_SAMPLER_3D_ARRAY - Array of 3D texture samplersTYPE_TEXTURE_3D_ARRAY - 3D texture array object handle