mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Added GDI-based rendering test
This commit is contained in:
1 parent
610b45e017
commit
60544e7814
21 files changed
+382
-111
No files matched your search
@@ -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)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user