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

Enable SFML implementation of vertex_cache #70

Open
cschreib opened this issue Jul 5, 2021 · 2 comments
Open

Enable SFML implementation of vertex_cache #70

cschreib opened this issue Jul 5, 2021 · 2 comments
Labels
enhancement sfml Related to SFML implementation upstream
Milestone

Comments

@cschreib
Copy link
Owner

cschreib commented Jul 5, 2021

SFML has an implementation for vertex_cache, but this is currently disabled because the implementation is not working correctly. The reason is that SFML requires texture coordinates in pixels, while lxgui uses normalised coordinates throughout. The conversion was handled on-the-fly for simple quads, but this isn't possible with vertex_cache (it would ruin all the benefits of using a cache in the first place).

I have submitted a PR to SFML to add support for normalised coordinates, which was partly available but not fully exposed to the user: SFML/SFML#1807. In lxgui, the branch https://github.com/cschreib/lxgui/tree/vertex_cache_sfml makes use of this patched SFML to enable vertex_cache in the SFML implementation, which then works perfectly fine and improves performance of text rendering.

@cschreib cschreib added enhancement sfml Related to SFML implementation labels Jul 5, 2021
@cschreib cschreib added this to the v2.x milestone Jul 5, 2021
@cschreib
Copy link
Owner Author

cschreib commented Oct 9, 2021

If the PR is merged, or if using a custom build of SFML, the SFML implementation of vertex_cache can now be turned on by defining the macro SFML_HAS_NORMALISED_COORDINATES_VBO when building lxgui.

@cschreib
Copy link
Owner Author

Upstream has merged the changes, they should be in SFML v3.0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement sfml Related to SFML implementation upstream
Projects
None yet
Development

No branches or pull requests

1 participant