Graphics

Platform specific native graphics functions.

INVALID_STREAM_OFFSET()

Max subpasses

Max subpasses


MAX_SUBPASS_DEPENDENCIES()

Max subpass dependencies

Max subpass dependencies


SUBPASS_EXTERNAL()

Subpass external

Subpass external


SUBPASS_ATTACHMENT_UNUSED()

Subpass attachment unused flag

Subpass attachment unused flag


BarrierStageFlags

MEMBERS

STAGE_FLAG_QUEUE_BEGIN -

STAGE_FLAG_QUEUE_END -

STAGE_FLAG_FRAGMENT_SHADER -

STAGE_FLAG_EARLY_FRAGMENT_SHADER_TEST -


BarrierAccessFlags

MEMBERS

ACCESS_FLAG_READ -

ACCESS_FLAG_WRITE -

ACCESS_FLAG_SHADER -


VulkanGetContext()

Get the vulkan context of the installed adapter

Get the vulkan context of the installed adapter

RETURN

context - the vulkan context


VulkanCopyBufferToTexture(context, buffer, texture, width, height, x, y, mipmap)

Copy a buffer to a texture

Copy a buffer to a texture

PARAMETERS

context - the vulkan context

buffer - the buffer to copy into the texture

texture - the texture to copy into

width - width of the texture slice to copy

height - height of the texture slice to copy

x - x offset into the texture

y - y offset into the texture

mipmap - the mipmap slice to upload


VulkanSetRenderTargetAttachments(context, render_target, params)

Sets the attachments for a render target

Sets the attachments for a render target

PARAMETERS

context - the vulkan context

render_target - the render target

params - the render target attachment params


VulkanSetConstantBuffer(context, buffer, buffer_offset, base_location)

Bind a constant buffer to the currently bound shad...

Bind a constant buffer to the currently bound shader

PARAMETERS

context - the vulkan context

buffer - the constant buffer

buffer_offset - offset location for the buffer

base_location - the shader location to bind to


VulkanGetActiveSwapChainTexture(context)

Get the current swap chain texture

Get the current swap chain texture

PARAMETERS

context - the vulkan context

RETURN

swapchain - the swap chain texture for the current frame


VulkanDrawElementsInstanced(context, prim_type, first, count, instance_count, type, index_buffer)

Draw with index buffer instanced

Draw with index buffer instanced

PARAMETERS

context - the vulkan context

prim_type - primitive type

first - the byte offset into the index buffer

count - number of primitives to draw

instance_count - number of instances to draw

type - the index buffer type

index_buffer - the index buffer


VulkanSetVertexDeclarationStepFunction(context, vertex_declaration, step_function)

Set the step function for a vertex declaration

Set the step function for a vertex declaration

PARAMETERS

context - the vulkan context

vertex_declaration - the vertex declaration to set step function for

step_function - the step function


VulkanDrawBaseInstance(context, prim_type, first, count, instance_count, type, index_buffer)

Draw with vertex buffer instanced

Draw with vertex buffer instanced

PARAMETERS

context - the vulkan context

prim_type - primitive type

first - the byte offset into the index buffer

count - number of primitives to draw

instance_count - number of instances to draw

type - the index buffer type

index_buffer - the index buffer


VulkanCreateRenderPass(context, render_target, params)

Create a render pass

Create a render pass

PARAMETERS

context - the vulkan context

render_target - the render target

params - params


VulkanNextRenderPass(context, render_target)

Advance the render pass to the next sub pass

Advance the render pass to the next sub pass

PARAMETERS

context - the vulkan context

render_target - the render target to advance


VulkanSetFrameInFlightCount(context, num_frames_in_flight)

Set the number of in-flight frames that the vulkan...

Set the number of in-flight frames that the vulkan layer uses

PARAMETERS

context - the vulkan context

num_frames_in_flight - the max number of frames in flight


VulkanSetPipelineState(context, ps)

Set the entire current pipeline state

Set the entire current pipeline state

PARAMETERS

context - the vulkan context

ps - the pipeline state


VulkanClearTexture(context, texture, values)

Clear a texture with RGBA values

Clear a texture with RGBA values

PARAMETERS

context - the vulkan context

texture - the texture to clear

values - ] the clear values


VulkanMemorybarrier(context, texture, src_stage_flags, dst_stage_flags, src_access_flags, dst_access_flags)

Insert a memory barrier

Insert a memory barrier

PARAMETERS

context - the vulkan context

texture - the texture to set barrier for

src_stage_flags - src stage flag

dst_stage_flags - dst stage flag

src_access_flags - src access flag

dst_access_flags - dst access flag


VulkanGetUniformBinding(context, program, index, set, binding, member_index)

Get the set and binding information from a uniform...

Get the set and binding information from a uniform index

PARAMETERS

context - the vulkan context

program - the program to query

index - uniform index

set - a pointer to store the result of the set number

binding - a pointer to store the result of the binding number

member_index - a pointer to store the result of the member index


HStorageBuffer(context, buffer_size)

Create a new storage buffer

Create a new storage buffer

PARAMETERS

context - the vulkan context

buffer_size - the size of the storage buffer to allocate

RETURN

storage_buffer - the storage buffer


VulkanDeleteStorageBuffer(context, storage_buffer)

Delete a storage buffer

Delete a storage buffer

PARAMETERS

context - the vulkan context

storage_buffer - the attachment to get


VulkanSetStorageBuffer(context, storage_buffer, binding_index, buffer_offset, base_location)

Bind a storage buffer to the render state

Bind a storage buffer to the render state

PARAMETERS

context - the vulkan context

storage_buffer - the storage buffer to bind

binding_index - binding index

buffer_offset - the buffer offset

base_location - the shader location to bind to


VulkanSetStorageBufferData(context, storage_buffer, size, data)

Set the storage buffer data

Set the storage buffer data

PARAMETERS

context - the vulkan context

storage_buffer - the storage buffer

size - size of the input data

data - the buffer data


VulkanMapVertexBuffer(context, buffer, buffer_access)

Map the GPU data for a vertex buffer

Map the GPU data for a vertex buffer

PARAMETERS

context - the vulkan context

buffer - the buffer to map

buffer_access - how to access the buffer

RETURN

void* - the mapped data buffer


VulkanUnmapVertexBuffer(context, buffer)

Unmap a vertex buffer

Unmap a vertex buffer

PARAMETERS

context - the vulkan context

buffer - the buffer

RETURN

flag - unused


VulkanMapIndexBuffer(context, buffer, buffer_access)

Map the GPU data for a index buffer

Map the GPU data for a index buffer

PARAMETERS

context - the vulkan context

buffer - the buffer to map

buffer_access - how to access the buffer

RETURN

void* - the mapped data buffer


VulkanUnmapIndexBuffer(context, buffer)

Unmap a index buffer

Unmap a index buffer

PARAMETERS

context - the vulkan context

buffer - the buffer

RETURN

flag - unused


HContext

Context handle

Context handle


HTexture

Texture handle

Texture handle


HRenderTarget

Rendertarget handle

Rendertarget handle


HVertexProgram

Vertex program handle

Vertex program handle


HFragmentProgram

Fragment program handle

Fragment program handle


HProgram

Program handle

Program handle


HVertexBuffer

Vertex buffer handle

Vertex buffer handle


HIndexBuffer

Index buffer handle

Index buffer handle


HStorageBuffer

Storage buffer handle

Storage buffer handle


HUniformLocation

Uniform location handle

Uniform location handle


HVertexDeclaration

Vertex declaration handle

Vertex declaration handle


HVertexStreamDeclaration

Vertex stream declaration handle

Vertex stream declaration handle


HPipelineState

PipelineState handle

PipelineState handle


INVALID_STREAM_OFFSET()

Invalid stream offset

Invalid stream offset


MAX_BUFFER_COLOR_ATTACHMENTS()

Max buffer color attachments

Max buffer color attachments


HandleResult

MEMBERS

HANDLE_RESULT_OK -

HANDLE_RESULT_NOT_AVAILABLE -

HANDLE_RESULT_ERROR -


RenderTargetAttachment

MEMBERS

ATTACHMENT_COLOR -

ATTACHMENT_DEPTH -

ATTACHMENT_STENCIL -

MAX_ATTACHMENT_COUNT -


AttachmentOp

MEMBERS

ATTACHMENT_OP_DONT_CARE -

ATTACHMENT_OP_LOAD -

ATTACHMENT_OP_STORE -

ATTACHMENT_OP_CLEAR -


TextureFormat

MEMBERS

TEXTURE_FORMAT_LUMINANCE -

TEXTURE_FORMAT_LUMINANCE_ALPHA -

TEXTURE_FORMAT_RGB -

TEXTURE_FORMAT_RGBA -

TEXTURE_FORMAT_RGB_16BPP -

TEXTURE_FORMAT_RGBA_16BPP -

TEXTURE_FORMAT_DEPTH -

TEXTURE_FORMAT_STENCIL -

TEXTURE_FORMAT_RGB_PVRTC_2BPPV1 -

TEXTURE_FORMAT_RGB_PVRTC_4BPPV1 -

TEXTURE_FORMAT_RGBA_PVRTC_2BPPV1 -

TEXTURE_FORMAT_RGBA_PVRTC_4BPPV1 -

TEXTURE_FORMAT_RGB_ETC1 -

TEXTURE_FORMAT_R_ETC2 -

TEXTURE_FORMAT_RG_ETC2 -

TEXTURE_FORMAT_RGBA_ETC2 -

TEXTURE_FORMAT_RGBA_ASTC_4x4 -

TEXTURE_FORMAT_RGB_BC1 -

TEXTURE_FORMAT_RGBA_BC3 -

TEXTURE_FORMAT_R_BC4 -

TEXTURE_FORMAT_RG_BC5 -

TEXTURE_FORMAT_RGBA_BC7 -

TEXTURE_FORMAT_RGB16F -

TEXTURE_FORMAT_RGB32F -

TEXTURE_FORMAT_RGBA16F -

TEXTURE_FORMAT_RGBA32F -

TEXTURE_FORMAT_R16F -

TEXTURE_FORMAT_RG16F -

TEXTURE_FORMAT_R32F -

TEXTURE_FORMAT_RG32F -

TEXTURE_FORMAT_RGBA32UI -

TEXTURE_FORMAT_COUNT -


GetRenderTargetAttachment(render_target, attachment_type)

Get the attachment texture from a render target. R...

Get the attachment texture from a render target. Returns zero if no such attachment texture exists.

PARAMETERS

render_target - the render target

attachment_type - the attachment to get

RETURN

attachment - the attachment texture


GetTextureHandle(texture, out_handle)

Get the native graphics API texture object from an...

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 - the texture handle

out_handle - a pointer to where the raw object should be stored

RETURN

handle_result - the result of the query


CompareFunc

MEMBERS

COMPARE_FUNC_NEVER -

COMPARE_FUNC_LESS -

COMPARE_FUNC_LEQUAL -

COMPARE_FUNC_GREATER -

COMPARE_FUNC_GEQUAL -

COMPARE_FUNC_EQUAL -

COMPARE_FUNC_NOTEQUAL -

COMPARE_FUNC_ALWAYS -


FaceWinding

MEMBERS

FACE_WINDING_CCW -

FACE_WINDING_CW -


StencilOp

MEMBERS

STENCIL_OP_KEEP -

STENCIL_OP_ZERO -

STENCIL_OP_REPLACE -

STENCIL_OP_INCR -

STENCIL_OP_INCR_WRAP -

STENCIL_OP_DECR -

STENCIL_OP_DECR_WRAP -

STENCIL_OP_INVERT -


BufferUsage

MEMBERS

BUFFER_USAGE_STREAM_DRAW -

BUFFER_USAGE_DYNAMIC_DRAW -

BUFFER_USAGE_STATIC_DRAW -

Preferred for buffers that never change


BufferAccess

MEMBERS

BUFFER_ACCESS_READ_ONLY -

BUFFER_ACCESS_WRITE_ONLY -

BUFFER_ACCESS_READ_WRITE -


IndexBufferFormat

MEMBERS

INDEXBUFFER_FORMAT_16 -

INDEXBUFFER_FORMAT_32 -


PrimitiveType

Primitive type

Primitive type

MEMBERS

PRIMITIVE_LINES -

PRIMITIVE_TRIANGLES -

PRIMITIVE_TRIANGLE_STRIP -


Type

Data type

Data type

MEMBERS

TYPE_BYTE -

TYPE_UNSIGNED_BYTE -

TYPE_SHORT -

TYPE_UNSIGNED_SHORT -

TYPE_INT -

TYPE_UNSIGNED_INT -

TYPE_FLOAT -

TYPE_FLOAT_VEC4 -

TYPE_FLOAT_MAT4 -

TYPE_SAMPLER_2D -

TYPE_SAMPLER_CUBE -

TYPE_SAMPLER_2D_ARRAY -

TYPE_FLOAT_VEC2 -

TYPE_FLOAT_VEC3 -

TYPE_FLOAT_MAT2 -

TYPE_FLOAT_MAT3 -

TYPE_IMAGE_2D -


BlendFactor

Blend factor

Blend factor

MEMBERS

BLEND_FACTOR_ZERO -

BLEND_FACTOR_ONE -

BLEND_FACTOR_SRC_COLOR -

BLEND_FACTOR_ONE_MINUS_SRC_COLOR -

BLEND_FACTOR_DST_COLOR -

BLEND_FACTOR_ONE_MINUS_DST_COLOR -

BLEND_FACTOR_SRC_ALPHA -

BLEND_FACTOR_ONE_MINUS_SRC_ALPHA -

BLEND_FACTOR_DST_ALPHA -

BLEND_FACTOR_ONE_MINUS_DST_ALPHA -

BLEND_FACTOR_SRC_ALPHA_SATURATE -

BLEND_FACTOR_CONSTANT_COLOR -

BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR -

BLEND_FACTOR_CONSTANT_ALPHA -

BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA -


VertexStepFunction

Vertex step function. Dictates how the data for a ...

Vertex step function. Dictates how the data for a vertex attribute should be read in a vertex shader.

MEMBERS

VERTEX_STEP_FUNCTION_VERTEX -

VERTEX_STEP_FUNCTION_INSTANCE -


NewVertexStreamDeclaration(context)

Create new vertex stream declaration. A stream dec...

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 - the context

RETURN

declaration - the vertex declaration


AddVertexStream(context, name, size, type, normalize)

Adds a stream to a stream declaration

Adds a stream to a stream declaration

PARAMETERS

context - the context

name - the name of the stream

size - the size of the stream, i.e number of components

type - the data type of the stream

normalize - true if the stream should be normalized in the 0..1 range


AddVertexStream(context, name_hash, size, type, normalize)

Adds a stream to a stream declaration

Adds a stream to a stream declaration

PARAMETERS

context - the context

name_hash - the name hash of the stream

size - the size of the stream, i.e number of components

type - the data type of the stream

normalize - true if the stream should be normalized in the 0..1 range


DeleteVertexStreamDeclaration(stream_declaration)

Delete vertex stream declaration

Delete vertex stream declaration

PARAMETERS

stream_declaration - the vertex stream declaration


NewVertexDeclaration(context, stream_declaration)

Create new vertex declaration from a vertex stream...

Create new vertex declaration from a vertex stream declaration

PARAMETERS

context - the context

stream_declaration - the vertex stream declaration

RETURN

declaration - the vertex declaration


NewVertexDeclaration(context, stream_declaration, stride)

Create new vertex declaration from a vertex stream...

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 - the context

stream_declaration - the vertex stream declaration

stride - the stride between the start of each vertex (in bytes)

RETURN

declaration - the vertex declaration


DeleteVertexDeclaration(vertex_declaration)

Delete vertex declaration

Delete vertex declaration

PARAMETERS

vertex_declaration - the vertex declaration


GetVertexStreamOffset(vertex_declaration, name_hash)

Get the physical offset into the vertex data for a...

Get the physical offset into the vertex data for a particular stream

PARAMETERS

vertex_declaration - the vertex declaration

name_hash - the name hash of the vertex stream (as passed into AddVertexStream())

RETURN

Offset - in bytes into the vertex or INVALID_STREAM_OFFSET if not found


NewVertexBuffer(context, size, data, buffer_usage)

Create new vertex buffer with initial data

Create new vertex buffer with initial data

PARAMETERS

context - the context

size - the size of the buffer (in bytes). May be 0

data - the data

buffer_usage - the usage

RETURN

buffer - the vertex buffer


DeleteVertexBuffer(buffer)

Delete vertex buffer

Delete vertex buffer

PARAMETERS

buffer - the buffer


SetVertexBufferData(buffer, size, data, buffer_usage)

Set vertex buffer data

Set vertex buffer data

PARAMETERS

buffer - the buffer

size - the size of the buffer (in bytes). May be 0

data - the data

buffer_usage - the usage


SetVertexBufferSubData(buffer, offset, size, data)

Set subset of vertex buffer data

Set subset of vertex buffer data

PARAMETERS

buffer - the buffer

offset - the offset into the desination buffer (in bytes)

size - the size of the buffer (in bytes). May be 0

data - the data


GetMaxElementsVertices(context)

Get the max number of vertices allowed by the syst...

Get the max number of vertices allowed by the system in a vertex buffer

PARAMETERS

context - the context

RETURN

count - the count


NewIndexBuffer(context, size, data, buffer_usage)

Create new index buffer with initial data

Create new index buffer with initial data

PARAMETERS

context - the context

size - the size of the buffer (in bytes). May be 0

data - the data

buffer_usage - the usage

RETURN

buffer - the index buffer


DeleteIndexBuffer(buffer)

Delete the index buffer

Delete the index buffer

PARAMETERS

buffer - the index buffer


SetIndexBufferData(buffer, size, data, buffer_usage)

Set index buffer data

Set index buffer data

PARAMETERS

buffer - the buffer

size - the size of the buffer (in bytes). May be 0

data - the data

buffer_usage - the usage


SetIndexBufferSubData(buffer, offset, size, data)

Set subset of index buffer data

Set subset of index buffer data

PARAMETERS

buffer - the buffer

offset - the offset into the desination buffer (in bytes)

size - the size of the buffer (in bytes). May be 0

data - the data


IsIndexBufferFormatSupported(context, format, result)

Check if the index format is supported

Check if the index format is supported

PARAMETERS

context - the context

format - the format

result - true if the format is supoprted


GetMaxElementsIndices(context)

Get the max number of indices allowed by the syste...

Get the max number of indices allowed by the system in an index buffer

PARAMETERS

context - the context

RETURN

count - the count


IsExtensionSupported(context, extension)

check if an extension is supported

check if an extension is supported

PARAMETERS

context - the context

extension - the extension.

RETURN

result - true if the extension was supported


IsTextureFormatSupported(context, format)

check if a specific texture format is supported

check if a specific texture format is supported

PARAMETERS

context - the context

format - the texture format.

RETURN

result - true if the texture format was supported


GetNumSupportedExtensions(context)

PARAMETERS

context - the context

RETURN

count - the number of supported extensions


GetSupportedExtension(context, index)

get the supported extension

get the supported extension

PARAMETERS

context - the context

index - the index of the extension

RETURN

extension - the extension. 0 if index was out of bounds


dmGraphics::GetNativeiOSUIWindow()

get iOS UIWindow

Get iOS UIWindow native handle (id). Any other platform return zero.

RETURN

id - native handle


dmGraphics::GetNativeiOSUIView()

get iOS UIView

Get iOS UIView native handle (id). Any other platform return zero.

RETURN

id - native handle


dmGraphics::GetNativeiOSEAGLContext()

get iOS EAGLContext

Get iOS EAGLContext native handle (id). Any other platform return zero.

RETURN

id - native handle


dmGraphics::GetNativeOSXNSWindow()

get OSX NSWindow

Get OSX NSWindow native handle (id). Any other platform return zero.

RETURN

id - native handle


dmGraphics::GetNativeOSXNSView()

get OSX NSView

Get OSX NSView native handle (id). Any other platform return zero.

RETURN

id - native handle


dmGraphics::GetNativeOSXNSOpenGLContext()

get OSX NSOpenGLContext

Get OSX NSOpenGLContext native handle (id). Any other platform return zero.

RETURN

id - native handle


dmGraphics::GetNativeWindowsHWND()

get Win32 HWND

Get Win32 windows native handle (HWND). Any other platform return zero.

RETURN

HWND - native handle


dmGraphics::GetNativeWindowsHGLRC()

get Win32 HGLRC

Get Win32 gl rendercontext native handle (HGLRC). Any other platform return zero.

RETURN

HGLRC - native handle


dmGraphics::GetNativeAndroidEGLContext()

get Android EGLContext

Get Android EGLContext native handle (EGLContext). Any other platform return zero.

RETURN

EGLContext - native handle


dmGraphics::GetNativeAndroidEGLSurface()

get Android EGLSurface

Get Android EGLSurface native handle (EGLSurface). Any other platform return zero.

RETURN

EGLSurface - native handle


dmGraphics::GetNativeAndroidJavaVM()

get Android native JavaVM

Get Android JavaVM ptr. Any other platform return zero.

RETURN

JavaVM* - native handle


dmGraphics::GetNativeAndroidActivity()

get Android native jobject

Get Android native jobject. Any other platform return zero.

RETURN

jobject - native handle


dmGraphics::GetNativeAndroidApp()

get Android app object

Get Android app object. Any other platform return zero.

RETURN

app - native handle


dmGraphics::GetNativeX11Window()

get Linux X11Window

Get Linux X11Window windows native handle (Window). Any other platform return zero.

RETURN

Window - native handle


dmGraphics::GetNativeX11GLXContext()

get Linux X11GLXContext

Get Linux X11GLXContext native handle (GLXContext). Any other platform return zero.

RETURN

GLXContext - native handle