Skip to content

Update to SFML 3.1.0 - #298

Open
HaSa1002 wants to merge 13 commits into
SFML:masterfrom
HaSa1002:feature/sfml-3.1
Open

HaSa1002 wants to merge 13 commits into
SFML:masterfrom
HaSa1002:feature/sfml-3.1

Conversation

@HaSa1002

@HaSa1002 HaSa1002 commented Nov 1, 2026 •

Copy link
Copy Markdown

Not fully finished but I figured I share the progress so far. Depends on SFML/CSFML#419

The text shaping stuff ate too much time (idk 3hrs probably ^^) because I fought against the Arrays as return values. The glyph callback was successful first try, though xD

I struggle a little to pull SFML.Net as a local package on my machine that's why I butchered the examples to test the features. I left them in for now.
Hopefully, I can finish the PlaybackDevice soon (like after I got some sleep).

Let me know if I forgot anything else. I'd like to get this done as I depend with a feature in my project on this release. I need these text vertex data arrays. Is the CSFML PR done or is there more work besides writing tests and examples?

I will rebase when I finished.

@eXpl0it3r eXpl0it3r added the Feature New functionality or extending of an existing one label Nov 1, 2026
@HaSa1002

HaSa1002 commented Nov 9, 2026 •

Copy link
Copy Markdown
Author

Can you verify sfPlaybackDevice_getDevice please? I don't get output after a true returning set device call (empty string)

@eXpl0it3r

Copy link
Copy Markdown
Member

I checked sfPlaybackDevice_getDevice and it works as intended, it’s just that there’s no device yet when you call it. SFML only creates the playback device while a sound is alive (Sound, Music or a SoundStream, a SoundBuffer alone isn’t enough). Until then setDevice only stores the name and returns true, and getDevice returns std::nullopt, which CSFML returns as NULL, so you get a null string, not an empty one. In your example, GetDevice() runs before PlaySound() creates any sound.

Comment thread src/SFML.Graphics/Font.cs Resolved
@HaSa1002

Copy link
Copy Markdown
Author

I see. Okay I will kind of fix the examples and check to get the rest done

@eXpl0it3r

Copy link
Copy Markdown
Member

Let me know if you need/want help fixing up things 🙂

@HaSa1002

Copy link
Copy Markdown
Author

Give me tomorrow but if I am not done by the evening, I'll happily turn it over. I think, I also need to implement that SFML/CSFML@f5f2629#diff-2c6355cf7f0794f34931096fdf0d3918b8cfe8a81144dabe2e4236d7675cb2cd, right?

@HaSa1002

Copy link
Copy Markdown
Author

The biggest thing holding me up is my time rn ^^

@HaSa1002
HaSa1002 marked this pull request as ready for review November 24, 2026 14:16
@HaSa1002

Copy link
Copy Markdown
Author

Okay, I think I got most. I can remove the local publish script and the example changes. But I figured I leave them for now

@HaSa1002
HaSa1002 requested a review from eXpl0it3r November 24, 2026 14:17

@eXpl0it3r eXpl0it3r left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some marshalling things to fix.

I tested the PlaybackDevice and it returns devices for me once a sound object exists

Comment thread src/SFML.Graphics/Text.cs
Comment on lines +142 to +146
/// <summary> Starting offset of the vertex data belonging to this glyph </summary>
public uint VertexOffset;

/// <summary> Count of vertices belonging to this glyph </summary>
public uint VertexCount;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

vertexOffset and vertexCount are size_t in CSFML, so this struct doesn't match the C one, and GetShapedGlyphs() returns garbage after the first glyph.

I'd keep uint in the public ShapedGlyph and do the same as for Font.Info by adding a private marshal struct with UIntPtr for the two fields read that in GetShapedGlyphs() and in the pre-processor callback, then convert it to ShapedGlyph.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

We could also do ulong in the public API which is more correct but probably doesn't matter because who uses text that long

Comment thread src/SFML.Graphics/Font.cs Resolved
Comment thread src/SFML.Graphics/Text.cs Resolved
Comment thread src/SFML.Graphics/Text.cs Resolved
Comment thread src/SFML.Graphics/Text.cs Resolved
Comment thread src/SFML.Audio/PlaybackDevice.cs Resolved
Comment thread src/SFML.Graphics/Shape.cs Resolved
@HaSa1002

Copy link
Copy Markdown
Author

yes the PlaybackDevices work

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

Labels

Feature New functionality or extending of an existing one

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants