MXVK Vulkan Framework 0.35.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
mxvk_wrap.graphics.Sprite3D Class Reference

Public Member Functions

None __init__ (self, "App" app, str|Path image, *, str vertex_shader="", str fragment_shader="")
 A billboard sprite rendered through MXVK's 3D command callback.
None close (self)
None queue (self, Sequence[float] position, Sequence[float] size, Sequence[float] color=(1.0, 1.0, 1.0, 1.0), float rotation=0.0)

Public Attributes

 native = None
 Load a 3D sprite owned by app.

Detailed Description

Definition at line 130 of file graphics.py.

Constructor & Destructor Documentation

◆ __init__()

None mxvk_wrap.graphics.Sprite3D.__init__ ( self,
"App" app,
str | Path image,
* ,
str vertex_shader = "",
str fragment_shader = "" )

A billboard sprite rendered through MXVK's 3D command callback.

Definition at line 133 of file graphics.py.

133 def __init__(self, app: "App", image: str | Path, *, vertex_shader: str = "", fragment_shader: str = "") -> None:
134 ## @brief Load a 3D sprite owned by @p app.
135 self.native = None
136 try:
137 self.native = app.create_sprite3d(str(image), vertex_shader, fragment_shader)
138 except Exception:
139 _abort_failed_resource(app)
140 raise
141 app.add(self)
142

Member Function Documentation

◆ close()

None mxvk_wrap.graphics.Sprite3D.close ( self)

Definition at line 147 of file graphics.py.

147 def close(self) -> None:
148 ## @brief Release 3D sprite resources and drop its native handle.
149 if self.native is not None:
150 self.native.cleanup()
151 self.native = None
152
153

◆ queue()

None mxvk_wrap.graphics.Sprite3D.queue ( self,
Sequence[float] position,
Sequence[float] size,
Sequence[float] color = (1.0, 1.0, 1.0, 1.0),
float rotation = 0.0 )

Definition at line 143 of file graphics.py.

143 def queue(self, position: Sequence[float], size: Sequence[float], color: Sequence[float] = (1.0, 1.0, 1.0, 1.0), rotation: float = 0.0) -> None:
144 ## @brief Queue one billboard draw.
145 self.native.draw(tuple(position), tuple(size), tuple(color), rotation)
146

Member Data Documentation

◆ native

mxvk_wrap.graphics.Sprite3D.native = None

Load a 3D sprite owned by app.

Definition at line 135 of file graphics.py.


The documentation for this class was generated from the following file: