Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions examples/Examples.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34902.65
# Visual Studio Version 18
VisualStudioVersion = 18.2.11408.102
MinimumVisualStudioVersion = 15.0.26124.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SFML", "SFML", "{620580C3-9270-42C9-A2BF-4DA85B522831}"
EndProject
Expand All @@ -27,7 +27,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SFML.System", "..\src\SFML.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SFML.Window", "..\src\SFML.Window\SFML.Window.csproj", "{698CC2F9-93C8-4119-997B-B622193FA827}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "netcore", "netcore\netcore.csproj", "{93B8425A-AC40-4486-96AF-20027B738C09}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "netfx", "netfx\netfx.csproj", "{93B8425A-AC40-4486-96AF-20027B738C09}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A64BFAB3-DD36-4ABE-AABB-8A594327CCDD}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -45,61 +45,73 @@ Global
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2FC1071D-4470-4704-B28E-29FF4DD432A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2FC1071D-4470-4704-B28E-29FF4DD432A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2FC1071D-4470-4704-B28E-29FF4DD432A0}.Debug|x64.ActiveCfg = Debug|x64
{2FC1071D-4470-4704-B28E-29FF4DD432A0}.Debug|x64.Build.0 = Debug|x64
{2FC1071D-4470-4704-B28E-29FF4DD432A0}.Debug|x86.ActiveCfg = Debug|x86
{2FC1071D-4470-4704-B28E-29FF4DD432A0}.Debug|x86.Build.0 = Debug|x86
{2FC1071D-4470-4704-B28E-29FF4DD432A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2FC1071D-4470-4704-B28E-29FF4DD432A0}.Release|Any CPU.Build.0 = Release|Any CPU
{2FC1071D-4470-4704-B28E-29FF4DD432A0}.Release|x64.ActiveCfg = Release|x64
{2FC1071D-4470-4704-B28E-29FF4DD432A0}.Release|x64.Build.0 = Release|x64
{2FC1071D-4470-4704-B28E-29FF4DD432A0}.Release|x86.ActiveCfg = Release|x86
{2FC1071D-4470-4704-B28E-29FF4DD432A0}.Release|x86.Build.0 = Release|x86
{EBF44846-C2C9-4595-881F-FD3489C0828F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EBF44846-C2C9-4595-881F-FD3489C0828F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EBF44846-C2C9-4595-881F-FD3489C0828F}.Debug|x64.ActiveCfg = Debug|x64
{EBF44846-C2C9-4595-881F-FD3489C0828F}.Debug|x64.Build.0 = Debug|x64
{EBF44846-C2C9-4595-881F-FD3489C0828F}.Debug|x86.ActiveCfg = Debug|x86
{EBF44846-C2C9-4595-881F-FD3489C0828F}.Debug|x86.Build.0 = Debug|x86
{EBF44846-C2C9-4595-881F-FD3489C0828F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EBF44846-C2C9-4595-881F-FD3489C0828F}.Release|Any CPU.Build.0 = Release|Any CPU
{EBF44846-C2C9-4595-881F-FD3489C0828F}.Release|x64.ActiveCfg = Release|x64
{EBF44846-C2C9-4595-881F-FD3489C0828F}.Release|x64.Build.0 = Release|x64
{EBF44846-C2C9-4595-881F-FD3489C0828F}.Release|x86.ActiveCfg = Release|x86
{EBF44846-C2C9-4595-881F-FD3489C0828F}.Release|x86.Build.0 = Release|x86
{16B5B101-D5CC-449D-B6C5-E93048B01108}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{16B5B101-D5CC-449D-B6C5-E93048B01108}.Debug|Any CPU.Build.0 = Debug|Any CPU
{16B5B101-D5CC-449D-B6C5-E93048B01108}.Debug|x64.ActiveCfg = Debug|x64
{16B5B101-D5CC-449D-B6C5-E93048B01108}.Debug|x64.Build.0 = Debug|x64
{16B5B101-D5CC-449D-B6C5-E93048B01108}.Debug|x86.ActiveCfg = Debug|x86
{16B5B101-D5CC-449D-B6C5-E93048B01108}.Debug|x86.Build.0 = Debug|x86
{16B5B101-D5CC-449D-B6C5-E93048B01108}.Release|Any CPU.ActiveCfg = Release|Any CPU
{16B5B101-D5CC-449D-B6C5-E93048B01108}.Release|Any CPU.Build.0 = Release|Any CPU
{16B5B101-D5CC-449D-B6C5-E93048B01108}.Release|x64.ActiveCfg = Release|x64
{16B5B101-D5CC-449D-B6C5-E93048B01108}.Release|x64.Build.0 = Release|x64
{16B5B101-D5CC-449D-B6C5-E93048B01108}.Release|x86.ActiveCfg = Release|x86
{16B5B101-D5CC-449D-B6C5-E93048B01108}.Release|x86.Build.0 = Release|x86
{FBA62527-7197-4EEE-B96A-7E3FEC313BCE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FBA62527-7197-4EEE-B96A-7E3FEC313BCE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FBA62527-7197-4EEE-B96A-7E3FEC313BCE}.Debug|x64.ActiveCfg = Debug|x64
{FBA62527-7197-4EEE-B96A-7E3FEC313BCE}.Debug|x64.Build.0 = Debug|x64
{FBA62527-7197-4EEE-B96A-7E3FEC313BCE}.Debug|x86.ActiveCfg = Debug|x86
{FBA62527-7197-4EEE-B96A-7E3FEC313BCE}.Debug|x86.Build.0 = Debug|x86
{FBA62527-7197-4EEE-B96A-7E3FEC313BCE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FBA62527-7197-4EEE-B96A-7E3FEC313BCE}.Release|Any CPU.Build.0 = Release|Any CPU
{FBA62527-7197-4EEE-B96A-7E3FEC313BCE}.Release|x64.ActiveCfg = Release|x64
{FBA62527-7197-4EEE-B96A-7E3FEC313BCE}.Release|x64.Build.0 = Release|x64
{FBA62527-7197-4EEE-B96A-7E3FEC313BCE}.Release|x86.ActiveCfg = Release|x86
{FBA62527-7197-4EEE-B96A-7E3FEC313BCE}.Release|x86.Build.0 = Release|x86
{98552080-F688-46B4-A2FF-1AC7C50ECBE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{98552080-F688-46B4-A2FF-1AC7C50ECBE8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{98552080-F688-46B4-A2FF-1AC7C50ECBE8}.Debug|x64.ActiveCfg = Debug|x64
{98552080-F688-46B4-A2FF-1AC7C50ECBE8}.Debug|x64.Build.0 = Debug|x64
{98552080-F688-46B4-A2FF-1AC7C50ECBE8}.Debug|x86.ActiveCfg = Debug|x86
{98552080-F688-46B4-A2FF-1AC7C50ECBE8}.Debug|x86.Build.0 = Debug|x86
{98552080-F688-46B4-A2FF-1AC7C50ECBE8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{98552080-F688-46B4-A2FF-1AC7C50ECBE8}.Release|Any CPU.Build.0 = Release|Any CPU
{98552080-F688-46B4-A2FF-1AC7C50ECBE8}.Release|x64.ActiveCfg = Release|x64
{98552080-F688-46B4-A2FF-1AC7C50ECBE8}.Release|x64.Build.0 = Release|x64
{98552080-F688-46B4-A2FF-1AC7C50ECBE8}.Release|x86.ActiveCfg = Release|x86
{98552080-F688-46B4-A2FF-1AC7C50ECBE8}.Release|x86.Build.0 = Release|x86
{7696A8C5-CB82-4B53-8E55-BF4C7B20E8E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7696A8C5-CB82-4B53-8E55-BF4C7B20E8E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7696A8C5-CB82-4B53-8E55-BF4C7B20E8E2}.Debug|x64.ActiveCfg = Debug|x64
{7696A8C5-CB82-4B53-8E55-BF4C7B20E8E2}.Debug|x64.Build.0 = Debug|x64
{7696A8C5-CB82-4B53-8E55-BF4C7B20E8E2}.Debug|x86.ActiveCfg = Debug|x86
{7696A8C5-CB82-4B53-8E55-BF4C7B20E8E2}.Debug|x86.Build.0 = Debug|x86
{7696A8C5-CB82-4B53-8E55-BF4C7B20E8E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7696A8C5-CB82-4B53-8E55-BF4C7B20E8E2}.Release|Any CPU.Build.0 = Release|Any CPU
{7696A8C5-CB82-4B53-8E55-BF4C7B20E8E2}.Release|x64.ActiveCfg = Release|x64
{7696A8C5-CB82-4B53-8E55-BF4C7B20E8E2}.Release|x64.Build.0 = Release|x64
{7696A8C5-CB82-4B53-8E55-BF4C7B20E8E2}.Release|x86.ActiveCfg = Release|x86
Expand Down Expand Up @@ -164,14 +176,14 @@ Global
{698CC2F9-93C8-4119-997B-B622193FA827}.Release|x64.Build.0 = Release|x64
{698CC2F9-93C8-4119-997B-B622193FA827}.Release|x86.ActiveCfg = Release|x86
{698CC2F9-93C8-4119-997B-B622193FA827}.Release|x86.Build.0 = Release|x86
{93B8425A-AC40-4486-96AF-20027B738C09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{93B8425A-AC40-4486-96AF-20027B738C09}.Debug|Any CPU.Build.0 = Debug|Any CPU
{93B8425A-AC40-4486-96AF-20027B738C09}.Debug|Any CPU.ActiveCfg = Debug|x64
{93B8425A-AC40-4486-96AF-20027B738C09}.Debug|Any CPU.Build.0 = Debug|x64
{93B8425A-AC40-4486-96AF-20027B738C09}.Debug|x64.ActiveCfg = Debug|x64
{93B8425A-AC40-4486-96AF-20027B738C09}.Debug|x64.Build.0 = Debug|x64
{93B8425A-AC40-4486-96AF-20027B738C09}.Debug|x86.ActiveCfg = Debug|x86
{93B8425A-AC40-4486-96AF-20027B738C09}.Debug|x86.Build.0 = Debug|x86
{93B8425A-AC40-4486-96AF-20027B738C09}.Release|Any CPU.ActiveCfg = Release|Any CPU
{93B8425A-AC40-4486-96AF-20027B738C09}.Release|Any CPU.Build.0 = Release|Any CPU
{93B8425A-AC40-4486-96AF-20027B738C09}.Release|Any CPU.ActiveCfg = Release|x64
{93B8425A-AC40-4486-96AF-20027B738C09}.Release|Any CPU.Build.0 = Release|x64
{93B8425A-AC40-4486-96AF-20027B738C09}.Release|x64.ActiveCfg = Release|x64
{93B8425A-AC40-4486-96AF-20027B738C09}.Release|x64.Build.0 = Release|x64
{93B8425A-AC40-4486-96AF-20027B738C09}.Release|x86.ActiveCfg = Release|x86
Expand Down
8 changes: 0 additions & 8 deletions examples/netcore/Properties/launchSettings.json

This file was deleted.

7 changes: 0 additions & 7 deletions examples/netcore/readme.md

This file was deleted.

20 changes: 11 additions & 9 deletions examples/netcore/Program.cs → examples/netfx/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,30 @@
using SFML.System;
using SFML.Window;

namespace netcore;
namespace netfx;

internal class Program
public static class Program
{
private static void Main()
{
var shape = new RectangleShape(new Vector2f(100, 100))
var window = new RenderWindow(new VideoMode((800, 600)), "SFML running with .NET Framework");
window.Closed += (_, _) => window.Close();

var shape = new CircleShape(100f, 50)
{
FillColor = Color.Black
FillColor = Color.Green,
Origin = new Vector2f(100f, 100f),
Position = new Vector2f(400f, 300f)
};

var sound = new Sound(GenerateSineWave(frequency: 440.0, volume: .25, seconds: 1));

var window = new RenderWindow(new VideoMode((800, 600)), "SFML running in .NET Core");
window.Closed += (_, _) => window.Close();

sound.Play();

while (window.IsOpen)
{
window.DispatchEvents();
window.Clear(Color.White);
window.Clear();
window.Draw(shape);
window.Display();
}
Expand All @@ -41,6 +43,6 @@ private static SoundBuffer GenerateSineWave(double frequency, double volume, int
samples[i] = (short)(Math.Sin(frequency * (2 * Math.PI) * i / sampleRate) * volume * short.MaxValue);
}

return new SoundBuffer(samples, 1, sampleRate, new SoundChannel[] { SoundChannel.Mono });
return new SoundBuffer(samples, 1, sampleRate, [SoundChannel.Mono]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net48</TargetFramework>
<LangVersion>12</LangVersion>
<Platforms>x86;x64</Platforms>
<Version>3.0.0</Version>
<Platforms>AnyCPU;x64;x86</Platforms>
</PropertyGroup>

<ItemGroup>
Expand Down
7 changes: 7 additions & 0 deletions examples/netfx/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SFML.Net running on .NET Framework

This project showcases how SFML.Net can be run on .NET Framwork with NuGet packages.
To execute this example, just run `dotnet run` inside of this directory.

Please note that platform availability is still limited by native CSFML libraries.
For more information on that, check [the main readme](../../readme.md).
Loading