|
openwallpaper
|
Data Structures | |
| struct | ow_vertex_buffer_id |
| struct | ow_index_buffer_id |
| struct | ow_texture_id |
| struct | ow_sampler_id |
| struct | ow_vertex_shader_id |
| struct | ow_fragment_shader_id |
| struct | ow_pipeline_id |
| struct | ow_render_pass_info |
| struct | ow_texture_info |
| struct | ow_texture_update_destination |
| struct | ow_sampler_info |
| struct | ow_vertex_binding_info |
| struct | ow_vertex_attribute |
| struct | ow_blend_mode |
| struct | ow_pipeline_info |
| struct | ow_texture_binding |
| struct | ow_bindings_info |
| struct ow_vertex_buffer_id |
A handle pointing to host-managed vertex buffer. Existing vertex buffer's id is never zero, this value is reserved to act as non-existent object.
| Data Fields | ||
|---|---|---|
| uint32_t | id | |
| struct ow_index_buffer_id |
A handle pointing to host-managed index buffer. Existing index buffer's id is never zero, this value is reserved to act as non-existent object.
| Data Fields | ||
|---|---|---|
| uint32_t | id | |
| struct ow_texture_id |
A handle pointing to host-managed GPU texture. Existing texture's id is never zero, this value is reserved to act as non-existent object.
| Data Fields | ||
|---|---|---|
| uint32_t | id | |
| struct ow_sampler_id |
A handle pointing to host-managed GPU sampler. Existing sampler's id is never zero, this value is reserved to act as non-existent object.
| Data Fields | ||
|---|---|---|
| uint32_t | id | |
| struct ow_vertex_shader_id |
A handle pointing to host-managed vertex shader. Existing vertex shader's id is never zero, this value is reserved to act as non-existent object.
| Data Fields | ||
|---|---|---|
| uint32_t | id | |
| struct ow_fragment_shader_id |
A handle pointing to host-managed fragment shader. Existing fragment shader's id is never zero, this value is reserved to act as non-existent object.
| Data Fields | ||
|---|---|---|
| uint32_t | id | |
| struct ow_pipeline_id |
A handle pointing to host-managed GPU pipeline object. Existing pipeline's id is never zero, this value is reserved to act as non-existent object.
| Data Fields | ||
|---|---|---|
| uint32_t | id | |
| struct ow_render_pass_info |
A structure specifying render pass parameters.
| Data Fields | ||
|---|---|---|
| bool | clear_color |
If true, render pass will clear color target with clear_color_rgba. If false, texture target keeps its previous data, screen target data is undefined |
| float | clear_color_rgba[4] | RGBA color to clear color target with. |
| bool | clear_depth |
If true, render pass will clear depth target with clear_depth_value. If false, target keeps its previous data |
| float | clear_depth_value | Value to clear depth target with. |
| ow_texture_id | color_target | ID of color target texture. Setting it to 0 means render target is screen. |
| ow_texture_id | depth_target | ID of depth target texture. |
| struct ow_texture_info |
A structure specifying texture parameters.
| Data Fields | ||
|---|---|---|
| ow_texture_format | format | Pixel format of texture. |
| uint32_t | height | Height of texture in pixels. |
| uint32_t | mip_levels | Number of mip levels. |
| bool | render_target | If true, texture can be used as render target. |
| ow_msaa_samples | samples | Number of MSAA samples. |
| uint32_t | width | Width of texture in pixels. |
| struct ow_texture_update_destination |
A structure specifying rectangular texture fragment to update in ow_update_texture.
| Data Fields | ||
|---|---|---|
| uint32_t | h | Height of destination rectangle. |
| uint32_t | mip_level | Mip level to update, must be less than texture's mip_levels. |
| ow_texture_id | texture | ID of texture to update. |
| uint32_t | w | Width of destination rectangle. |
| uint32_t | x | Left offset of destination rectangle. |
| uint32_t | y | Top offset of destination rectangle. |
| struct ow_sampler_info |
A structure specifying sampler parameters.
| Data Fields | ||
|---|---|---|
| uint32_t | anisotropy | Anisotropy level, clamped to the maximum supported value. |
| ow_filter_mode | mag_filter | Magnification filter. |
| ow_filter_mode | min_filter | Minification filter. |
| ow_filter_mode | mip_filter | Mipmap filter. |
| ow_wrap_mode | wrap_x | Wrap mode for X axis. |
| ow_wrap_mode | wrap_y | Wrap mode for Y axis. |
| struct ow_vertex_binding_info |
A structure specifying vertex buffer binding info.
| struct ow_vertex_attribute |
A structure specifying vertex attribute.
| Data Fields | ||
|---|---|---|
| uint32_t | location | The location of the attribute in vertex shader. |
| size_t | offset | The offset of the attribute in bytes from the start of the vertex element. |
| uint32_t | slot | The binding slot of the associated vertex buffer. |
| ow_attribute_type | type | The type of the attribute. |
| struct ow_blend_mode |
A structure specifying blend mode of a color target.
| Data Fields | ||
|---|---|---|
| ow_blend_operator | alpha_operator | Alpha blending operator. |
| ow_blend_operator | color_operator | Color blending operator. |
| ow_blend_factor | dst_alpha_factor | Value to be multiplied by the destination alpha value. |
| ow_blend_factor | dst_color_factor | Value to be multiplied by the destination RGB value. |
| bool | enabled | Whether blending is enabled. |
| ow_blend_factor | src_alpha_factor | Value to be multiplied by the source alpha value. |
| ow_blend_factor | src_color_factor | Value to be multiplied by the source RGB value. |
| struct ow_pipeline_info |
A structure specifying pipeline parameters.
| Data Fields | ||
|---|---|---|
| ow_blend_mode | blend_mode | The blend mode to use. |
| ow_texture_format | color_target_format | The pixel format of the color target texture. |
| ow_cull_mode | cull_mode | The cull mode to use. |
| ow_depth_test_mode | depth_test_mode | The depth test mode to use. |
| bool | depth_write | If true, depth test will update the depth target texture. |
| ow_fragment_shader_id | fragment_shader | ID of fragment shader to use. |
| ow_topology | topology | The vertex topology to use. |
| const ow_vertex_attribute * | vertex_attributes | A pointer to an array of vertex attributes. |
| uint32_t | vertex_attributes_count | The number of vertex attributes in the array. |
| const ow_vertex_binding_info * | vertex_bindings | A pointer to an array of vertex buffer bindings. |
| uint32_t | vertex_bindings_count | The number of vertex buffer bindings in the array. |
| ow_vertex_shader_id | vertex_shader | ID of vertex shader to use. |
| struct ow_texture_binding |
A structure specifying a texture binding.
| Data Fields | ||
|---|---|---|
| ow_sampler_id | sampler | ID of the sampler to use for this texture. |
| uint32_t | slot | The slot of the texture in shader. |
| ow_texture_id | texture | ID of the texture to bind. |
| struct ow_bindings_info |
A structure specifying bindings for draw call.
| Data Fields | ||
|---|---|---|
| ow_index_buffer_id | index_buffer | ID of the index buffer. |
| const ow_texture_binding * | texture_bindings | A pointer to an array of texture bindings. |
| uint32_t | texture_bindings_count | The number of texture bindings in the array. |
| const ow_vertex_buffer_id * | vertex_buffers | A pointer to an array of vertex buffer IDs. |
| uint32_t | vertex_buffers_count | The number of vertex buffer IDs in the array. |
| enum ow_attribute_type |
| enum ow_blend_factor |
| enum ow_blend_operator |
| enum ow_buffer_type |
| enum ow_cull_mode |
| enum ow_depth_test_mode |
| enum ow_filter_mode |
| enum ow_mouse_button |
| enum ow_msaa_samples |
| enum ow_texture_format |
| enum ow_topology |
| enum ow_wrap_mode |
| void init | ( | ) |
A user-implemented function that is called once when scene is initializing.
|
extern |
Begins a copy pass. Can be called only if no pass is currently active, panics elsewhere.
|
extern |
Begins a render pass. Can be called only if no pass is currently active, panics elsewhere.
| info | Render pass parameters |
|
extern |
Creates a fragment shader from SPIR-V bytecode.
| bytecode | Pointer to the bytecode |
| size | Size of the bytecode in bytes |
|
extern |
Creates a fragment shader from a SPIR-V bytecode file from the scene archive. Panics if file is not found.
| path | Path to the file to load, absolute in the scene archive. A null-terminated byte string |
|
extern |
Creates an index buffer of given size. If wide is true, the buffer will be created with 32-bit indices, otherwise with 16-bit indices.
| size | Buffer size in bytes |
| wide | Whether to use 32-bit indices |
|
extern |
Creates a graphics pipeline.
| info | Pipeline parameters |
|
extern |
Creates a sampler.
| info | Sampler parameters |
|
extern |
Creates a texture.
| info | Texture parameters |
|
extern |
Creates a texture from a PNG or WEBP image file from the scene archive. Panics if file is not found.
| path | Path to the file to load, absolute in the scene archive. A null-terminated byte string |
| info | Texture parameters |
|
extern |
Creates a vertex buffer of given size.
| size | Buffer size in bytes |
|
extern |
Creates a vertex shader from SPIR-V bytecode.
| bytecode | Pointer to the bytecode |
| size | Size of the bytecode in bytes |
|
extern |
Creates a vertex shader from a SPIR-V bytecode file from the scene archive. Panics if file is not found.
| path | Path to the file to load, absolute in the scene archive. A null-terminated byte string |
|
extern |
Ends a copy pass. Can be called only if a copy pass is currently active, panics elsewhere.
|
extern |
Ends a render pass. Can be called only if a render pass is currently active, panics elsewhere.
|
extern |
Frees a fragment shader by ID. Panics if fragment shader is not found or is already freed. Does nothing if id is 0.
| id | Fragment shader ID to free |
|
extern |
Frees an index buffer by ID. Panics if index buffer is not found or is already freed. Does nothing if id is 0.
| id | Index buffer ID to free |
|
extern |
Frees a pipeline by ID. Panics if pipeline is not found or is already freed. Does nothing if id is 0.
| id | Pipeline ID to free |
|
extern |
Frees a sampler by ID. Panics if sampler is not found or is already freed. Does nothing if id is 0.
| id | Sampler ID to free |
|
extern |
Frees a texture by ID. Panics if texture is not found or is already freed. Does nothing if id is 0.
| id | Texture ID to free |
|
extern |
Frees a vertex buffer by ID. Panics if vertex buffer is not found or is already freed. Does nothing if id is 0.
| id | Vertex buffer ID to free |
|
extern |
Frees a vertex shader by ID. Panics if vertex shader is not found or is already freed. Does nothing if id is 0.
| id | Vertex shader ID to free |
|
extern |
Generates mipmaps for a texture.
| texture | Texture ID to generate mipmaps for. |
|
extern |
Gets audio spectrum data for visualization. Output data is a normalized array of floats in the range [0, 1] of length length.
| data | Pointer to the array to store spectrum data |
| length | Length of the array |
|
extern |
Gets cursor position and mouse buttons state. The cooordinate system for cursor position is x: [0, width] and y: [0, height] where (0, 0) is a top left corner.
| x | Pointer to the variable to store the X coordinate in pixels |
| y | Pointer to the variable to store the Y coordinate in pixels |
|
extern |
Gets a wallpaper option value by name. Returns NULL if wallpaper option with given name is unspecified. Returns an empty string if wallpaper option with given name is specified, but has no value. The returned string is owned by the host application and must not be freed.
| name | Name of the option to get |
|
extern |
Gets the screen size in pixels.
| width | Pointer to the variable to store the width in pixels |
| height | Pointer to the variable to store the height in pixels |
|
extern |
Loads a file from the scene archive into module memory. Panics if file is not found. Memory for loaded data is allocated by the host application during function call, and after that owned by user.
| path | Path to the file to load, absolute in the scene archive. A null-terminated byte string |
| data | Loaded data |
| size | Size of loaded data in bytes |
|
extern |
Pushes fragment shader uniform data for given slot. Subsequent ow_render_geometry and ow_render_geometry_indexed calls will use this data until overwritten or render pass ends. The pushed data must respect std140 layout conventions. Can be called only if render pass is currently active, panics elsewhere.
| slot | Target uniform slot |
| data | Pointer to the data to push |
| size | Size of the data in bytes |
|
extern |
Pushes vertex shader uniform data for given slot. Subsequent ow_render_geometry and ow_render_geometry_indexed calls will use this data until overwritten or render pass ends. The pushed data must respect std140 layout conventions. Can be called only if render pass is currently active, panics elsewhere.
| slot | Target uniform slot |
| data | Pointer to the data to push |
| size | Size of the data in bytes |
|
extern |
Renders geometry primitives.
| pipeline | Pipeline ID to use |
| bindings | Pointer to the bindings info |
| vertex_offset | Offset in vertices to start rendering from |
| vertex_count | Number of vertices to render |
| instance_count | Number of instances |
|
extern |
Renders geometry primitives with indices from an index buffer.
| pipeline | Pipeline ID to use |
| bindings | Pointer to the bindings info |
| index_offset | Offset in indices to start rendering from |
| index_count | Number of indices to render |
| vertex_offset | Offset in vertices to start rendering from |
| instance_count | Number of instances |
|
extern |
Overwrites index buffer data subsegment beginning at offset with size bytes from data. Can be called only if copy pass is currently active, panics elsewhere.
| buffer | Index buffer ID to update |
| offset | Offset in bytes from the start of the buffer |
| data | Pointer to the source data |
| size | Size of subsegment to update in bytes |
|
extern |
Updates a dest texture region with data from data
| data | Pointer to the source data |
| pixels_per_row | Number of pixels per row in the source data |
| dest | Pointer to the destination texture region |
|
extern |
Overwrites vertex buffer data subsegment beginning at offset with size bytes from data. Can be called only if copy pass is currently active, panics elsewhere.
| buffer | Vertex buffer ID to update |
| offset | Offset in bytes from the start of the buffer |
| data | Pointer to the source data |
| size | Size of subsegment to update in bytes |
| void update | ( | float | delta | ) |
A user-implemented function that is called each frame and should update/redraw the scene.
| delta | Time elapsed since the last frame in seconds. You should multiply all the scene movements by this value in order to make your scene framerate independent |