Retrieve texture width, height and type from the top-level image.

TRAC #15703 Issue=86 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@584 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent b5a3a6b6
...@@ -57,10 +57,11 @@ class Texture : public RefCountObject ...@@ -57,10 +57,11 @@ class Texture : public RefCountObject
GLenum getWrapS() const; GLenum getWrapS() const;
GLenum getWrapT() const; GLenum getWrapT() const;
GLsizei getWidth() const; virtual GLsizei getWidth() const = 0;
GLsizei getHeight() const; virtual GLsizei getHeight() const = 0;
virtual GLenum getInternalFormat() const = 0; virtual GLenum getInternalFormat() const = 0;
virtual GLenum getType() const = 0;
virtual bool isComplete() const = 0; virtual bool isComplete() const = 0;
virtual bool isCompressed() const = 0; virtual bool isCompressed() const = 0;
bool isFloatingPoint() const; bool isFloatingPoint() const;
...@@ -98,14 +99,12 @@ class Texture : public RefCountObject ...@@ -98,14 +99,12 @@ class Texture : public RefCountObject
static D3DFORMAT selectFormat(GLenum format, GLenum type); static D3DFORMAT selectFormat(GLenum format, GLenum type);
void setImage(GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *image); void setImage(GLint unpackAlignment, const void *pixels, Image *image);
bool subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *image); bool subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *image);
void setCompressedImage(GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *image); void setCompressedImage(GLsizei imageSize, const void *pixels, Image *image);
bool subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *image); bool subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *image);
void copyNonRenderable(Image *image, GLenum format, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, IDirect3DSurface9 *renderTarget); void copyNonRenderable(Image *image, GLenum format, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, IDirect3DSurface9 *renderTarget);
void needRenderTarget();
GLint creationLevels(GLsizei width, GLsizei height, GLint maxlevel) const; GLint creationLevels(GLsizei width, GLsizei height, GLint maxlevel) const;
GLint creationLevels(GLsizei size, GLint maxlevel) const; GLint creationLevels(GLsizei size, GLint maxlevel) const;
...@@ -115,15 +114,12 @@ class Texture : public RefCountObject ...@@ -115,15 +114,12 @@ class Texture : public RefCountObject
virtual void convertToRenderTarget() = 0; virtual void convertToRenderTarget() = 0;
virtual IDirect3DSurface9 *getRenderTarget(GLenum target) = 0; virtual IDirect3DSurface9 *getRenderTarget(GLenum target) = 0;
void createSurface(GLsizei width, GLsizei height, GLenum format, GLenum type, Image *image); void createSurface(Image *image);
Blit *getBlitter(); Blit *getBlitter();
int levelCount() const; int levelCount() const;
GLsizei mWidth;
GLsizei mHeight;
GLenum mMinFilter; GLenum mMinFilter;
GLenum mMagFilter; GLenum mMagFilter;
GLenum mWrapS; GLenum mWrapS;
...@@ -131,7 +127,6 @@ class Texture : public RefCountObject ...@@ -131,7 +127,6 @@ class Texture : public RefCountObject
bool mDirtyParameters; bool mDirtyParameters;
bool mIsRenderable; bool mIsRenderable;
GLenum mType;
private: private:
DISALLOW_COPY_AND_ASSIGN(Texture); DISALLOW_COPY_AND_ASSIGN(Texture);
...@@ -189,7 +184,11 @@ class Texture2D : public Texture ...@@ -189,7 +184,11 @@ class Texture2D : public Texture
~Texture2D(); ~Texture2D();
GLenum getTarget() const; GLenum getTarget() const;
GLenum getInternalFormat() const;
virtual GLsizei getWidth() const;
virtual GLsizei getHeight() const;
virtual GLenum getInternalFormat() const;
virtual GLenum getType() const;
void setImage(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels); void setImage(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels);
void setCompressedImage(GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels); void setCompressedImage(GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels);
...@@ -214,7 +213,7 @@ class Texture2D : public Texture ...@@ -214,7 +213,7 @@ class Texture2D : public Texture
virtual void convertToRenderTarget(); virtual void convertToRenderTarget();
virtual IDirect3DSurface9 *getRenderTarget(GLenum target); virtual IDirect3DSurface9 *getRenderTarget(GLenum target);
bool redefineTexture(GLint level, GLenum format, GLsizei width, GLsizei height, GLenum type); void redefineTexture(GLint level, GLenum format, GLsizei width, GLsizei height, GLenum type);
void commitRect(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height); void commitRect(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height);
Image mImageArray[IMPLEMENTATION_MAX_TEXTURE_LEVELS]; Image mImageArray[IMPLEMENTATION_MAX_TEXTURE_LEVELS];
...@@ -231,8 +230,12 @@ class TextureCubeMap : public Texture ...@@ -231,8 +230,12 @@ class TextureCubeMap : public Texture
~TextureCubeMap(); ~TextureCubeMap();
GLenum getTarget() const; virtual GLenum getTarget() const;
GLenum getInternalFormat() const;
virtual GLsizei getWidth() const;
virtual GLsizei getHeight() const;
virtual GLenum getInternalFormat() const;
virtual GLenum getType() const;
void setImagePosX(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels); void setImagePosX(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels);
void setImageNegX(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels); void setImageNegX(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels);
...@@ -272,9 +275,9 @@ class TextureCubeMap : public Texture ...@@ -272,9 +275,9 @@ class TextureCubeMap : public Texture
bool isCubeComplete() const; bool isCubeComplete() const;
void setImage(int face, GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels); void setImage(int faceIndex, GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels);
void commitRect(GLenum faceTarget, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height); void commitRect(GLenum faceTarget, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height);
bool redefineTexture(GLint level, GLenum format, GLsizei width, GLenum type); void redefineTexture(int faceIndex, GLint level, GLenum format, GLsizei width, GLsizei height, GLenum type);
Image mImageArray[6][IMPLEMENTATION_MAX_TEXTURE_LEVELS]; Image mImageArray[6][IMPLEMENTATION_MAX_TEXTURE_LEVELS];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment