Added notes to documentation and adjusted OpenGL example as a workaround for the side effects of making static functions that require a context work. If the user wants to make use of both sfml-graphics and OpenGL, they should make sure sf::Texture::getMaximumSize() and/or sf::Shader::isAvailable() are called at least once before setting their final context active as those functions will cause a context switch the first time they are called.
This commit is contained in:
parent
7defb17e8c
commit
6959c1a826
3 changed files with 13 additions and 3 deletions
|
@ -486,6 +486,9 @@ public :
|
|||
/// the shader features. If it returns false, then
|
||||
/// any attempt to use sf::Shader will fail.
|
||||
///
|
||||
/// Note: The first call to this function, whether by your
|
||||
/// code or SFML will result in a context switch.
|
||||
///
|
||||
/// \return True if shaders are supported, false otherwise
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -460,6 +460,9 @@ public :
|
|||
/// You can expect a value of 512 pixels for low-end graphics
|
||||
/// card, and up to 8192 pixels or more for newer hardware.
|
||||
///
|
||||
/// Note: The first call to this function, whether by your
|
||||
/// code or SFML will result in a context switch.
|
||||
///
|
||||
/// \return Maximum size allowed for textures, in pixels
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue