Skip to content

Commit

Permalink
[Feature] Example System usage
Browse files Browse the repository at this point in the history
  • Loading branch information
2004seraph committed Feb 9, 2024
1 parent 8ee0c66 commit 41c7984
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 91 deletions.
51 changes: 0 additions & 51 deletions GREngine.Core/GREngine.Core.Sound/Game1.cs

This file was deleted.

18 changes: 18 additions & 0 deletions GREngine.Core/GREngine.Core.System/Content/Content.mgcb
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,21 @@

#---------------------------------- Content ---------------------------------#

#begin liberia.jpg
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
/processorParam:ColorKeyEnabled=True
/processorParam:GenerateMipmaps=False
/processorParam:PremultiplyAlpha=True
/processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:liberia.jpg

#begin test.fx
/importer:EffectImporter
/processor:EffectProcessor
/processorParam:DebugMode=Auto
/build:test.fx

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions GREngine.Core/GREngine.Core.System/Content/test.fx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
testy code


hello
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@
<ProjectReference Include="..\..\GREngine.Algorithms\GREngine.Algorithms.csproj" />
<ProjectReference Include="..\..\GREngine.Debug\GREngine.Debug.csproj" />
</ItemGroup>
<ItemGroup>
<Content Remove="Content/test.fx" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Content/test.fx" />
</ItemGroup>
</Project>
14 changes: 13 additions & 1 deletion GREngine.Core/GREngine.Core.System/SceneGraph/SceneManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ namespace GREngine.Core.System;

using global::System;
using global::System.Collections.Generic;
using global::System.IO;
using global::System.Linq;
using global::System.Reflection;
using Microsoft.Xna.Framework;

using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using static GREngine.Debug.Out;

public sealed partial class SceneManager : GameComponent, ISceneControllerService
Expand All @@ -23,7 +25,17 @@ public sealed partial class SceneManager : GameComponent, ISceneControllerServic

public SceneManager(Game game) : base(game)
{
}

public override void Initialize()
{
// Texture2D liberia = Texture2D.FromStream(this.Game.GraphicsDevice,);
// PrintLn(liberia.Bounds.ToString());

var assembly = typeof(GREngine.Core.System.SceneManager).GetTypeInfo().Assembly;
Stream resource = assembly.GetManifestResourceStream("GREngine.Core.System.test.fx");

Check warning on line 36 in GREngine.Core/GREngine.Core.System/SceneGraph/SceneManager.cs

View workflow job for this annotation

GitHub Actions / build

Converting null literal or possible null value to non-nullable type.

Check warning on line 36 in GREngine.Core/GREngine.Core.System/SceneGraph/SceneManager.cs

View workflow job for this annotation

GitHub Actions / build

Converting null literal or possible null value to non-nullable type.

base.Initialize();
}

#region MONOGAME
Expand Down
77 changes: 38 additions & 39 deletions Testing/Content/Content.mgcb
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@

#----------------------------- Global Properties ----------------------------#

/outputDir:bin/$(Platform)
/intermediateDir:obj/$(Platform)
/platform:DesktopGL
/config:
/profile:Reach
/compress:False

#-------------------------------- References --------------------------------#


#---------------------------------- Content ---------------------------------#

#begin collision/circle.png
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
/processorParam:ColorKeyEnabled=True
/processorParam:GenerateMipmaps=False
/processorParam:PremultiplyAlpha=True
/processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:collision/circle.png

#begin collision/pixel.png
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
/processorParam:ColorKeyEnabled=True
/processorParam:GenerateMipmaps=False
/processorParam:PremultiplyAlpha=True
/processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:collision/pixel.png


#----------------------------- Global Properties ----------------------------#

/outputDir:bin/$(Platform)
/intermediateDir:obj/$(Platform)
/platform:DesktopGL
/config:
/profile:Reach
/compress:False

#-------------------------------- References --------------------------------#

#---------------------------------- Content ---------------------------------#

#begin collision/circle.png
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
/processorParam:ColorKeyEnabled=True
/processorParam:GenerateMipmaps=False
/processorParam:PremultiplyAlpha=True
/processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:collision/circle.png

#begin collision/pixel.png
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
/processorParam:ColorKeyEnabled=True
/processorParam:GenerateMipmaps=False
/processorParam:PremultiplyAlpha=True
/processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:collision/pixel.png

2 changes: 2 additions & 0 deletions Testing/SystemTesting/MyScene.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
namespace Testing.SystemTesting;

using GREngine.Core.System;
using GREngine.Debug;
using Microsoft.Xna.Framework.Graphics;

public class MyScene : Scene
{
Expand Down

0 comments on commit 41c7984

Please sign in to comment.