mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Added a debugger, ironed out rendering pipeline
This commit is contained in:
1 parent
3dc8fa6b1c
commit
28fc7b5dcc
15 files changed
+321
-35
No files matched your search
@@ -1,7 +1,8 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Artemis.Core.Events;
|
||||
using Artemis.Core.Exceptions;
|
||||
using Artemis.Core.Models.Surface;
|
||||
using Artemis.Core.Plugins.Abstract;
|
||||
using Artemis.Core.Services.Interfaces;
|
||||
using Artemis.Core.Services.Storage;
|
||||
@@ -46,11 +47,17 @@ namespace Artemis.Core.Services
|
||||
throw new ArtemisCoreException("Cannot initialize the core as it is already initialized.");
|
||||
|
||||
_logger.Information("Initializing Artemis Core version {version}", typeof(CoreService).Assembly.GetName().Version);
|
||||
|
||||
|
||||
// Initialize the services
|
||||
await Task.Run(() => _pluginService.CopyBuiltInPlugins());
|
||||
await Task.Run(() => _pluginService.LoadPlugins());
|
||||
|
||||
var surfaceConfig = _surfaceService.ActiveSurfaceConfiguration;
|
||||
if (surfaceConfig != null)
|
||||
_logger.Information("Initialized with active surface configuration {surfaceConfig}-{guid}", surfaceConfig.Name, surfaceConfig.Guid);
|
||||
else
|
||||
_logger.Information("Initialized without an active surface configuration");
|
||||
|
||||
OnInitialized();
|
||||
}
|
||||
|
||||
@@ -79,6 +86,8 @@ namespace Artemis.Core.Services
|
||||
foreach (var module in modules)
|
||||
module.Render(args.DeltaTime, _rgbService.Surface, g);
|
||||
}
|
||||
|
||||
OnFrameRendered(new FrameEventArgs(modules, _rgbService.GraphicsDecorator.GetBitmap(), args.DeltaTime, _rgbService.Surface));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -89,6 +98,7 @@ namespace Artemis.Core.Services
|
||||
#region Events
|
||||
|
||||
public event EventHandler Initialized;
|
||||
public event EventHandler<FrameEventArgs> FrameRendered;
|
||||
|
||||
private void OnInitialized()
|
||||
{
|
||||
@@ -97,5 +107,10 @@ namespace Artemis.Core.Services
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
protected virtual void OnFrameRendered(FrameEventArgs e)
|
||||
{
|
||||
FrameRendered?.Invoke(this, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user