-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: create empty scene guide project
- Loading branch information
1 parent
3d74545
commit 5380cd6
Showing
8 changed files
with
165 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="Scenes" type="DotNetProject" factoryName=".NET Project"> | ||
<option name="EXE_PATH" value="$PROJECT_DIR$/Guides/Scenes/bin/Debug/net8.0/Scenes.exe" /> | ||
<option name="PROGRAM_PARAMETERS" value="" /> | ||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/Guides/Scenes/bin/Debug/net8.0" /> | ||
<option name="PASS_PARENT_ENVS" value="1" /> | ||
<option name="USE_EXTERNAL_CONSOLE" value="0" /> | ||
<option name="USE_MONO" value="0" /> | ||
<option name="RUNTIME_ARGUMENTS" value="" /> | ||
<option name="PROJECT_PATH" value="$PROJECT_DIR$/Guides/Scenes/Scenes.csproj" /> | ||
<option name="PROJECT_EXE_PATH_TRACKING" value="1" /> | ||
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> | ||
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" /> | ||
<option name="PROJECT_KIND" value="DotNetCore" /> | ||
<option name="PROJECT_TFM" value="net8.0" /> | ||
<method v="2"> | ||
<option name="Build" /> | ||
</method> | ||
</configuration> | ||
</component> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,85 @@ | ||
// <copyright file="Game.cs" company="KinsonDigital"> | ||
// Copyright (c) KinsonDigital. All rights reserved. | ||
// </copyright> | ||
|
||
namespace Scenes; | ||
|
||
using System.Drawing; | ||
using System.Numerics; | ||
using Velaptor; | ||
using Velaptor.Batching; | ||
using Velaptor.Content; | ||
using Velaptor.ExtensionMethods; | ||
using Velaptor.Factories; | ||
using Velaptor.Graphics.Renderers; | ||
using Velaptor.Input; | ||
using Velaptor.UI; | ||
|
||
public class Game : Window | ||
{ | ||
private readonly ILoader<ITexture> textureLoader; | ||
private readonly ITextureRenderer renderer; | ||
private readonly IBatcher batcher; | ||
private readonly IAppInput<MouseState> mouse; | ||
private ITexture logoTexture; | ||
private MouseState currentMouseState; | ||
private Point logoPosition; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="Game"/> class. | ||
/// </summary> | ||
public Game() | ||
Check warning on line 31 in SampleProjects/Guides/Scenes/Game.cs GitHub Actions / CSharp Projects Build Status Check / Build Velaptor Tutorials Solution
Check warning on line 31 in SampleProjects/Guides/Scenes/Game.cs GitHub Actions / CSharp Projects Build Status Check / Build Velaptor Tutorials Solution
|
||
{ | ||
Title = "Scenes"; | ||
Width = 1000; | ||
Height = 1000; | ||
|
||
this.textureLoader = ContentLoaderFactory.CreateTextureLoader(); | ||
this.batcher = RendererFactory.CreateBatcher(); | ||
this.renderer = RendererFactory.CreateTextureRenderer(); | ||
this.mouse = HardwareFactory.GetMouse(); | ||
} | ||
|
||
/// <summary> | ||
/// Loads game content. | ||
/// </summary> | ||
protected override void OnLoad() | ||
{ | ||
this.logoTexture = this.textureLoader.Load("kd-logo"); | ||
|
||
base.OnLoad(); | ||
} | ||
|
||
/// <summary> | ||
/// Unload the content to free resources. | ||
/// </summary> | ||
protected override void OnUnload() | ||
{ | ||
base.OnUnload(); | ||
} | ||
|
||
/// <summary> | ||
/// Updates the application. Executes one time for every iteration of the game loop | ||
/// and always BEFORE the <see cref="Window.OnDraw"/> method. | ||
/// </summary> | ||
/// <param name="frameTime">The amount of time that has passed for the current frame.</param> | ||
protected override void OnUpdate(FrameTime frameTime) | ||
{ | ||
this.currentMouseState = this.mouse.GetState(); | ||
|
||
this.logoPosition = this.currentMouseState.GetPosition(); | ||
|
||
base.OnUpdate(frameTime); | ||
} | ||
|
||
protected override void OnDraw(FrameTime frameTime) | ||
{ | ||
this.batcher.Begin(); | ||
|
||
this.renderer.Render(this.logoTexture, this.logoPosition.X, this.logoPosition.Y); | ||
|
||
this.batcher.End(); | ||
|
||
base.OnDraw(frameTime); | ||
} | ||
} |
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,6 @@ | ||
// <copyright file="Program.cs" company="KinsonDigital"> | ||
// Copyright (c) KinsonDigital. All rights reserved. | ||
// </copyright> | ||
|
||
var game = new Scenes.Game(); | ||
game.Show(); |
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,33 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="KinsonDigital.Velaptor" Version="1.0.0-preview.35" /> | ||
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Remove="stylecop.json" /> | ||
<AdditionalFiles Include="stylecop.json" /> | ||
<None Update="Content\Graphics\velaptor-mascot.png"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
<None Update="Content\Graphics\kd-logo.png"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
</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,14 @@ | ||
{ | ||
// ACTION REQUIRED: This file was automatically added to your project, but it | ||
// will not take effect until additional steps are taken to enable it. See the | ||
// following page for additional information: | ||
// | ||
// https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/EnableConfiguration.md | ||
|
||
"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", | ||
"settings": { | ||
"documentationRules": { | ||
"companyName": "KinsonDigital" | ||
} | ||
} | ||
} |
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