Represents a vertex attribute.
NOTE: This struct must directly mirror VertexAttribute defined by wgpu in terms of size,
alignment, and order of fields.
Creates a new GPU buffer.
Parameters:
const NSTDSlice *const bytes - The bytes to send to the GPU.
NSTDGLDevice device - The device to create the buffer on.
Returns: NSTDGLBuffer buffer - The new GPU buffer.
Retrieves info on a device.
Parameters:
NSTDGLDeviceHandle device_handle - Handle to a device.
Returns: NSTDGLDeviceInfo device_info - Contains information about a device.
Draws primitives from active vertex buffers.
Parameters:
NSTDGLRenderPass render_pass - The render pass.
const NSTDUInt32 verticies - Number of verticies to draw.
const NSTDUInt32 instances - Number of instnaces.
Draws primitives from active vertex and index buffers.
Parameters:
NSTDGLRenderPass render_pass - The render pass.
const NSTDUInt32 indicies - The indicies to draw.
const NSTDUInt32 instances - The instances to draw.
const NSTDInt32 base - The base vertex.
Sets a render pass’ index buffer.
Parameters:
NSTDGLRenderPass render_pass - The render pass.
NSTDGLBuffer buffer - The GPU index buffer.
NSTDGLIndexFormat format - The index format of the buffer.
Sets a render pipeline for a render pass.
Parameters:
NSTDGLRenderPass render_pass - The render pass.
NSTDGLRenderPipeline pipeline - The render pipeline.
Sets a render pass’ vertex buffer.
Parameters:
NSTDGLRenderPass render_pass - The render pass.
NSTDGLBuffer buffer - The GPU vertex buffer.
const NSTDUInt32 slot - The buffer slot (the index of the buffer layout).
Creates a new render pipeline from a vertex and fragment shader.
Parameters:
NSTDGLShaderModule vert - The vertex shader module.
NSTDGLShaderModule frag - The fragment shader module.
const NSTDSlice *const buffers - A slice of NSTDGLVertexBufferLayouts.
NSTDGLDevice device - The device to create the render pipeline on.
NSTDGLSurfaceConfiguration config - The surface configuration.
Returns: NSTDGLRenderPipeline pipeline - The new render pipeline.
Creates a new shader module.
Parameters:
const NSTDSlice *const data - Raw spirv data.
NSTDGLDevice device - The device to create the shader module on.
Returns: NSTDGLShaderModule shader - The new shader module.
Creates a new GL state.
Parameters:
NSTDWindow window - The window in which the GL state will live in.
const NSTDGLStateDescriptor descriptor - Configures the state.
Returns: NSTDGLState state - The new GL state.
Pushes the current frame to the display.
Parameters:
const NSTDGLState *const state - The GL state.
void(*callback)(NSTDGLRenderPass) - Manipulates the render pass.
Returns: int errc - Nonzero on error.