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

Build Examples in CI #248

Merged
merged 2 commits into from
May 20, 2024
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
33 changes: 18 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,42 @@ jobs:
platform:
- { name: Linux, os: ubuntu-22.04 }
- { name: Windows, os: windows-2022 }
- { name: MacOS Intel, os: macos-13 }
- { name: macOS x64, os: macos-13 }
- { name: macOS ARM64, os: macos-14 }
dotnet:
- { name: .NET Core 3.1, version: "3.1" }
- { name: .NET 6, version: "6.0.x" }
- { name: .NET 7, version: "7.0.x" }
- { name: .NET 8, version: "8.0.x" }
include:
- platform: { name: MacOS M1, os: macos-14 }
dotnet: { name: .NET 6, version: "6.0.x" }
- platform: { name: MacOS M1, os: macos-14 }
dotnet: { name: .NET 7, version: "7.0.x" }
- platform: { name: MacOS M1, os: macos-14 }
dotnet: { name: .NET 8, version: "8.0.x" }
- { name: .NET 9, version: "9.0.x" }

steps:
- uses: actions/checkout@v4
- name: Check out SFML.Net
uses: actions/checkout@v4

- name: Setup .NET ${{ matrix.dotnet.version }} SDK
id: setup-dotnet
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet.version }}
- name: Enforce SDK Version
run: dotnet new globaljson --sdk-version ${{ steps.setup-dotnet.outputs.dotnet-version }} --force
- name: Verify SDK Installation
run: dotnet --info
- name: Install Dependencies

- name: Install SFML.Net Dependencies
run: dotnet restore
- name: Build
- name: Build SFML.Net
run: dotnet build --configuration Release --no-restore
- name: Pack
- name: Pack SFML.Net
run: dotnet pack --configuration Release -o Publish

- name: Install SFML.Net Examples Dependencies
run: dotnet restore examples/Examples.sln
- name: Build SFML.Net Examples
run: dotnet build --configuration Release --no-restore examples/Examples.sln

- name: Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: SFML.Net (${{ matrix.platform.name }} ${{ matrix.dotnet.name }})
path: Publish/SFML.*.*.nupkg
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