-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
152 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using System.Runtime.InteropServices; | ||
using MoonWorks.Graphics; | ||
using MoonWorks.Math.Float; | ||
|
||
namespace Riateu.Graphics; | ||
|
||
/// <summary> | ||
/// A vertex type to be used for the shader info. Usually used by the ImGui renderer. | ||
/// </summary> | ||
[StructLayout(LayoutKind.Sequential)] | ||
public struct Position2DTextureColorVertex : IVertexType | ||
{ | ||
/// <summary> | ||
/// The position of the vertex in 2d space. | ||
/// </summary> | ||
public Vector2 Position; | ||
/// <summary> | ||
/// A screen-space location of the texture. | ||
/// </summary> | ||
public Vector2 TexCoord; | ||
/// <summary> | ||
/// A color that will be passed to the fragment shader | ||
/// </summary> | ||
public Color Color; | ||
|
||
/// <summary> | ||
/// Initialization for this struct. | ||
/// </summary> | ||
/// <param name="position">The position of the vertex in 2d space</param> | ||
/// <param name="texcoord">A screen-space location of the texture</param> | ||
/// <param name="color">A color that will be passed to the fragment shader</param> | ||
public Position2DTextureColorVertex( | ||
Vector2 position, | ||
Vector2 texcoord, | ||
Color color | ||
) | ||
{ | ||
Position = position; | ||
TexCoord = texcoord; | ||
Color = color; | ||
} | ||
|
||
/// <summary> | ||
/// The element format used for the graphics pipeline. | ||
/// </summary> | ||
public static VertexElementFormat[] Formats { get; } = new VertexElementFormat[3] | ||
{ | ||
VertexElementFormat.Vector2, | ||
VertexElementFormat.Vector2, | ||
VertexElementFormat.Color | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters