mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 22:31:09 +08:00
Implemented methods to retrieve the OpenGL handles from sf::Texture and sf::Shader.
This commit is contained in:
parent
650e792350
commit
c17486857f
@ -456,6 +456,18 @@ public:
|
||||
////////////////////////////////////////////////////////////
|
||||
void setParameter(const std::string& name, CurrentTextureType);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the underlying OpenGL handle of the shader.
|
||||
///
|
||||
/// You shouldn't need to use this function, unless you have
|
||||
/// very specific stuff to implement that SFML doesn't support,
|
||||
/// or implement a temporary workaround until a bug is fixed.
|
||||
///
|
||||
/// \return OpenGL handle of the shader or 0 if not yet loaded
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int getNativeHandle() const;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Bind a shader for rendering
|
||||
///
|
||||
|
@ -420,6 +420,18 @@ public:
|
||||
////////////////////////////////////////////////////////////
|
||||
Texture& operator =(const Texture& right);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the underlying OpenGL handle of the texture.
|
||||
///
|
||||
/// You shouldn't need to use this function, unless you have
|
||||
/// very specific stuff to implement that SFML doesn't support,
|
||||
/// or implement a temporary workaround until a bug is fixed.
|
||||
///
|
||||
/// \return OpenGL handle of the texture or 0 if not yet created
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int getNativeHandle() const;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Bind a texture for rendering
|
||||
///
|
||||
|
@ -456,6 +456,13 @@ void Shader::setParameter(const std::string& name, CurrentTextureType)
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int Shader::getNativeHandle() const
|
||||
{
|
||||
return m_shaderProgram;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void Shader::bind(const Shader* shader)
|
||||
{
|
||||
@ -778,6 +785,13 @@ void Shader::setParameter(const std::string& name, CurrentTextureType)
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int Shader::getNativeHandle() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void Shader::bind(const Shader* shader)
|
||||
{
|
||||
|
@ -563,6 +563,13 @@ Texture& Texture::operator =(const Texture& right)
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int Texture::getNativeHandle() const
|
||||
{
|
||||
return m_texture;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int Texture::getValidSize(unsigned int size)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user