Browse Source

mipmaps for file textures

Kajetan Johannes Hammerle 3 years ago
parent
commit
c59799aa8b
4 changed files with 4 additions and 4 deletions
  1. 1 1
      rendering/FileTexture.cpp
  2. 1 1
      rendering/FileTexture.h
  3. 1 1
      wrapper/Texture.cpp
  4. 1 1
      wrapper/Texture.h

+ 1 - 1
rendering/FileTexture.cpp

@@ -2,7 +2,7 @@
 #include "images/PNGReader.h"
 #include "memory/StackAllocator.h"
 
-FileTexture::FileTexture(const char* path) {
+FileTexture::FileTexture(const char* path, int maxMipMaps) : texture(maxMipMaps) {
     PNGReader png(path);
     if(png.hasError()) {
         return;

+ 1 - 1
rendering/FileTexture.h

@@ -7,7 +7,7 @@ class FileTexture final {
     Texture texture;
 
 public:
-    FileTexture(const char* path);
+    FileTexture(const char* path, int maxMipMaps = 0);
 
     void bindTo(int index) const;
 };

+ 1 - 1
wrapper/Texture.cpp

@@ -6,7 +6,7 @@ Texture::Texture(const TextureFormat& format, int maxMipMaps) : format(format),
     setRepeatWrap();
 }
 
-Texture::Texture() : Texture(TextureFormat::unknown()) {
+Texture::Texture(int maxMipMaps) : Texture(TextureFormat::unknown(), maxMipMaps) {
 }
 
 Texture::~Texture() {

+ 1 - 1
wrapper/Texture.h

@@ -15,7 +15,7 @@ class Texture final {
 
 public:
     Texture(const TextureFormat& format, int maxMipMaps = 0);
-    Texture();
+    Texture(int maxMipMaps = 0);
     ~Texture();
     Texture(const Texture& other) = delete;
     Texture(Texture&& other) = delete;