diff options
| author | hachem <im@hachem.wtf> | 2026-08-20 02:19:29 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-08-20 02:32:34 +0200 |
| commit | 31f6a54d35dd13f0911f132dc60f5f0d851d7e43 (patch) | |
| tree | 75b5410d785a5acc9e435d4147f3de4989278172 /src/platform/opengl/opengl_texture.cpp | |
| parent | 0f9483ce025b015b1197b7a7efc8ed983bedbb8e (diff) | |
refactor: trailing return types in the OpenGL and Metal backends
Diffstat (limited to 'src/platform/opengl/opengl_texture.cpp')
| -rw-r--r-- | src/platform/opengl/opengl_texture.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/platform/opengl/opengl_texture.cpp b/src/platform/opengl/opengl_texture.cpp index 13125a6..9c1decf 100644 --- a/src/platform/opengl/opengl_texture.cpp +++ b/src/platform/opengl/opengl_texture.cpp @@ -54,7 +54,7 @@ namespace Donut glDeleteTextures(1, &m_renderer_id); } - void OpenGLTexture2D::set_data(void* data, uint32_t size) + auto OpenGLTexture2D::set_data(void* data, uint32_t size) -> void { uint32_t bpp = m_data_format == GL_RGBA ? 4 : 3; if (size != m_width * m_height * bpp) @@ -67,13 +67,13 @@ namespace Donut glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, m_width, m_height, m_data_format, GL_UNSIGNED_BYTE, data); } - void OpenGLTexture2D::bind(uint32_t slot) const + auto OpenGLTexture2D::bind(uint32_t slot) const -> void { glActiveTexture(GL_TEXTURE0 + slot); glBindTexture(GL_TEXTURE_2D, m_renderer_id); } - void OpenGLTexture2D::bind_as_image(uint32_t slot, bool read_only) const + auto OpenGLTexture2D::bind_as_image(uint32_t slot, bool read_only) const -> void { if (glBindImageTexture == nullptr) return; @@ -126,7 +126,7 @@ namespace Donut glDeleteTextures(1, &m_renderer_id); } - void OpenGLCubemapTexture::load_hdri(const std::string& path) + auto OpenGLCubemapTexture::load_hdri(const std::string& path) -> void { stbi_set_flip_vertically_on_load(true); int width, height, channels; @@ -157,7 +157,7 @@ namespace Donut DONUT_INFO("Successfully loaded HDRI: {} ({}x{})", path, width, height); } - void OpenGLCubemapTexture::convert_equirectangular_to_cubemap(float* hdr_data, int width, int height) + auto OpenGLCubemapTexture::convert_equirectangular_to_cubemap(float* hdr_data, int width, int height) -> void { uint32_t capture_fbo, capture_rbo; glGenFramebuffers(1, &capture_fbo); @@ -242,18 +242,18 @@ namespace Donut glDeleteRenderbuffers(1, &capture_rbo); } - void OpenGLCubemapTexture::set_data(void* data, uint32_t size) + auto OpenGLCubemapTexture::set_data(void* data, uint32_t size) -> void { - DONUT_WARN("SetData not implemented for cubemaps"); + DONUT_WARN("set_data not implemented for cubemaps"); } - void OpenGLCubemapTexture::bind(uint32_t slot) const + auto OpenGLCubemapTexture::bind(uint32_t slot) const -> void { glActiveTexture(GL_TEXTURE0 + slot); glBindTexture(GL_TEXTURE_CUBE_MAP, m_renderer_id); } - void OpenGLCubemapTexture::bind_as_image(uint32_t slot, bool read_only) const + auto OpenGLCubemapTexture::bind_as_image(uint32_t slot, bool read_only) const -> void { if (glBindImageTexture == nullptr) return; |
