mirror of
https://github.com/glest/glest-source.git
synced 2025-08-14 12:23:59 +02:00
- added some initial work to support FBO (frame buffer objects)
- added many NULL check guards throughout the code - added a safe mutex around ptr access of background thread on custom menu
This commit is contained in:
@@ -25,10 +25,29 @@ namespace Shared{ namespace Graphics{ namespace Gl{
|
||||
class TextureGl {
|
||||
protected:
|
||||
GLuint handle;
|
||||
GLuint renderBufferId;
|
||||
GLuint frameBufferId;
|
||||
|
||||
public:
|
||||
TextureGl();
|
||||
GLuint getHandle() const {return handle;}
|
||||
virtual ~TextureGl();
|
||||
|
||||
GLuint getHandle() const {return handle;}
|
||||
GLuint getRenderBufferHandle() const {return renderBufferId;}
|
||||
GLuint getFrameBufferHandle() const {return frameBufferId;}
|
||||
|
||||
void initRenderBuffer();
|
||||
void initFrameBuffer();
|
||||
void attachRenderBuffer();
|
||||
void attachFrameBufferToTexture();
|
||||
bool checkFrameBufferStatus();
|
||||
void dettachFrameBufferFromTexture();
|
||||
|
||||
void setup_FBO_RBO();
|
||||
void teardown_FBO_RBO();
|
||||
|
||||
virtual int getTextureWidth() const = 0;
|
||||
virtual int getTextureHeight() const = 0;
|
||||
|
||||
void OutputTextureDebugInfo(Texture::Format format, int components, const string path,uint64 rawSize,GLenum texType);
|
||||
};
|
||||
@@ -44,6 +63,9 @@ public:
|
||||
|
||||
virtual void init(Filter filter, int maxAnisotropy= 1);
|
||||
virtual void end(bool deletePixelBuffer=true);
|
||||
|
||||
virtual int getTextureWidth() const { return Texture1D::getTextureWidth();}
|
||||
virtual int getTextureHeight() const { return Texture1D::getTextureHeight();}
|
||||
};
|
||||
|
||||
// =====================================================
|
||||
@@ -57,6 +79,9 @@ public:
|
||||
|
||||
virtual void init(Filter filter, int maxAnisotropy= 1);
|
||||
virtual void end(bool deletePixelBuffer=true);
|
||||
|
||||
virtual int getTextureWidth() const { return Texture2D::getTextureWidth();}
|
||||
virtual int getTextureHeight() const { return Texture2D::getTextureHeight();}
|
||||
};
|
||||
|
||||
// =====================================================
|
||||
@@ -71,6 +96,9 @@ public:
|
||||
|
||||
virtual void init(Filter filter, int maxAnisotropy= 1);
|
||||
virtual void end(bool deletePixelBuffer=true);
|
||||
|
||||
virtual int getTextureWidth() const { return Texture3D::getTextureWidth();}
|
||||
virtual int getTextureHeight() const { return Texture3D::getTextureHeight();}
|
||||
};
|
||||
|
||||
// =====================================================
|
||||
@@ -85,6 +113,10 @@ public:
|
||||
|
||||
virtual void init(Filter filter, int maxAnisotropy= 1);
|
||||
virtual void end(bool deletePixelBuffer=true);
|
||||
|
||||
virtual int getTextureWidth() const { return TextureCube::getTextureWidth();}
|
||||
virtual int getTextureHeight() const { return TextureCube::getTextureHeight();}
|
||||
|
||||
};
|
||||
|
||||
}}}//end namespace
|
||||
|
@@ -95,7 +95,7 @@ public:
|
||||
// class Texture1D
|
||||
// =====================================================
|
||||
|
||||
class Texture1D: public Texture{
|
||||
class Texture1D: public Texture {
|
||||
protected:
|
||||
Pixmap1D pixmap;
|
||||
|
||||
@@ -107,6 +107,10 @@ public:
|
||||
virtual string getPath() const;
|
||||
virtual void deletePixels();
|
||||
virtual uint64 getPixelByteCount() const {return pixmap.getPixelByteCount();}
|
||||
|
||||
virtual int getTextureWidth() const {return pixmap.getW();}
|
||||
virtual int getTextureHeight() const {return -1;}
|
||||
|
||||
};
|
||||
|
||||
// =====================================================
|
||||
@@ -125,13 +129,16 @@ public:
|
||||
virtual string getPath() const;
|
||||
virtual void deletePixels();
|
||||
virtual uint64 getPixelByteCount() const {return pixmap.getPixelByteCount();}
|
||||
|
||||
virtual int getTextureWidth() const {return pixmap.getW();}
|
||||
virtual int getTextureHeight() const {return pixmap.getH();}
|
||||
};
|
||||
|
||||
// =====================================================
|
||||
// class Texture3D
|
||||
// =====================================================
|
||||
|
||||
class Texture3D: public Texture{
|
||||
class Texture3D: public Texture {
|
||||
protected:
|
||||
Pixmap3D pixmap;
|
||||
|
||||
@@ -143,6 +150,9 @@ public:
|
||||
virtual string getPath() const;
|
||||
virtual void deletePixels();
|
||||
virtual uint64 getPixelByteCount() const {return pixmap.getPixelByteCount();}
|
||||
|
||||
virtual int getTextureWidth() const {return pixmap.getW();}
|
||||
virtual int getTextureHeight() const {return pixmap.getH();}
|
||||
};
|
||||
|
||||
// =====================================================
|
||||
@@ -161,6 +171,9 @@ public:
|
||||
virtual string getPath() const;
|
||||
virtual void deletePixels();
|
||||
virtual uint64 getPixelByteCount() const {return pixmap.getPixelByteCount();}
|
||||
|
||||
virtual int getTextureWidth() const {return -1;}
|
||||
virtual int getTextureHeight() const {return -1;}
|
||||
};
|
||||
|
||||
}}//end namespace
|
||||
|
Reference in New Issue
Block a user