New Image3D command.
This commit is contained in:
parent
7ce474d92a
commit
20c126fb88
@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Quik.CommandMachine
|
||||
{
|
||||
@ -230,7 +231,7 @@ namespace Quik.CommandMachine
|
||||
Enqueue(uv);
|
||||
}
|
||||
|
||||
public void Image(QuikTexture texture, QRectangle[] rectangles, bool interleavedUV = false)
|
||||
public void Image(QuikTexture texture, ReadOnlySpan<QRectangle> rectangles, bool interleavedUV = false)
|
||||
{
|
||||
int count = rectangles.Length;
|
||||
ImageCommandFlags flags = ImageCommandFlags.None;
|
||||
@ -251,7 +252,7 @@ namespace Quik.CommandMachine
|
||||
}
|
||||
}
|
||||
|
||||
public void Image(QuikTexture texture, QRectangle[] rectangles, QRectangle[] uvs)
|
||||
public void Image(QuikTexture texture, ReadOnlySpan<QRectangle> rectangles, ReadOnlySpan<QRectangle> uvs)
|
||||
{
|
||||
int count = Math.Min(rectangles.Length, uvs.Length);
|
||||
Enqueue(Command.Image);
|
||||
@ -265,6 +266,30 @@ namespace Quik.CommandMachine
|
||||
}
|
||||
}
|
||||
|
||||
public void Image3D(QuikTexture texture, in Image3DCall call)
|
||||
{
|
||||
Enqueue(Command.Image);
|
||||
Enqueue(new Frame(ImageCommandFlags.Image3d | ImageCommandFlags.Single));
|
||||
Enqueue(new Frame(texture));
|
||||
Enqueue(call.Rectangle);
|
||||
Enqueue(call.UVs);
|
||||
Enqueue(new Frame(call.Layer));
|
||||
}
|
||||
|
||||
public void Image3D(QuikTexture texture, ReadOnlySpan<Image3DCall> calls)
|
||||
{
|
||||
Enqueue(Command.Image);
|
||||
Enqueue(new Frame((int)ImageCommandFlags.Image3d, calls.Length));
|
||||
Enqueue(new Frame(texture));
|
||||
|
||||
foreach (Image3DCall call in calls)
|
||||
{
|
||||
Enqueue(call.Rectangle);
|
||||
Enqueue(call.UVs);
|
||||
Enqueue(new Frame(call.Layer));
|
||||
}
|
||||
}
|
||||
|
||||
public void Splice(CommandList list)
|
||||
{
|
||||
foreach (Frame frame in list)
|
||||
|
18
Quik/CommandMachine/Image.cs
Normal file
18
Quik/CommandMachine/Image.cs
Normal file
@ -0,0 +1,18 @@
|
||||
namespace Quik.CommandMachine
|
||||
{
|
||||
public enum ImageCommandFlags
|
||||
{
|
||||
None = 0,
|
||||
|
||||
Single = 1 << 0,
|
||||
UVs = 1 << 1,
|
||||
Image3d = 1 << 2,
|
||||
}
|
||||
|
||||
public struct Image3DCall
|
||||
{
|
||||
public QRectangle Rectangle;
|
||||
public QRectangle UVs;
|
||||
public int Layer;
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
namespace Quik.CommandMachine
|
||||
{
|
||||
public enum ImageCommandFlags
|
||||
{
|
||||
None = 0,
|
||||
|
||||
Single = 1 << 0,
|
||||
UVs = 1 << 1
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user