2
0
dmuratshin 9 жил өмнө
parent
commit
10ba0cd1f0

+ 7 - 0
oxygine/src/Image.cpp

@@ -810,6 +810,13 @@ namespace oxygine
 
 
     }
     }
 
 
+    void Image::toPOT(Image& dest)
+    {
+        dest.init(nextPOT(_image.w), nextPOT(_image.h), _image.format);
+        dest.fill_zero();
+        dest.updateRegion(0, 0, _image);
+    }
+
     void Image::updateRegion(int x, int y, const ImageData& src)
     void Image::updateRegion(int x, int y, const ImageData& src)
     {
     {
         Rect r(x, y, src.w, src.h);
         Rect r(x, y, src.w, src.h);

+ 1 - 0
oxygine/src/Image.h

@@ -47,6 +47,7 @@ namespace oxygine
         ImageData   lock(const Rect* pRect);
         ImageData   lock(const Rect* pRect);
         ImageData   lock(const Rect& pRect);
         ImageData   lock(const Rect& pRect);
         void        unlock();
         void        unlock();
+        void        toPOT(Image& dest);
 
 
         void        updateRegion(int x, int y, const ImageData& data);
         void        updateRegion(int x, int y, const ImageData& data);
         void        apply(const Rect*);
         void        apply(const Rect*);

+ 2 - 1
oxygine/src/core/gl/NativeTextureGLES.cpp

@@ -226,6 +226,7 @@ namespace oxygine
             NativeTextureGLES::created--;
             NativeTextureGLES::created--;
             glDeleteTextures(1, (GLuint*)&_id);
             glDeleteTextures(1, (GLuint*)&_id);
             _id = 0;
             _id = 0;
+            CHECKGL();
         }
         }
 
 
 
 
@@ -233,10 +234,10 @@ namespace oxygine
         {
         {
             oxglDeleteFramebuffers(1, (GLuint*)&_fbo);
             oxglDeleteFramebuffers(1, (GLuint*)&_fbo);
             _fbo = 0;
             _fbo = 0;
+            CHECKGL();
         }
         }
 
 
         unreg();
         unreg();
-        CHECKGL();
     }
     }