KRTexture::createGLTexture renamed to createGPUTexture. Updated all child classes.
This commit is contained in:
@@ -110,7 +110,7 @@ void KRTexture::resize(int max_dim)
|
|||||||
getContext().getTextureManager()->memoryChanged(m_newTextureMemUsed);
|
getContext().getTextureManager()->memoryChanged(m_newTextureMemUsed);
|
||||||
getContext().getTextureManager()->addMemoryTransferredThisFrame(m_newTextureMemUsed);
|
getContext().getTextureManager()->addMemoryTransferredThisFrame(m_newTextureMemUsed);
|
||||||
|
|
||||||
if(!createGLTexture(target_dim)) {
|
if(!createGPUTexture(target_dim)) {
|
||||||
getContext().getTextureManager()->memoryChanged(-m_newTextureMemUsed);
|
getContext().getTextureManager()->memoryChanged(-m_newTextureMemUsed);
|
||||||
m_newTextureMemUsed = 0;
|
m_newTextureMemUsed = 0;
|
||||||
assert(false); // Failed to create the texture
|
assert(false); // Failed to create the texture
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public:
|
|||||||
void _swapHandles();
|
void _swapHandles();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool createGLTexture(int lod_max_dim) = 0;
|
virtual bool createGPUTexture(int lod_max_dim) = 0;
|
||||||
GLuint getHandle();
|
GLuint getHandle();
|
||||||
|
|
||||||
struct TextureHandle {
|
struct TextureHandle {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ KRTexture2D::~KRTexture2D() {
|
|||||||
delete m_pData;
|
delete m_pData;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool KRTexture2D::createGLTexture(int lod_max_dim) {
|
bool KRTexture2D::createGPUTexture(int lod_max_dim) {
|
||||||
if (m_haveNewHandles) {
|
if (m_haveNewHandles) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,5 +52,5 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
KRDataBlock *m_pData;
|
KRDataBlock *m_pData;
|
||||||
|
|
||||||
virtual bool createGLTexture(int lod_max_dim);
|
bool createGPUTexture(int lod_max_dim) override;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ KRTextureAnimated::~KRTextureAnimated()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool KRTextureAnimated::createGLTexture(int lod_max_dim)
|
bool KRTextureAnimated::createGPUTexture(int lod_max_dim)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public:
|
|||||||
virtual void resize(int max_dim);
|
virtual void resize(int max_dim);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual bool createGLTexture(int lod_max_dim);
|
bool createGPUTexture(int lod_max_dim) override;
|
||||||
|
|
||||||
float m_frame_rate;
|
float m_frame_rate;
|
||||||
int m_frame_count;
|
int m_frame_count;
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ KRTextureCube::~KRTextureCube()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool KRTextureCube::createGLTexture(int lod_max_dim)
|
bool KRTextureCube::createGPUTexture(int lod_max_dim)
|
||||||
{
|
{
|
||||||
assert(m_iNewHandle == m_iHandle); // Only allow one resize per frame
|
assert(m_iNewHandle == m_iHandle); // Only allow one resize per frame
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public:
|
|||||||
// virtual void resetPoolExpiry(float lodCoverage, texture_usage_t textureUsage);
|
// virtual void resetPoolExpiry(float lodCoverage, texture_usage_t textureUsage);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual bool createGLTexture(int lod_max_dim);
|
bool createGPUTexture(int lod_max_dim) override;
|
||||||
|
|
||||||
const GLenum TARGETS[6] = {
|
const GLenum TARGETS[6] = {
|
||||||
GL_TEXTURE_CUBE_MAP_POSITIVE_X,
|
GL_TEXTURE_CUBE_MAP_POSITIVE_X,
|
||||||
|
|||||||
Reference in New Issue
Block a user