瀏覽代碼

mipmaps for file textures

Kajetan Johannes Hammerle 3 年之前
父節點
當前提交
c59799aa8b
共有 4 個文件被更改,包括 4 次插入4 次删除
  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;