Added a VertexBuffer implementation to all Drawables that were rendered via VertexArrays.
This commit is contained in:
parent
0980e90ee4
commit
4dfad062e4
6 changed files with 226 additions and 74 deletions
|
@ -32,6 +32,7 @@
|
|||
#include <SFML/Graphics/Drawable.hpp>
|
||||
#include <SFML/Graphics/Transformable.hpp>
|
||||
#include <SFML/Graphics/VertexArray.hpp>
|
||||
#include <SFML/Graphics/VertexBuffer.hpp>
|
||||
#include <SFML/System/Vector2.hpp>
|
||||
|
||||
|
||||
|
@ -305,15 +306,17 @@ private:
|
|||
////////////////////////////////////////////////////////////
|
||||
// Member data
|
||||
////////////////////////////////////////////////////////////
|
||||
const Texture* m_texture; ///< Texture of the shape
|
||||
IntRect m_textureRect; ///< Rectangle defining the area of the source texture to display
|
||||
Color m_fillColor; ///< Fill color
|
||||
Color m_outlineColor; ///< Outline color
|
||||
float m_outlineThickness; ///< Thickness of the shape's outline
|
||||
VertexArray m_vertices; ///< Vertex array containing the fill geometry
|
||||
VertexArray m_outlineVertices; ///< Vertex array containing the outline geometry
|
||||
FloatRect m_insideBounds; ///< Bounding rectangle of the inside (fill)
|
||||
FloatRect m_bounds; ///< Bounding rectangle of the whole shape (outline + fill)
|
||||
const Texture* m_texture; ///< Texture of the shape
|
||||
IntRect m_textureRect; ///< Rectangle defining the area of the source texture to display
|
||||
Color m_fillColor; ///< Fill color
|
||||
Color m_outlineColor; ///< Outline color
|
||||
float m_outlineThickness; ///< Thickness of the shape's outline
|
||||
VertexArray m_vertices; ///< Vertex array containing the fill geometry
|
||||
VertexArray m_outlineVertices; ///< Vertex array containing the outline geometry
|
||||
VertexBuffer m_verticesBuffer; ///< Vertex buffer containing the fill geometry
|
||||
VertexBuffer m_outlineVerticesBuffer; ///< Vertex buffer containing the outline geometry
|
||||
FloatRect m_insideBounds; ///< Bounding rectangle of the inside (fill)
|
||||
FloatRect m_bounds; ///< Bounding rectangle of the whole shape (outline + fill)
|
||||
};
|
||||
|
||||
} // namespace sf
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include <SFML/Graphics/Transformable.hpp>
|
||||
#include <SFML/Graphics/Vertex.hpp>
|
||||
#include <SFML/Graphics/Rect.hpp>
|
||||
#include <SFML/Graphics/VertexBuffer.hpp>
|
||||
|
||||
|
||||
namespace sf
|
||||
|
@ -215,9 +216,10 @@ private:
|
|||
////////////////////////////////////////////////////////////
|
||||
// Member data
|
||||
////////////////////////////////////////////////////////////
|
||||
Vertex m_vertices[4]; ///< Vertices defining the sprite's geometry
|
||||
const Texture* m_texture; ///< Texture of the sprite
|
||||
IntRect m_textureRect; ///< Rectangle defining the area of the source texture to display
|
||||
Vertex m_vertices[4]; ///< Vertices defining the sprite's geometry
|
||||
VertexBuffer m_verticesBuffer; ///< Vertex buffer containing the sprite's geometry
|
||||
const Texture* m_texture; ///< Texture of the sprite
|
||||
IntRect m_textureRect; ///< Rectangle defining the area of the source texture to display
|
||||
};
|
||||
|
||||
} // namespace sf
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include <SFML/Graphics/Font.hpp>
|
||||
#include <SFML/Graphics/Rect.hpp>
|
||||
#include <SFML/Graphics/VertexArray.hpp>
|
||||
#include <SFML/Graphics/VertexBuffer.hpp>
|
||||
#include <SFML/System/String.hpp>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
@ -435,20 +436,22 @@ private:
|
|||
////////////////////////////////////////////////////////////
|
||||
// Member data
|
||||
////////////////////////////////////////////////////////////
|
||||
String m_string; ///< String to display
|
||||
const Font* m_font; ///< Font used to display the string
|
||||
unsigned int m_characterSize; ///< Base size of characters, in pixels
|
||||
float m_letterSpacingFactor; ///< Spacing factor between letters
|
||||
float m_lineSpacingFactor; ///< Spacing factor between lines
|
||||
Uint32 m_style; ///< Text style (see Style enum)
|
||||
Color m_fillColor; ///< Text fill color
|
||||
Color m_outlineColor; ///< Text outline color
|
||||
float m_outlineThickness; ///< Thickness of the text's outline
|
||||
mutable VertexArray m_vertices; ///< Vertex array containing the fill geometry
|
||||
mutable VertexArray m_outlineVertices; ///< Vertex array containing the outline geometry
|
||||
mutable FloatRect m_bounds; ///< Bounding rectangle of the text (in local coordinates)
|
||||
mutable bool m_geometryNeedUpdate; ///< Does the geometry need to be recomputed?
|
||||
mutable Uint64 m_fontTextureId; ///< The font texture id
|
||||
String m_string; ///< String to display
|
||||
const Font* m_font; ///< Font used to display the string
|
||||
unsigned int m_characterSize; ///< Base size of characters, in pixels
|
||||
float m_letterSpacingFactor; ///< Spacing factor between letters
|
||||
float m_lineSpacingFactor; ///< Spacing factor between lines
|
||||
Uint32 m_style; ///< Text style (see Style enum)
|
||||
Color m_fillColor; ///< Text fill color
|
||||
Color m_outlineColor; ///< Text outline color
|
||||
float m_outlineThickness; ///< Thickness of the text's outline
|
||||
mutable VertexArray m_vertices; ///< Vertex array containing the fill geometry
|
||||
mutable VertexArray m_outlineVertices; ///< Vertex array containing the outline geometry
|
||||
mutable VertexBuffer m_verticesBuffer; ///< Vertex buffer containing the fill geometry
|
||||
mutable VertexBuffer m_outlineVerticesBuffer; ///< Vertex buffer containing the outline geometry
|
||||
mutable FloatRect m_bounds; ///< Bounding rectangle of the text (in local coordinates)
|
||||
mutable bool m_geometryNeedUpdate; ///< Does the geometry need to be recomputed?
|
||||
mutable Uint64 m_fontTextureId; ///< The font texture id
|
||||
};
|
||||
|
||||
} // namespace sf
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue