From 7abc9f05c0ff383d5b54dbcc7927d433b397fed1 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Mon, 23 Dec 2024 14:47:16 -0600 Subject: [PATCH] Fix const correctness issues --- include/CSFML/Graphics/VertexArray.h | 4 ++-- include/CSFML/Graphics/VertexBuffer.h | 2 +- src/CSFML/Graphics/VertexArray.cpp | 4 ++-- src/CSFML/Graphics/VertexBuffer.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/CSFML/Graphics/VertexArray.h b/include/CSFML/Graphics/VertexArray.h index 5a846788..eff076d8 100644 --- a/include/CSFML/Graphics/VertexArray.h +++ b/include/CSFML/Graphics/VertexArray.h @@ -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 @@ -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); diff --git a/include/CSFML/Graphics/VertexBuffer.h b/include/CSFML/Graphics/VertexBuffer.h index 6060bc96..5fcd5842 100644 --- a/include/CSFML/Graphics/VertexBuffer.h +++ b/include/CSFML/Graphics/VertexBuffer.h @@ -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 diff --git a/src/CSFML/Graphics/VertexArray.cpp b/src/CSFML/Graphics/VertexArray.cpp index 3d09543a..487b3091 100644 --- a/src/CSFML/Graphics/VertexArray.cpp +++ b/src/CSFML/Graphics/VertexArray.cpp @@ -104,7 +104,7 @@ void sfVertexArray_setPrimitiveType(sfVertexArray* vertexArray, sfPrimitiveType //////////////////////////////////////////////////////////// -sfPrimitiveType sfVertexArray_getPrimitiveType(sfVertexArray* vertexArray) +sfPrimitiveType sfVertexArray_getPrimitiveType(const sfVertexArray* vertexArray) { assert(vertexArray); return static_cast(vertexArray->getPrimitiveType()); @@ -112,7 +112,7 @@ sfPrimitiveType sfVertexArray_getPrimitiveType(sfVertexArray* vertexArray) //////////////////////////////////////////////////////////// -sfFloatRect sfVertexArray_getBounds(sfVertexArray* vertexArray) +sfFloatRect sfVertexArray_getBounds(const sfVertexArray* vertexArray) { assert(vertexArray); return convertRect(vertexArray->getBounds()); diff --git a/src/CSFML/Graphics/VertexBuffer.cpp b/src/CSFML/Graphics/VertexBuffer.cpp index 3305ed7d..5e9ac877 100644 --- a/src/CSFML/Graphics/VertexBuffer.cpp +++ b/src/CSFML/Graphics/VertexBuffer.cpp @@ -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();