Remove VertexPos3f.

This commit is contained in:
UnknownShadow200 2015-04-25 07:51:40 +10:00
parent fad0a17199
commit d48fe34c21
2 changed files with 8 additions and 24 deletions

View file

@ -129,8 +129,6 @@ namespace ClassicalSharp.GraphicsAPI {
public abstract void DeleteVb( int id );
public abstract void DrawVbPos3f( DrawMode mode, int id, int verticesCount );
public abstract void DrawVbPos3fTex2f( DrawMode mode, int id, int verticesCount );
public abstract void DrawVbPos3fCol4b( DrawMode mode, int id, int verticesCount );
@ -146,7 +144,7 @@ namespace ClassicalSharp.GraphicsAPI {
protected int GetSizeInBytes( int count, VertexFormat format ) {
return count * strideSizes[(int)format];
}
protected static int[] strideSizes = new [] { 12, 20, 16, 24 };
protected static int[] strideSizes = new [] { 20, 16, 24 };
public abstract void SetMatrixMode( MatrixType mode );
@ -246,10 +244,9 @@ namespace ClassicalSharp.GraphicsAPI {
}
public enum VertexFormat {
VertexPos3f = 0,
VertexPos3fTex2f = 1,
VertexPos3fCol4b = 2,
VertexPos3fTex2fCol4b = 3
VertexPos3fTex2f = 0,
VertexPos3fCol4b = 1,
VertexPos3fTex2fCol4b = 2,
}
public enum DrawMode {

View file

@ -274,11 +274,10 @@ namespace ClassicalSharp.GraphicsAPI {
Action<DrawMode, int, int>[] drawBatchFuncs;
Action<DrawMode, int, int> drawBatchFunc;
void SetupVb() {
drawBatchFuncs = new Action<DrawMode, int, int>[4];
drawBatchFuncs[0] = (mode, id, count) => DrawVbPos3fFast( mode, id, count );
drawBatchFuncs[1] = (mode, id, count) => DrawVbPos3fTex2fFast( mode, id, count );
drawBatchFuncs[2] = (mode, id, count) => DrawVbPos3fCol4bFast( mode, id, count );
drawBatchFuncs[3] = (mode, id, count) => DrawVbPos3fTex2fCol4bFast( mode, id, count );
drawBatchFuncs = new Action<DrawMode, int, int>[3];
drawBatchFuncs[0] = (mode, id, count) => DrawVbPos3fTex2fFast( mode, id, count );
drawBatchFuncs[1] = (mode, id, count) => DrawVbPos3fCol4bFast( mode, id, count );
drawBatchFuncs[2] = (mode, id, count) => DrawVbPos3fTex2fCol4bFast( mode, id, count );
}
public override int InitVb<T>( T[] vertices, DrawMode mode, VertexFormat format, int count ) {
@ -389,12 +388,6 @@ namespace ClassicalSharp.GraphicsAPI {
GL.Arb.DeleteBuffers( 1, ref id );
}
public override void DrawVbPos3f( DrawMode mode, int id, int verticesCount ) {
BeginVbBatch( VertexFormat.VertexPos3f );
DrawVbBatch( mode, id, verticesCount );
EndVbBatch();
}
public override void DrawVbPos3fTex2f( DrawMode mode, int id, int verticesCount ) {
BeginVbBatch( VertexFormat.VertexPos3fTex2f );
DrawVbBatch( mode, id, verticesCount );
@ -455,12 +448,6 @@ namespace ClassicalSharp.GraphicsAPI {
GL.Arb.BindBuffer( BufferTargetArb.ArrayBuffer, 0 );
}
void DrawVbPos3fFast( DrawMode mode, int id, int verticesCount ) {
GL.Arb.BindBuffer( BufferTargetArb.ArrayBuffer, id );
GL.VertexPointer( 3, VertexPointerType.Float, 12, new IntPtr( 0 ) );
GL.DrawArrays( modeMappings[(int)mode], 0, verticesCount );
}
void DrawVbPos3fTex2fFast( DrawMode mode, int id, int verticesCount ) {
GL.Arb.BindBuffer( BufferTargetArb.ArrayBuffer, id );
GL.VertexPointer( 3, VertexPointerType.Float, 20, new IntPtr( 0 ) );