Implemented the new graphics API:
- Removed the internal classes sf::Renderer and sf::Matrix3 - Split sf::Drawable into sf::Drawable and sf::Transformable - Added sf::Transform - Added sf::Vertex - Added sf::VertexArray - Types of shapes are now handled with their own derived class - Modified the Pong example
This commit is contained in:
parent
541509d2a7
commit
5bae08a2d8
65 changed files with 4756 additions and 3326 deletions
|
@ -58,9 +58,9 @@ public :
|
|||
}
|
||||
|
||||
// Get the current shader
|
||||
const sf::Shader& GetShader() const
|
||||
const sf::Shader* GetShader() const
|
||||
{
|
||||
return myIterator->second;
|
||||
return &myIterator->second;
|
||||
}
|
||||
|
||||
private :
|
||||
|
@ -144,8 +144,8 @@ int main()
|
|||
sf::Text shaderStr;
|
||||
shaderStr.SetFont(font);
|
||||
shaderStr.SetCharacterSize(20);
|
||||
shaderStr.SetPosition(5.f, 0.f);
|
||||
shaderStr.SetColor(sf::Color(250, 100, 30));
|
||||
shaderStr.SetPosition(5.f, 0.f);
|
||||
shaderStr.SetString("Background shader: \"" + backgroundShader.GetName() + "\"\n"
|
||||
"Flower shader: \"" + entityShader.GetName() + "\"\n"
|
||||
"Global shader: \"" + globalShader.GetName() + "\"\n");
|
||||
|
@ -154,8 +154,8 @@ int main()
|
|||
sf::Text infoStr;
|
||||
infoStr.SetFont(font);
|
||||
infoStr.SetCharacterSize(20);
|
||||
infoStr.SetPosition(5.f, 500.f);
|
||||
infoStr.SetColor(sf::Color(250, 100, 30));
|
||||
infoStr.SetPosition(5.f, 500.f);
|
||||
infoStr.SetString("Move your mouse to change the shaders' parameters\n"
|
||||
"Press numpad 1/4 to change the background shader\n"
|
||||
"Press numpad 2/5 to change the flower shader\n"
|
||||
|
@ -249,8 +249,8 @@ void DisplayError()
|
|||
|
||||
// Define a string for displaying the error message
|
||||
sf::Text error("Sorry, your system doesn't support shaders");
|
||||
error.SetPosition(100.f, 250.f);
|
||||
error.SetColor(sf::Color(200, 100, 150));
|
||||
error.SetPosition(100.f, 250.f);
|
||||
|
||||
// Start the game loop
|
||||
while (window.IsOpened())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue