VenomEngine
Cross-Platform Modern Graphics Engine
Loading...
Searching...
No Matches
Texture.h
Go to the documentation of this file.
1
8#pragma once
9
11
12#include <venom/vulkan/Buffer.h>
13#include <venom/vulkan/Image.h>
16
17namespace venom
18{
19namespace vulkan
20{
21
23{
24public:
26
27 Image image;
28 ImageView imageView;
29};
30
32{
33public:
36
37 static VulkanTexture * GetDummyTexture();
38 static void SetDummyTexture(VulkanTexture * texture);
39
40 vc::Error LoadImage(unsigned char * pixels, int width, int height, int channels) override;
41 vc::Error LoadImageBGRA(unsigned char * pixels, int width, int height, int channels) override;
42 vc::Error LoadImage(uint16_t * pixels, int width, int height, int channels) override;
43 vc::Error _InitDepthBuffer(int width, int height) override;
44 vc::Error _CreateAttachment(int width, int height, int imageCount, vc::ShaderVertexFormat format) override;
45
46 inline bool HasTexture() const override { return _resource && GetImage().GetVkImage() != VK_NULL_HANDLE; }
47
48 inline const Image & GetImage() const { return _resource->As<VulkanTextureResource>()->image; }
49 inline Image & GetImage() { return _resource->As<VulkanTextureResource>()->image; }
50 inline const ImageView & GetImageView() const { return _resource->As<VulkanTextureResource>()->imageView; }
51 inline ImageView & GetImageView() { return _resource->As<VulkanTextureResource>()->imageView; }
52};
53
54}
55}
Definition Texture.h:38
Definition Texture.h:25
Definition Image.h:18
Definition ImageView.h:18
Definition Texture.h:32
Contains the entirety of the code of the VenomEngine project.
Definition Config.h:13