Expand description
Wrapper of FNA3D, the graphics library for FNA
See fna3h as an alternative.
See examples to get started.
§What is fna3d?
fna3d is a wrapper around fna3d-sys, which is Rust FFI to FNA3D generated with bindgen.
FNA3D is the 3D graphics library for FNA written in C99 in 2020. FNA is a reimplementation of XNA. XNA is a famous game framework.
§What does Rust-FNA3D do?
Device is reference counted and it drops FNA3D device when they go out of scope.
Other changes are trivial; they’re just for improvements to the default output of bindgen:
- Wrapping the original API with rusty types: slices, enums and booleans
- Wrapping some legacy API (XNA-compatibility API) with more meaningful one
Details are noted in this file on GitHub.
Re-exports§
Modules§
Structs§
- Blend
State - Clear
Options Device::clearparameter, which specifies the buffers for clearing- Color
- 24 bits RGBA color
- Depth
Stencil State - Pipeline
- Device
- FNA3D device
- Rasterizer
State - Pipeline
- Render
Target Binding - Offscreen rendering
- Sampler
State - Specifies texture sampling method
- SdlWindow
Flags - Newtype of untyped SDL_WindowFlags, which is used for SDL_CreateWindow
Enums§
- Blend
BlendStatecomponent, which specifies blend mode- Blend
Function BlendStatecomponent, which specifies color blending function (expression)- Buffer
Usage - Vertex/index buffer component, which hints optimization of memory placement
- Color
Write Channels BlendStatecomponent, which specifies color channels for render target blending operations- Compare
Function DepthStencilStatecomponent, which specifies comparison operator for depth testing- Cube
MapFace - Cube map texture data component
- Cull
Mode RasterizerStatecomponent- Depth
Format PresentationParameterscomponent,Renderbufferattribute- Display
Orientation PresentationParameterscomponent- Fill
Mode RasterizerStatecomponent- Index
Element Size - 16 bits | 32 bits
- Present
Interval PresentationParameterscomponent- Primitive
Type - Specifies primitive type used for drawing
- Render
Target Type - 2D | Cube
- Render
Target Usage PresentationParameterscomponent,Renderbufferattribute- SetData
Options - How vertex or index buffer data will be flushed during a SetData operation.
- Stencil
Operation DepthStencilStatecomponent- Surface
Format TextureorRenderbufferpixel data format (memory layout of each pixel)- Texture
Address Mode SamplerStatecomponent, which specifies texture coordinates addressing method- Texture
Filter SamplerStatecomponent, which specifies filtering types- Vertex
Element Format VertexElementcomponent, which specifies the data type- Vertex
Element Usage VertexElementcomponent, which specifies its usage
Functions§
- get_
drawable_ size - After your window is created, call this to check for high-DPI support.
- linked_
version - Version of FNA3D in use
- prepare_
window_ attributes - Selects the most suitable graphics rendering backend for the system, then provides the application with context-sensitive bitflags for the OS window.
Type Aliases§
- Buffer
- Opaque struct that represents index or vertex buffer
- Effect
- Opaque struct that represents FNA3D effect
- Presentation
Parameters - Query
- Opaque object to run occlusion queries
- Rect
- Scissor rect or region of
Renderbuffer - Renderbuffer
- Opaque struct that represents FNA3D render buffer
- Texture
- Opaque struct that represents 2D or 3D texture data stored in GPU memory
- Vec4
- Used to represent color
- Vertex
Buffer Binding Device::apply_vertex_buffer_bindingsparameter, which describes vertex memory location and attributes- Vertex
Declaration VertexBufferBindingcomponent that declares memory layout of a vertex data- Vertex
Element VertexDeclarationcomponent that specifies an element of vertex data- Viewport
- The view bounds for render-target surface