Skip to content

Commit

Permalink
Update examples target framework and dependencies
Browse files Browse the repository at this point in the history
Converted VB projecto SDK style and fixed references
  • Loading branch information
eXpl0it3r committed May 20, 2024
1 parent e191a5d commit 5e08ecb
Show file tree
Hide file tree
Showing 14 changed files with 93 additions and 176 deletions.
8 changes: 4 additions & 4 deletions examples/Examples.sln
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26124.0
# Visual Studio Version 17
VisualStudioVersion = 17.9.34902.65
MinimumVisualStudioVersion = 15.0.26124.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SFML", "SFML", "{620580C3-9270-42C9-A2BF-4DA85B522831}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "opengl", "opengl\opengl.csproj", "{2FC1071D-4470-4704-B28E-29FF4DD432A0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "shader", "shader\shader.csproj", "{EBF44846-C2C9-4595-881F-FD3489C0828F}"
Expand All @@ -27,8 +29,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SFML.Window", "..\src\SFML.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "netcore", "netcore\netcore.csproj", "{93B8425A-AC40-4486-96AF-20027B738C09}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SFML", "SFML", "{620580C3-9270-42C9-A2BF-4DA85B522831}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
3 changes: 0 additions & 3 deletions examples/netcore/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@
using SFML.System;
using SFML.Window;


namespace netcore
{
class Program
{


static void Main(string[] args)
{
var shape = new RectangleShape(new Vector2f(100, 100))
Expand Down
1 change: 1 addition & 0 deletions examples/netcore/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# SFML.Net running on .NET Core

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

Expand Down
4 changes: 2 additions & 2 deletions examples/netcore/netcore.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions examples/opengl/opengl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>net48</TargetFramework>
<RootNamespace>opengl</RootNamespace>
<AssemblyName>opengl</AssemblyName>
<Configurations>Debug;Release;_WINDOWS_;_LINUX_;_OSX_</Configurations>
<Version>2.4.2</Version>
<Version>2.5.1</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions examples/shader/shader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>net48</TargetFramework>
<RootNamespace>shader</RootNamespace>
<AssemblyName>shader</AssemblyName>
<Configurations>Debug;Release;_WINDOWS_;_LINUX_;_OSX_</Configurations>
<Version>2.4.2</Version>
<Version>2.5.1</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions examples/sound/sound.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>net48</TargetFramework>
<RootNamespace>sound</RootNamespace>
<AssemblyName>sound</AssemblyName>
<Configurations>Debug;Release;_WINDOWS_;_LINUX_;_OSX_</Configurations>
<Version>2.4.2</Version>
<Version>2.5.1</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions examples/sound_capture/sound_capture.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>net48</TargetFramework>
<RootNamespace>sound_capture</RootNamespace>
<AssemblyName>sound_capture</AssemblyName>
<Configurations>Debug;Release;_WINDOWS_;_LINUX_;_OSX_</Configurations>
<Version>2.4.2</Version>
<Version>2.5.1</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/visualbasic/My Project/Application.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/visualbasic/My Project/Resources.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions examples/visualbasic/My Project/Settings.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

81 changes: 40 additions & 41 deletions examples/visualbasic/OpenGL.vb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Imports System
Imports System
Imports System.Runtime.InteropServices
Imports SFML.System
Imports SFML.Window
Expand All @@ -7,7 +7,6 @@ Imports OpenTK
Imports OpenTK.Graphics
Imports OpenTk.Graphics.OpenGL


Module OpenGL

Dim WithEvents window As RenderWindow
Expand Down Expand Up @@ -35,7 +34,7 @@ Module OpenGL
' Create a text to display on top of the OpenGL object
Dim text = New Text("SFML / OpenGL demo", New Font("resources/sansation.ttf"))
text.Position = New Vector2f(250, 450)
text.Color = New Color(255, 255, 255, 170)
text.FillColor = New SFML.Graphics.Color(255, 255, 255, 170)

' Make it the active window for OpenGL calls
window.SetActive(True)
Expand All @@ -44,7 +43,7 @@ Module OpenGL
' We could directly use a SFML.Graphics.Texture as an OpenGL texture (with its Bind() member function),
' but here we want more control on it (generate mipmaps, ...) so we create a new one
Dim texture = 0
Using image = New Image("resources/texture.jpg")
Using image = New SFML.Graphics.Image("resources/texture.jpg")
GL.GenTextures(1, texture)
GL.BindTexture(TextureTarget.Texture2D, texture)
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, image.Size.X, image.Size.Y, 0, PixelFormat.Rgba, PixelType.UnsignedByte, image.Pixels)
Expand Down Expand Up @@ -75,48 +74,48 @@ Module OpenGL

' Define a 3D cube (6 faces made of 2 triangles composed by 3 vertices)
Dim cube = New Single() _
{ _
-20, -20, -20, 0, 0, _
-20, 20, -20, 1, 0, _
-20, -20, 20, 0, 1, _
-20, -20, 20, 0, 1, _
-20, 20, -20, 1, 0, _
{
-20, -20, -20, 0, 0,
-20, 20, -20, 1, 0,
-20, -20, 20, 0, 1,
-20, -20, 20, 0, 1,
-20, 20, -20, 1, 0,
-20, 20, 20, 1, 1, _
_
20, -20, -20, 0, 0, _
20, 20, -20, 1, 0, _
20, -20, 20, 0, 1, _
20, -20, 20, 0, 1, _
20, 20, -20, 1, 0, _
_
20, -20, -20, 0, 0,
20, 20, -20, 1, 0,
20, -20, 20, 0, 1,
20, -20, 20, 0, 1,
20, 20, -20, 1, 0,
20, 20, 20, 1, 1, _
_
-20, -20, -20, 0, 0, _
20, -20, -20, 1, 0, _
-20, -20, 20, 0, 1, _
-20, -20, 20, 0, 1, _
20, -20, -20, 1, 0, _
_
-20, -20, -20, 0, 0,
20, -20, -20, 1, 0,
-20, -20, 20, 0, 1,
-20, -20, 20, 0, 1,
20, -20, -20, 1, 0,
20, -20, 20, 1, 1, _
_
-20, 20, -20, 0, 0, _
20, 20, -20, 1, 0, _
-20, 20, 20, 0, 1, _
-20, 20, 20, 0, 1, _
20, 20, -20, 1, 0, _
_
-20, 20, -20, 0, 0,
20, 20, -20, 1, 0,
-20, 20, 20, 0, 1,
-20, 20, 20, 0, 1,
20, 20, -20, 1, 0,
20, 20, 20, 1, 1, _
_
-20, -20, -20, 0, 0, _
20, -20, -20, 1, 0, _
-20, 20, -20, 0, 1, _
-20, 20, -20, 0, 1, _
20, -20, -20, 1, 0, _
_
-20, -20, -20, 0, 0,
20, -20, -20, 1, 0,
-20, 20, -20, 0, 1,
-20, 20, -20, 0, 1,
20, -20, -20, 1, 0,
20, 20, -20, 1, 1, _
_
-20, -20, 20, 0, 0, _
20, -20, 20, 1, 0, _
-20, 20, 20, 0, 1, _
-20, 20, 20, 0, 1, _
20, -20, 20, 1, 0, _
20, 20, 20, 1, 1 _
_
-20, -20, 20, 0, 0,
20, -20, 20, 1, 0,
-20, 20, 20, 0, 1,
-20, 20, 20, 0, 1,
20, -20, 20, 1, 0,
20, 20, 20, 1, 1
}

' Enable position and texture coordinates vertex components
Expand Down
Loading

0 comments on commit 5e08ecb

Please sign in to comment.