-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
202 changed files
with
10,948 additions
and
6,054 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
// Use IntelliSense to find out which attributes exist for C# debugging | ||
// Use hover for the description of the existing attributes | ||
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md | ||
"name": ".NET Core Launch (console)", | ||
"type": "coreclr", | ||
"request": "launch", | ||
"preLaunchTask": "build", | ||
// If you have changed target frameworks, make sure to update the program path. | ||
"program": "${workspaceFolder}/samples/SampleGame/bin/Debug/net7.0/SampleGame.dll", | ||
"args": [], | ||
"cwd": "${workspaceFolder}/samples/SampleGame", | ||
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console | ||
"console": "internalConsole", | ||
"stopAtEntry": false | ||
}, | ||
{ | ||
"name": ".NET Core Attach", | ||
"type": "coreclr", | ||
"request": "attach" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
{ | ||
"dotnet-test-explorer.testProjectPath": "**/*.Tests.csproj", | ||
"dotnet-test-explorer.testArguments": "/p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=./lcov.info", | ||
"coverage-gutters.coverageFileNames": [ | ||
"lcov.info", | ||
] | ||
], | ||
"dotnet.defaultSolution": "Sekai.sln" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "build", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"build", | ||
"${workspaceFolder}/samples/SampleGame/SampleGame.csproj", | ||
"/property:GenerateFullPaths=true", | ||
"/consoleloggerparameters:NoSummary" | ||
], | ||
"problemMatcher": "$msCompile" | ||
}, | ||
{ | ||
"label": "publish", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"publish", | ||
"${workspaceFolder}/samples/SampleGame/SampleGame.csproj", | ||
"/property:GenerateFullPaths=true", | ||
"/consoleloggerparameters:NoSummary" | ||
], | ||
"problemMatcher": "$msCompile" | ||
}, | ||
{ | ||
"label": "watch", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"watch", | ||
"run", | ||
"--project", | ||
"${workspaceFolder}/samples/SampleGame/SampleGame.csproj" | ||
], | ||
"problemMatcher": "$msCompile" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
// Copyright (c) Cosyne and The Vignette Authors | ||
// Licensed under MIT. See LICENSE for details. | ||
|
||
using System; | ||
using System.Numerics; | ||
using Sekai; | ||
using Sekai.Desktop; | ||
using Sekai.Graphics; | ||
using Sekai.Platform; | ||
|
||
namespace SampleGame; | ||
|
||
internal static class Program | ||
{ | ||
private static void Main() | ||
{ | ||
if (RuntimeInfo.IsDesktop) | ||
{ | ||
var host = new DesktopGameHost(); | ||
var game = new Sample(); | ||
host.Run(game); | ||
} | ||
else | ||
{ | ||
throw new PlatformNotSupportedException(); | ||
} | ||
} | ||
} | ||
|
||
internal class Sample : Game | ||
{ | ||
private Shader? shd; | ||
private GraphicsBuffer? vbo; | ||
|
||
protected override void Load() | ||
{ | ||
shd = Graphics!.CreateShader | ||
( | ||
ShaderCode.From(shader_v_code, ShaderStage.Vertex), | ||
ShaderCode.From(shader_f_code, ShaderStage.Fragment) | ||
); | ||
|
||
ReadOnlySpan<Vector3> vertices = stackalloc Vector3[] | ||
{ | ||
new(-0.5f, -0.5f, 0.0f), | ||
new( 0.5f, -0.5f, 0.0f), | ||
new( 0.0f, 0.5f, 0.0f) | ||
}; | ||
|
||
vbo = Graphics.CreateBuffer(BufferType.Vertex, vertices); | ||
} | ||
|
||
protected override void Draw() | ||
{ | ||
Graphics!.SetShader(shd!); | ||
Graphics.SetVertexBuffer(vbo!, new VertexLayout(new VertexMember(3, false, VertexMemberFormat.Float))); | ||
Graphics.Draw(PrimitiveType.TriangleList, 3); | ||
} | ||
|
||
protected override void Unload() | ||
{ | ||
shd?.Dispose(); | ||
vbo?.Dispose(); | ||
} | ||
|
||
private const string shader_v_code = | ||
@" | ||
#version 450 | ||
layout (location = 0) in vec3 a_position; | ||
void main() | ||
{ | ||
gl_Position = vec4(a_position.x, a_position.y, a_position.z, 1.0); | ||
} | ||
"; | ||
|
||
private const string shader_f_code = | ||
@" | ||
#version 450 | ||
layout (location = 0) out vec4 v_color; | ||
void main() | ||
{ | ||
v_color = vec4(1.0, 0.5, 0.2, 1.0); | ||
} | ||
"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<PublishAot>true</PublishAot> | ||
<PublishTrimmed>true</PublishTrimmed> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="../../source/Sekai/Sekai.csproj" /> | ||
<ProjectReference Include="../../source/Sekai.Desktop/Sekai.Desktop.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
namespace Sekai.Android; | ||
public class Class1 | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
</Project> |
Oops, something went wrong.