Skip to content

Conversation

@CoreySelover
Copy link

This PR is an attempt to update Candle for use with SFML3. Most of the changes were minor, with the exception of refactoring sf::VertexArrays that were relying on sf::Quad (deprecated and removed) to instead use sf::PrimitiveType::Triangles.

I also updated the CMakeLists.txt file to be a more modern approach, but my Cmake knowledge is limited and I am definitely not 100% certain it's correct.

@MiguelMJ
Copy link
Owner

MiguelMJ commented Jun 4, 2025

Thanks a lot! This is a great contribution. I've been a bit busy to review it but I'll do it soon.

Copy link
Owner

@MiguelMJ MiguelMJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried to compile it and it goes well with CMake but I've had to change the -std option to use C++17 when using Makefile (and also remove -lsfml-audio, but that was my bad).

Also I had to make a small change in LightSource.cpp:15 because I guess you didn't try out the DEBUG mode (don't worry, I didn't expect it 😅 )

However, after compiling, I get the following error when trying to run the demo (both in release and debug):

demo: /home/miguelmj/Candle-SFML3/build/_deps/sfml-src/src/SFML/Graphics/VertexArray.cpp:52: sf::Vertex& sf::VertexArray::operator[](std::size_t): Assertion `index < m_vertices.size() && "Index is out of bounds"' failed.
Aborted (core dumped)

Does this happen to you? Any ideas where the bad access can be?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have much knowledge of CMake either (it was incorporated in #1 by @Madour) so this file will pass as it is

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This piece of README should be removed, but I'll keep it in mind to check if there's something that should be updated in the documentation.

@CoreySelover
Copy link
Author

I will give it a shot and see if I get the same error in the next couple days!

@CoreySelover
Copy link
Author

CoreySelover commented Jun 9, 2025

Ah. I am indeed getting that error as well. I will see if I can figure it out! I would guess it has to do with some decisions I made when replacing sf::uint (deprecated) with std::uint_16t. I may just need to up those to 32s or something.

@CoreySelover
Copy link
Author

Ok, demo is running! It definitely looks a little wonky, almost certainly due to the conversion from quads to triangles. We might just need to draw the triangle vertices in a different order or something?

@eXpl0it3r
Copy link

Looks like @gamepopper has also done an SFML 3 update, see here: https://github.com/gamepopper/Candle

@MiguelMJ
Copy link
Owner

Hello! I'll be unable to review these changes for some weeks, sorry!

Until I try the demo I don't know if the glitch problem is because of the triangle order (which sounds reasonable). If any progress is made along those lines, comment and I'll keep it in mind when I can review all of this.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants