Rename AttributeUsage enum to AttribUsage
as to not shadow [AttributeUsage]
This commit is contained in:
parent
dc3bd050da
commit
34cb598fe2
|
@ -1,6 +1,6 @@
|
|||
namespace BizHawk.Bizware.BizwareGL
|
||||
{
|
||||
public enum AttributeUsage
|
||||
public enum AttribUsage
|
||||
{
|
||||
Unspecified,
|
||||
Position,
|
|
@ -24,9 +24,9 @@ namespace BizHawk.Bizware.BizwareGL
|
|||
Owner = owner;
|
||||
|
||||
VertexLayout = owner.CreateVertexLayout();
|
||||
VertexLayout.DefineVertexAttribute("aPosition", 0, 2, VertexAttribPointerType.Float, AttributeUsage.Position, false, 32, 0);
|
||||
VertexLayout.DefineVertexAttribute("aTexcoord", 1, 2, VertexAttribPointerType.Float, AttributeUsage.Texcoord0, false, 32, 8);
|
||||
VertexLayout.DefineVertexAttribute("aColor", 2, 4, VertexAttribPointerType.Float, AttributeUsage.Texcoord1, false, 32, 16);
|
||||
VertexLayout.DefineVertexAttribute("aPosition", 0, 2, VertexAttribPointerType.Float, AttribUsage.Position, false, 32, 0);
|
||||
VertexLayout.DefineVertexAttribute("aTexcoord", 1, 2, VertexAttribPointerType.Float, AttribUsage.Texcoord0, false, 32, 8);
|
||||
VertexLayout.DefineVertexAttribute("aColor", 2, 4, VertexAttribPointerType.Float, AttribUsage.Texcoord1, false, 32, 16);
|
||||
VertexLayout.Close();
|
||||
|
||||
_Projection = new MatrixStack();
|
||||
|
|
|
@ -18,9 +18,9 @@ namespace BizHawk.Bizware.BizwareGL
|
|||
Owner = owner;
|
||||
|
||||
VertexLayout = owner.CreateVertexLayout();
|
||||
VertexLayout.DefineVertexAttribute("position", 0, 4, VertexAttribPointerType.Float, AttributeUsage.Position, false, 40, 0);
|
||||
VertexLayout.DefineVertexAttribute("color", 1, 4, VertexAttribPointerType.Float, AttributeUsage.Color0, false, 40, 16); //just dead weight, i have no idea why this is here. but some old HLSL compilers (used in bizhawk for various reasons) will want it to exist here since it exists in the vertex shader
|
||||
VertexLayout.DefineVertexAttribute("tex", 2, 2, VertexAttribPointerType.Float, AttributeUsage.Texcoord0, false, 40, 32);
|
||||
VertexLayout.DefineVertexAttribute("position", 0, 4, VertexAttribPointerType.Float, AttribUsage.Position, false, 40, 0);
|
||||
VertexLayout.DefineVertexAttribute("color", 1, 4, VertexAttribPointerType.Float, AttribUsage.Color0, false, 40, 16); //just dead weight, i have no idea why this is here. but some old HLSL compilers (used in bizhawk for various reasons) will want it to exist here since it exists in the vertex shader
|
||||
VertexLayout.DefineVertexAttribute("tex", 2, 2, VertexAttribPointerType.Float, AttribUsage.Texcoord0, false, 40, 32);
|
||||
VertexLayout.Close();
|
||||
|
||||
string defines = "";
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace BizHawk.Bizware.BizwareGL
|
|||
}
|
||||
|
||||
/// <exception cref="InvalidOperationException">already closed (by call to <see cref="Close"/>)</exception>
|
||||
public void DefineVertexAttribute(string name, int index, int components, VertexAttribPointerType attribType, AttributeUsage usage, bool normalized, int stride, int offset = 0)
|
||||
public void DefineVertexAttribute(string name, int index, int components, VertexAttribPointerType attribType, AttribUsage usage, bool normalized, int stride, int offset = 0)
|
||||
{
|
||||
if (Closed)
|
||||
throw new InvalidOperationException("Type is Closed and is now immutable.");
|
||||
|
@ -65,7 +65,7 @@ namespace BizHawk.Bizware.BizwareGL
|
|||
public bool Normalized { get; internal set; }
|
||||
public int Stride { get; internal set; }
|
||||
public int Offset { get; internal set; }
|
||||
public AttributeUsage Usage { get; internal set; }
|
||||
public AttribUsage Usage { get; internal set; }
|
||||
}
|
||||
|
||||
public class MyDictionary : WorkingDictionary<int, LayoutItem>
|
||||
|
|
|
@ -367,17 +367,17 @@ namespace BizHawk.Bizware.DirectX
|
|||
byte usageIndex = 0;
|
||||
switch(item.Usage)
|
||||
{
|
||||
case AttributeUsage.Position:
|
||||
case AttribUsage.Position:
|
||||
usage = DeclarationUsage.Position;
|
||||
break;
|
||||
case AttributeUsage.Texcoord0:
|
||||
case AttribUsage.Texcoord0:
|
||||
usage = DeclarationUsage.TextureCoordinate;
|
||||
break;
|
||||
case AttributeUsage.Texcoord1:
|
||||
case AttribUsage.Texcoord1:
|
||||
usage = DeclarationUsage.TextureCoordinate;
|
||||
usageIndex = 1;
|
||||
break;
|
||||
case AttributeUsage.Color0:
|
||||
case AttribUsage.Color0:
|
||||
usage = DeclarationUsage.Color;
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -758,22 +758,22 @@ namespace BizHawk.Client.EmuHawk
|
|||
//comment SNACKPANTS
|
||||
switch (kvp.Value.Usage)
|
||||
{
|
||||
case AttributeUsage.Position:
|
||||
case AttribUsage.Position:
|
||||
GL.EnableClientState(ArrayCap.VertexArray);
|
||||
GL.VertexPointer(kvp.Value.Components,VertexPointerType.Float,kvp.Value.Stride,new IntPtr(pData) + kvp.Value.Offset);
|
||||
break;
|
||||
case AttributeUsage.Texcoord0:
|
||||
case AttribUsage.Texcoord0:
|
||||
GL.ClientActiveTexture(TextureUnit.Texture0);
|
||||
GL.EnableClientState(ArrayCap.TextureCoordArray);
|
||||
GL.TexCoordPointer(kvp.Value.Components, TexCoordPointerType.Float, kvp.Value.Stride, new IntPtr(pData) + kvp.Value.Offset);
|
||||
break;
|
||||
case AttributeUsage.Texcoord1:
|
||||
case AttribUsage.Texcoord1:
|
||||
GL.ClientActiveTexture(TextureUnit.Texture1);
|
||||
GL.EnableClientState(ArrayCap.TextureCoordArray);
|
||||
GL.TexCoordPointer(kvp.Value.Components, TexCoordPointerType.Float, kvp.Value.Stride, new IntPtr(pData) + kvp.Value.Offset);
|
||||
GL.ClientActiveTexture(TextureUnit.Texture0);
|
||||
break;
|
||||
case AttributeUsage.Color0:
|
||||
case AttribUsage.Color0:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue