MXVK Vulkan Framework 0.35.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
anonymous_namespace{mxvk_nanobind.cpp}::PythonTexture Class Reference

Public Member Functions

void close ()
uint32_t height () const
PythonTexture & operator= (const PythonTexture &)=delete
 PythonTexture (const mxvk::VulkanContext &context, const std::string &path)
 PythonTexture (const PythonTexture &)=delete
bool valid () const
uint32_t width () const
 ~PythonTexture ()

Detailed Description

Definition at line 307 of file mxvk_nanobind.cpp.

Constructor & Destructor Documentation

◆ PythonTexture() [1/2]

anonymous_namespace{mxvk_nanobind.cpp}::PythonTexture::PythonTexture ( const mxvk::VulkanContext & context,
const std::string & path )
inline

Definition at line 309 of file mxvk_nanobind.cpp.

309: device(context.device) { mxvk::create_texture_from_png(context, path, resource); }
void create_texture_from_png(const VulkanContext &context, const std::string &path, TextureResource &texture, VkFormat format=VK_FORMAT_R8G8B8A8_UNORM)
Load a PNG and upload it into a sampled 2D texture.
VkDevice device
Logical device used to create and destroy resources.

◆ ~PythonTexture()

anonymous_namespace{mxvk_nanobind.cpp}::PythonTexture::~PythonTexture ( )
inline

◆ PythonTexture() [2/2]

anonymous_namespace{mxvk_nanobind.cpp}::PythonTexture::PythonTexture ( const PythonTexture & )
delete

Member Function Documentation

◆ close()

void anonymous_namespace{mxvk_nanobind.cpp}::PythonTexture::close ( )
inline

Definition at line 315 of file mxvk_nanobind.cpp.

315 {
316 if (device != VK_NULL_HANDLE && resource.image != VK_NULL_HANDLE)
317 mxvk::destroy_texture(device, resource);
318 device = VK_NULL_HANDLE;
319 }
void destroy_texture(VkDevice device, TextureResource &texture)
Destroy every Vulkan handle owned by a TextureResource.

◆ height()

uint32_t anonymous_namespace{mxvk_nanobind.cpp}::PythonTexture::height ( ) const
inlinenodiscard

Definition at line 322 of file mxvk_nanobind.cpp.

322{ return resource.height; }

◆ operator=()

PythonTexture & anonymous_namespace{mxvk_nanobind.cpp}::PythonTexture::operator= ( const PythonTexture & )
delete

◆ valid()

bool anonymous_namespace{mxvk_nanobind.cpp}::PythonTexture::valid ( ) const
inlinenodiscard

Definition at line 323 of file mxvk_nanobind.cpp.

323{ return resource.image != VK_NULL_HANDLE; }

◆ width()

uint32_t anonymous_namespace{mxvk_nanobind.cpp}::PythonTexture::width ( ) const
inlinenodiscard

Definition at line 321 of file mxvk_nanobind.cpp.

321{ return resource.width; }

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