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

SFML.Net 3 #277

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

SFML.Net 3 #277

wants to merge 1 commit into from

Conversation

Marioalexsan
Copy link
Member

This is nowhere near ready (CSFML v3 isn't even out), but I'm making this PR to track progress and to have higher visibility on the code changes.

The changes involved are as follows:

  • remove obsolete code
  • change methods that used multiple parameters for vector components (i.e. int x, int y, int z) to use vectors instead
  • change P/Invokes to match the new (or expected) signatures on the CSFML side
  • rename some members to match the C++ side (for example, SystemHandle -> NativeHandle)
  • implement miniaudio changes for the Audio module
  • extract Count style enum values into a readonly field
  • implement Angle and the new methods on Vector2 and Vector3, use Angle instead of degrees expessed as floats
  • implement GetGeometricCenter methods on shapes
  • implement stencil and scissor features for Graphics module
  • implement new methods for starting / stopping Clock
  • added raw mouse event for Window
  • added timeout parameter to WaitEvent style calls
  • create basic unit tests (currently only Angle is tested)

@eXpl0it3r eXpl0it3r added the Feature New functionality or extending of an existing one label Sep 20, 2024
@eXpl0it3r eXpl0it3r added this to the 3.0 milestone Sep 20, 2024
@Marioalexsan Marioalexsan force-pushed the v3-alignment branch 12 times, most recently from e1cbde0 to 9438c04 Compare September 20, 2024 17:32
src/SFML.Audio/Music.cs Outdated Show resolved Hide resolved
@Marioalexsan Marioalexsan force-pushed the v3-alignment branch 4 times, most recently from 73dcba5 to 95a753d Compare September 28, 2024 22:18
@Marioalexsan Marioalexsan force-pushed the v3-alignment branch 2 times, most recently from e0455a4 to 974107a Compare October 5, 2024 22:19
@Marioalexsan
Copy link
Member Author

Marioalexsan commented Oct 6, 2024

The current PR seems to run with local CSFML 3.0 binaries (i.e. all example programs seem to run without any immediate issues), so I think it's now possible for people to test it out if they want to (although I'd expect it to crash in a lot of other places).

Since CSFML and SFML.Net 3.0 nuget packages are not available yet, here's instructions on how to build local CSFML and SFML.Net nuget packages for Windows / Visual Studio 2022:

Before all:

  • run dotnet nuget locals all --clear to clear previous cached packages if needed (i.e. if you update the package code but use the same version)

For CSFML 3.0:

  • Clone CSFML master branch (or https://github.com/Marioalexsan/CSFML/tree/render-states if the latest CSFML PR is not merged yet)
  • Open a Powershell terminal in tools/nuget and run ./build.win.ps1
  • in tools/nuget, run dotnet pack -c Release
  • in Visual Studio 2022, in Tools -> NuGet Package Manager -> Package Sources, add a path to CSFML/tools/nuget/CSFML/bin/Release

For SFML.Net 3.0:

  • run dotnet build -c Debug
  • in Visual Studio 2022, in Tools -> NuGet Package Manager -> Package Sources, add the following paths:
    • SFML.Net\src\SFML.Net\bin\Debug
    • SFML.Net\src\SFML.Graphics\bin\Debug
    • SFML.Net\src\SFML.Audio\bin\Debug
    • SFML.Net\src\SFML.Window\bin\Debug
    • SFML.Net\src\SFML.System\bin\Debug
  • create a new project, and add the following to your .csproj:
<ItemGroup>
    <PackageReference Include="SFML.Net" Version="3.0.0-alpha1" />
</ItemGroup>

I've tested this flow with a new console project that uses one of the examples as source code, but let me know if it breaks in some other cases.

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