Added GDI-based rendering test

This commit is contained in:
SpoinkyNL committed 2018-04-15 18:41:31 +02:00
1 parent 610b45e017
commit 60544e7814
21 files changed
+382 -111

No files matched your search

+14 -3
View File
@@ -5,6 +5,7 @@ using Artemis.Core.Exceptions;
using Artemis.Core.Plugins.Interfaces;
using Artemis.Core.Services.Interfaces;
using RGB.NET.Core;
using Color = System.Drawing.Color;
namespace Artemis.Core.Services
{
@@ -19,6 +20,7 @@ namespace Artemis.Core.Services
_rgbService = rgbService;
_rgbService.Surface.Updating += SurfaceOnUpdating;
Task.Run(Initialize);
}
@@ -47,11 +49,20 @@ namespace Artemis.Core.Services
try
{
// Update all active modules
foreach (var module in _pluginService.Plugins.OfType<IModule>())
foreach (var module in _pluginService.Plugins.Select(p => p.Plugin).OfType<IModule>())
module.Update(args.DeltaTime);
if (_rgbService.GraphicsDecorator == null)
return;
// Render all active modules
foreach (var module in _pluginService.Plugins.OfType<IModule>())
module.Render(args.DeltaTime, _rgbService.Surface);
using (var g = _rgbService.GraphicsDecorator.GetGraphics())
{
g.Clear(Color.Red);
foreach (var module in _pluginService.Plugins.Select(p => p.Plugin).OfType<IModule>())
module.Render(args.DeltaTime, _rgbService.Surface, g);
}
}
catch (Exception e)
{