Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix const correctness issues #382

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/CSFML/Graphics/VertexArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ CSFML_GRAPHICS_API void sfVertexArray_setPrimitiveType(sfVertexArray* vertexArra
/// \return Primitive type
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfPrimitiveType sfVertexArray_getPrimitiveType(sfVertexArray* vertexArray);
CSFML_GRAPHICS_API sfPrimitiveType sfVertexArray_getPrimitiveType(const sfVertexArray* vertexArray);

////////////////////////////////////////////////////////////
/// \brief Compute the bounding rectangle of a vertex array
Expand All @@ -163,4 +163,4 @@ CSFML_GRAPHICS_API sfPrimitiveType sfVertexArray_getPrimitiveType(sfVertexArray*
/// \return Bounding rectangle of the vertex array
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfFloatRect sfVertexArray_getBounds(sfVertexArray* vertexArray);
CSFML_GRAPHICS_API sfFloatRect sfVertexArray_getBounds(const sfVertexArray* vertexArray);
2 changes: 1 addition & 1 deletion include/CSFML/Graphics/VertexBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ CSFML_GRAPHICS_API void sfVertexBuffer_swap(sfVertexBuffer* left, sfVertexBuffer
/// \return OpenGL handle of the vertex buffer or 0 if not yet created
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API unsigned int sfVertexBuffer_getNativeHandle(sfVertexBuffer* vertexBuffer);
CSFML_GRAPHICS_API unsigned int sfVertexBuffer_getNativeHandle(const sfVertexBuffer* vertexBuffer);

////////////////////////////////////////////////////////////
/// \brief Set the type of primitives to draw
Expand Down
4 changes: 2 additions & 2 deletions src/CSFML/Graphics/VertexArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ void sfVertexArray_setPrimitiveType(sfVertexArray* vertexArray, sfPrimitiveType


////////////////////////////////////////////////////////////
sfPrimitiveType sfVertexArray_getPrimitiveType(sfVertexArray* vertexArray)
sfPrimitiveType sfVertexArray_getPrimitiveType(const sfVertexArray* vertexArray)
{
assert(vertexArray);
return static_cast<sfPrimitiveType>(vertexArray->getPrimitiveType());
}


////////////////////////////////////////////////////////////
sfFloatRect sfVertexArray_getBounds(sfVertexArray* vertexArray)
sfFloatRect sfVertexArray_getBounds(const sfVertexArray* vertexArray)
{
assert(vertexArray);
return convertRect(vertexArray->getBounds());
Expand Down
2 changes: 1 addition & 1 deletion src/CSFML/Graphics/VertexBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void sfVertexBuffer_swap(sfVertexBuffer* left, sfVertexBuffer* right)


////////////////////////////////////////////////////////////
unsigned int sfVertexBuffer_getNativeHandle(sfVertexBuffer* vertexBuffer)
unsigned int sfVertexBuffer_getNativeHandle(const sfVertexBuffer* vertexBuffer)
{
assert(vertexBuffer);
return vertexBuffer->getNativeHandle();
Expand Down
Loading