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

Implement most CSFML 2.6.0 features #243

Merged
merged 13 commits into from
Feb 23, 2024

Conversation

Marioalexsan
Copy link
Contributor

This PR aims to implement most things from CSFML 2.6.0, along with some stuff that might be missing from CSFML 2.5.2.

Change list from 2.6.0:

  • sfFont_setSmooth / sfFont_isSmooth
  • sfBlendMin & sfBlendMax
  • sfFloatRect_getPosition/sfIntRect_getPosition & sfFloatRect_getSize/sfIntRect_getSize
  • Document MP3 support
  • Add directional arrow resize cursors
  • sfFont_getBoldKerning
  • Add sf::Vulkan functions (partial)
  • Add scancode support (partial)
  • sfRenderTexture_isSrgb / sfRenderWindow_isSrgb
  • sfImage_saveToMemory with sfBuffer
  • sf::WindowBase

Other things which were done in this PR (probably missing from CSFML 2.5.2?):

  • drawVertexBufferRange implementations from CSFML
  • TextureCoordinateType implementation
  • sRGB creation functions
  • sfContext_isExtensionAvailable and sfContext_getFunction
  • sfWindowBase_createVulkanSurface
  • some other stuff I probably missed

Features which were not done due to issues:

  • sfVulkan_getGraphicsRequiredInstanceExtensions - needs a CSFML release containing CSFML#229
  • sfKeyboard_getDescription - this function returns an owning C pointer (const char*). I'm not sure how to handle the deallocation for it since there's no corresponding function to free the string

By the looks of it, this PR might overlap / conflict with #236, #239, #240, and maybe #238.

This PR is a mess and I don't expect it to pass first inspection, so any feedback is welcome.

@eXpl0it3r eXpl0it3r added the Feature New functionality or extending of an existing one label Feb 16, 2024
@Marioalexsan
Copy link
Contributor Author

Rebased from master

Copy link
Member

@eXpl0it3r eXpl0it3r left a comment

Choose a reason for hiding this comment

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

Some small var changes

src/SFML.Graphics/Image.cs Outdated Show resolved Hide resolved
src/SFML.System/Buffer.cs Outdated Show resolved Hide resolved
src/SFML.System/Buffer.cs Outdated Show resolved Hide resolved
src/SFML.System/Buffer.cs Outdated Show resolved Hide resolved
src/SFML.Window/WindowBase.cs Outdated Show resolved Hide resolved
src/SFML.Window/WindowBase.cs Outdated Show resolved Hide resolved
src/SFML.Window/WindowBase.cs Show resolved Hide resolved
@DemoXinMC
Copy link
Contributor

Is there some benefit to wrapping WindowBase that I'm missing? It's not extensible from C# as it's basically used as an interface in SFML.

Also, I realize that var is pretty acceptable to use, but we're using explicit IntPtr throughout most of the wrapping IIRC. Does it make sense to switch to var right now on this PR?

@Marioalexsan
Copy link
Contributor Author

WindowBase is not quite an interface from what I understand. It's supposed to be a very basic window so one can use OpenGL, Vulkan etc. on top of it without SFML intervening.

@eXpl0it3r
Copy link
Member

Is there some benefit to wrapping WindowBase that I'm missing? It's not extensible from C# as it's basically used as an interface in SFML.

What do you mean with "wrapping". The point of WindowBase is to create a window without OpenGL context.
It's probably not as useful since it's tricky to use pure OpenGL or Vulkan in C#

Also, I realize that var is pretty acceptable to use, but we're using explicit IntPtr throughout most of the wrapping IIRC. Does it make sense to switch to var right now on this PR?

I wouldn't change it on this PR, it's already mixing a lot of things.

Copy link
Member

@eXpl0it3r eXpl0it3r left a comment

Choose a reason for hiding this comment

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

LGTM

@eXpl0it3r eXpl0it3r merged commit c22f119 into SFML:master Feb 23, 2024
15 checks passed
@eXpl0it3r
Copy link
Member

Thank you for implementing this all! 🙂

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.

None yet

3 participants