Crate nstd_gl[][src]

Structs

Represents a color.

Contains information on a device.

Represents a GL state.

Configures a GL state upon creation. For backend, NSTD_GL_BACKEND_UNKNOWN will pick a default backend to use.

Represents a vertex attribute. NOTE: This struct must directly mirror VertexAttribute defined by wgpu in terms of size, alignment, and order of fields.

Represents a vertex buffer layout. attributes - &mut [NSTDGLVertexAttribute].

Enums

Represents a graphics backend.

Represents a device type.

Represents an index format when drawing indexed verticies.

Represents a power preference.

Represents a state’s presentation mode.

Represents a vertex format when sending data to the vertex shader.

Represents a vertex stepping mode.

Functions

Frees a GPU buffer. Parameters: NSTDGLBuffer *const buffer - The GPU buffer.

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.

Frees an NSTDGLDeviceInfo object. Parameters: NSTDGLDeviceInfo *const device_info - Pointer to an NSTDGLDeviceInfo object.

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).

Frees a render pipeline. Parameters: NSTDGLRenderPipeline *pipeline - Pointer to a render pipeline.

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.

Frees a shader module. Parameters: NSTDGLShaderModule *shader - Pointer to a shader module.

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.

Frees and destroys a GL state. Parameters: NSTDGLState *const state - The GL state.

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.

Resizes a GL state’s context. Parameters: NSTDGLState *const state - The GL state. const NSTDWindowSize *const new_size - The new context size.

Type Definitions

Represents a GPU buffer.

Represents a graphics device.

Represents a handle to a physical graphics device.

Represents a graphics device command queue.

Represents a render pass object.

Represents a render pipeline.

Represents a shader module.

Represents a graphical surface.

Represents a surface config.