Removed old sacn view code

This commit is contained in:
Peter Slattery 2020-02-05 20:36:31 -08:00
parent b94ccef48f
commit 15e0b96f0c
2 changed files with 34 additions and 43 deletions

View File

@ -1,43 +0,0 @@
//
// File: foldhaus_sacn_view.cpp
// Author: Peter Slattery
// Creation Date: 2020-01-01
//
#ifndef FOLDHAUS_SACN_VIEW_CPP
internal void
DrawSACNUniversePixels (render_command_buffer* RenderBuffer, sacn_universe* ToDraw,
v2 TopLeft, v2 Dimension)
{
Assert(ToDraw);
s32 PixelsPerRow = 21;
r32 PixelDim = Dimension.x / PixelsPerRow;
v2 PixelSize = v2{PixelDim, PixelDim};
v2 PixelRegister = TopLeft;
v4 DisplayColor = {0, 0, 0, 1};
s32 PixelsToDraw = ToDraw->SizeInSendBuffer - STREAM_HEADER_SIZE;
render_quad_batch_constructor BatchConstructor = PushRenderQuad2DBatch(RenderBuffer, PixelsToDraw);
u8* ColorCursor = (u8*)ToDraw->StartPositionInSendBuffer + STREAM_HEADER_SIZE;
s32 PixelsDrawn = 0;
for (s32 i = 0; i < PixelsToDraw; i++)
{
PixelRegister.x = TopLeft.x + (PixelsDrawn % PixelsPerRow) * PixelDim;
PixelRegister.y = TopLeft.y - (PixelsDrawn / PixelsPerRow) * PixelDim;
r32 Value = *ColorCursor++ / 255.f;
DisplayColor.r = Value;
DisplayColor.g = Value;
DisplayColor.b = Value;
PushQuad2DOnBatch(&BatchConstructor, PixelRegister, PixelRegister + PixelSize, DisplayColor);
++PixelsDrawn;
}
}
#define FOLDHAUS_SACN_VIEW_CPP
#endif // FOLDHAUS_SACN_VIEW_CPP

View File

@ -26,6 +26,40 @@ DMXView_Cleanup(panel* Panel, app_state* State)
}
internal void
DrawSACNUniversePixels (render_command_buffer* RenderBuffer, sacn_universe* ToDraw,
v2 TopLeft, v2 Dimension)
{
Assert(ToDraw);
s32 PixelsPerRow = 21;
r32 PixelDim = Dimension.x / PixelsPerRow;
v2 PixelSize = v2{PixelDim, PixelDim};
v2 PixelRegister = TopLeft;
v4 DisplayColor = {0, 0, 0, 1};
s32 PixelsToDraw = ToDraw->SizeInSendBuffer - STREAM_HEADER_SIZE;
render_quad_batch_constructor BatchConstructor = PushRenderQuad2DBatch(RenderBuffer, PixelsToDraw);
u8* ColorCursor = (u8*)ToDraw->StartPositionInSendBuffer + STREAM_HEADER_SIZE;
s32 PixelsDrawn = 0;
for (s32 i = 0; i < PixelsToDraw; i++)
{
PixelRegister.x = TopLeft.x + (PixelsDrawn % PixelsPerRow) * PixelDim;
PixelRegister.y = TopLeft.y - (PixelsDrawn / PixelsPerRow) * PixelDim;
r32 Value = *ColorCursor++ / 255.f;
DisplayColor.r = Value;
DisplayColor.g = Value;
DisplayColor.b = Value;
PushQuad2DOnBatch(&BatchConstructor, PixelRegister, PixelRegister + PixelSize, DisplayColor);
++PixelsDrawn;
}
}
GSMetaTag(panel_render);
internal void
DMXView_Render(panel Panel, rect PanelBounds, render_command_buffer* RenderBuffer, app_state* State, context Context, mouse_state Mouse)