Crate nstd_gl

Crate nstd_gl 

Source

Structs§

NSTDGLDeviceInfo
Contains information on a device.
NSTDGLState
Represents a GL state.
NSTDGLStateDescriptor
Configures a GL state upon creation. For backend, NSTD_GL_BACKEND_UNKNOWN will pick a default backend to use.
NSTDGLVertexAttribute
Represents a vertex attribute. NOTE: This struct must directly mirror VertexAttribute defined by wgpu in terms of size, alignment, and order of fields.
NSTDGLVertexBufferLayout
Represents a vertex buffer layout. attributes - &mut [NSTDGLVertexAttribute].

Enums§

NSTDGLBackend
Represents a graphics backend.
NSTDGLDeviceType
Represents a device type.
NSTDGLIndexFormat
Represents an index format when drawing indexed verticies.
NSTDGLPowerPreference
Represents a power preference.
NSTDGLPresentationMode
Represents a state’s presentation mode.
NSTDGLVertexFormat
Represents a vertex format when sending data to the vertex shader.
NSTDGLVertexStepMode
Represents a vertex stepping mode.

Functions§

nstd_gl_buffer_free
Frees a GPU buffer. Parameters: NSTDGLBuffer *const buffer - The GPU buffer.
nstd_gl_buffer_new
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.
nstd_gl_device_handle_get_info
Retrieves info on a device. Parameters: NSTDGLDeviceHandle device_handle - Handle to a device. Returns: NSTDGLDeviceInfo device_info - Contains information about a device.
nstd_gl_device_info_free
Frees an NSTDGLDeviceInfo object. Parameters: NSTDGLDeviceInfo *const device_info - Pointer to an NSTDGLDeviceInfo object.
nstd_gl_render_pass_draw
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.
nstd_gl_render_pass_draw_indexed
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.
nstd_gl_render_pass_set_index_buffer
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.
nstd_gl_render_pass_set_pipeline
Sets a render pipeline for a render pass. Parameters: NSTDGLRenderPass render_pass - The render pass. NSTDGLRenderPipeline pipeline - The render pipeline.
nstd_gl_render_pass_set_vertex_buffer
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).
nstd_gl_render_pipeline_free
Frees a render pipeline. Parameters: NSTDGLRenderPipeline *pipeline - Pointer to a render pipeline.
nstd_gl_render_pipeline_new
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.
nstd_gl_shader_module_free
Frees a shader module. Parameters: NSTDGLShaderModule *shader - Pointer to a shader module.
nstd_gl_shader_module_new
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.
nstd_gl_state_free
Frees and destroys a GL state. Parameters: NSTDGLState *const state - The GL state.
nstd_gl_state_new
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.
nstd_gl_state_render
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.
nstd_gl_state_resize
Resizes a GL state’s context. Parameters: NSTDGLState *const state - The GL state. const NSTDWindowSize *const new_size - The new context size.

Type Aliases§

NSTDGLBuffer
Represents a GPU buffer.
NSTDGLColor
Represents a color.
NSTDGLDevice
Represents a graphics device.
NSTDGLDeviceHandle
Represents a handle to a physical graphics device.
NSTDGLQueue
Represents a graphics device command queue.
NSTDGLRenderPass
Represents a render pass object.
NSTDGLRenderPipeline
Represents a render pipeline.
NSTDGLShaderModule
Represents a shader module.
NSTDGLSurface
Represents a graphical surface.
NSTDGLSurfaceConfiguration
Represents a surface config.