Skip to content

Commit

Permalink
started GL textured cube demo
Browse files Browse the repository at this point in the history
  • Loading branch information
aquagoose committed Jul 22, 2023
1 parent f60edc9 commit ddd78ac
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@
"items": {
"type": "string",
"enum": [
"Angle",
"Assimp",
"BuildLibSilkDroid",
"Clean",
Expand All @@ -160,9 +159,11 @@
"RegenerateBindings",
"Restore",
"SDL2",
"Shaderc",
"ShipApi",
"SignPackages",
"Sln",
"SPIRVCross",
"SPIRVReflect",
"SwiftShader",
"Test",
Expand All @@ -183,7 +184,6 @@
"items": {
"type": "string",
"enum": [
"Angle",
"Assimp",
"BuildLibSilkDroid",
"Clean",
Expand All @@ -201,9 +201,11 @@
"RegenerateBindings",
"Restore",
"SDL2",
"Shaderc",
"ShipApi",
"SignPackages",
"Sln",
"SPIRVCross",
"SPIRVReflect",
"SwiftShader",
"Test",
Expand Down Expand Up @@ -231,4 +233,4 @@
}
}
}
}
}
15 changes: 15 additions & 0 deletions Silk.NET.sln
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.Shaderc", "src\SPI
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.Shaderc.Native", "src\Native\Silk.NET.Shaderc.Native\Silk.NET.Shaderc.Native.csproj", "{D1E4EDC7-0A06-498A-B0F9-275B7D508A0E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SelfContainedTexturedCube", "examples\CSharp\OpenGL Demos\SelfContainedTexturedCube\SelfContainedTexturedCube.csproj", "{B8268B05-C2D8-4AE8-8406-C34D5E7753F6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -3615,6 +3617,18 @@ Global
{D1E4EDC7-0A06-498A-B0F9-275B7D508A0E}.Release|x64.Build.0 = Release|Any CPU
{D1E4EDC7-0A06-498A-B0F9-275B7D508A0E}.Release|x86.ActiveCfg = Release|Any CPU
{D1E4EDC7-0A06-498A-B0F9-275B7D508A0E}.Release|x86.Build.0 = Release|Any CPU
{B8268B05-C2D8-4AE8-8406-C34D5E7753F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B8268B05-C2D8-4AE8-8406-C34D5E7753F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B8268B05-C2D8-4AE8-8406-C34D5E7753F6}.Debug|x64.ActiveCfg = Debug|Any CPU
{B8268B05-C2D8-4AE8-8406-C34D5E7753F6}.Debug|x64.Build.0 = Debug|Any CPU
{B8268B05-C2D8-4AE8-8406-C34D5E7753F6}.Debug|x86.ActiveCfg = Debug|Any CPU
{B8268B05-C2D8-4AE8-8406-C34D5E7753F6}.Debug|x86.Build.0 = Debug|Any CPU
{B8268B05-C2D8-4AE8-8406-C34D5E7753F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B8268B05-C2D8-4AE8-8406-C34D5E7753F6}.Release|Any CPU.Build.0 = Release|Any CPU
{B8268B05-C2D8-4AE8-8406-C34D5E7753F6}.Release|x64.ActiveCfg = Release|Any CPU
{B8268B05-C2D8-4AE8-8406-C34D5E7753F6}.Release|x64.Build.0 = Release|Any CPU
{B8268B05-C2D8-4AE8-8406-C34D5E7753F6}.Release|x86.ActiveCfg = Release|Any CPU
{B8268B05-C2D8-4AE8-8406-C34D5E7753F6}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -3904,6 +3918,7 @@ Global
{1E7C6166-58B2-46B3-A9BA-18099BD83AF0} = {20A4A2D1-D699-4D71-AA97-950154638576}
{E77BE8DB-3C74-42EB-9B65-67EAAA9AD7DB} = {15FC3D1A-25D7-446B-87A7-B45BA3C2225F}
{D1E4EDC7-0A06-498A-B0F9-275B7D508A0E} = {72E7FA64-5B1E-477D-BD30-63B7F206B3C4}
{B8268B05-C2D8-4AE8-8406-C34D5E7753F6} = {2F547104-C74A-4A84-8980-D1B973CC40C1}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F5273D7F-3334-48DF-94E3-41AE6816CD4D}
Expand Down
47 changes: 47 additions & 0 deletions examples/CSharp/OpenGL Demos/SelfContainedTexturedCube/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using System.Drawing;
using Silk.NET.Maths;
using Silk.NET.OpenGL;
using Silk.NET.Windowing;

namespace SelfContainedTexturedCube;

public class Program
{
private static IWindow _window;
private static GL _gl;

public static void Main(string[] args)
{
WindowOptions options = WindowOptions.Default with
{
Title = "Self Contained Textured Cube Demo",
Size = new Vector2D<int>(1280, 720)
};

_window = Window.Create(options);
_window.Load += Initialize;
_window.Update += Update;
_window.Render += Draw;

_window.Run();

_window.Dispose();
}

private static void Initialize()
{
_gl = _window.CreateOpenGL();

_gl.ClearColor(Color.Indigo);
}

private static void Update(double dt)
{

}

private static void Draw(double dt)
{
_gl.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable>
</PropertyGroup>

<ItemGroup><!--<ProjectReference Include="..\..\..\..\src\Input\Silk.NET.Input\Silk.NET.Input.csproj" />
<ProjectReference Include="..\..\..\..\src\OpenGL\Silk.NET.OpenGL\Silk.NET.OpenGL.csproj" />
<ProjectReference Include="..\..\..\..\src\Windowing\Silk.NET.Windowing\Silk.NET.Windowing.csproj" />-->

<PackageReference Include="Silk.NET.OpenGL" Version="2.17.1" />

<PackageReference Include="Silk.NET.Windowing" Version="2.17.1" />
</ItemGroup>

</Project>

0 comments on commit ddd78ac

Please sign in to comment.