Add getGPUHandler for backend::Texture for some purpose use

This commit is contained in:
halx99 2020-09-02 13:00:32 +08:00
parent 8ec6df624e
commit ff3becb49d
2 changed files with 5 additions and 0 deletions

View File

@ -107,6 +107,8 @@ public:
virtual int getCount() const { return 1; }; virtual int getCount() const { return 1; };
virtual uintptr_t getGPUHandler(int index = 0) const { return 0; }
protected: protected:
/** /**
* @param descriptor Specifies the texture descirptor. * @param descriptor Specifies the texture descirptor.

View File

@ -69,6 +69,7 @@ struct TextureInfoGL
/// <param name="index">the index in meta textrues</param> /// <param name="index">the index in meta textrues</param>
/// <param name="target">the target GL_TEXTURE_2D,GL_TEXTURE_CUBE_MAP</param> /// <param name="target">the target GL_TEXTURE_2D,GL_TEXTURE_CUBE_MAP</param>
void apply(int slot, int index, GLenum target) const; void apply(int slot, int index, GLenum target) const;
GLuint getName(int index) const { return textures[0]; }
GLint magFilterGL = GL_LINEAR; GLint magFilterGL = GL_LINEAR;
GLint minFilterGL = GL_LINEAR; GLint minFilterGL = GL_LINEAR;
@ -183,6 +184,8 @@ public:
int getCount() const override { return _textureInfo.maxIdx + 1; } int getCount() const override { return _textureInfo.maxIdx + 1; }
uintptr_t getGPUHandler(int index) const override { return _textureInfo.getName(index); }
private: private:
void initWithZeros(); void initWithZeros();