44 bool create(glm::vec<2, int>
const& size, uint32_t levels = 1);
45 bool create(SDL_Surface* surface, uint32_t levels = 1);
48 [[nodiscard]] SDL_Surface* copyToSurface()
const;
50 void update(SDL_Surface* surface, glm::vec<2, int>
const& offset);
51 void update(
TextureImage const& textureImage, glm::vec<2, int>
const& offset);
52 void update(
void* buffer, std::size_t bufferSize, glm::vec<2, int>
const& size, glm::vec<2, int>
const& offset);
54 void generateMipmaps(uint32_t levels = FGE_TEXTURE_IMAGE_MIPMAPS_LEVELS_AUTO);
55 [[nodiscard]] uint32_t getMipLevels()
const;
56 void forceMipLod(
float mipLodBias,
float mipLodMin,
float mipLodMax);
58 [[nodiscard]] glm::vec<2, int>
const& getSize()
const;
59 [[nodiscard]] VkExtent2D getExtent()
const;
60 [[nodiscard]]
int getBytesPerPixel()
const;
62 [[nodiscard]] VkImage getTextureImage()
const;
63 [[nodiscard]] VmaAllocation getTextureImageAllocation()
const;
65 [[nodiscard]] VkImageView getTextureImageView()
const;
66 [[nodiscard]] VkSampler getTextureSampler()
const;
68 void setNormalizedCoordinates(
bool normalized);
69 [[nodiscard]]
bool getNormalizedCoordinates()
const;
71 void setFilter(VkFilter filter);
72 [[nodiscard]] VkFilter getFilter()
const;
76 [[nodiscard]] fge::Vector2f normalizeTextureCoords(fge::Vector2i
const& coords)
const;
79 [[nodiscard]] uint32_t getModificationCount()
const;
82 void createTextureSampler(
float mipLodBias,
float mipLodMin,
float mipLodMax);
84 VkImage g_textureImage;
85 VmaAllocation g_textureImageAllocation;
87 VkImageView g_textureImageView;
88 VkSampler g_textureSampler;
90 glm::vec<2, int> g_textureSize;
91 int g_textureBytesPerPixel;
94 bool g_normalizedCoordinates;
99 uint32_t g_modificationCount;
Definition C_contextAware.hpp:28
Vulkan context.
Definition C_context.hpp:70
Definition C_textureImage.hpp:34