Skip to content
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.

Commit

Permalink
applyShader no longer applies
Browse files Browse the repository at this point in the history
  • Loading branch information
flibitijibibo committed Apr 23, 2014
1 parent 5b6f442 commit 8d5d7ef
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions MonoGame.Framework/Graphics/GraphicsDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ public void SetVertexBuffers(params VertexBufferBinding[] vertexBuffers)
int primitiveCount
) {
// Flush the GL state before moving on!
ApplyState(true);
ApplyState();

// Unsigned short or unsigned int?
bool shortIndices = Indices.IndexElementSize == IndexElementSize.SixteenBits;
Expand Down Expand Up @@ -791,7 +791,7 @@ int instanceCount
}

// Flush the GL state before moving on!
ApplyState(true);
ApplyState();

// Unsigned short or unsigned int?
bool shortIndices = Indices.IndexElementSize == IndexElementSize.SixteenBits;
Expand Down Expand Up @@ -853,7 +853,7 @@ int primitiveCount
VertexDeclaration vertexDeclaration
) where T : struct {
// Flush the GL state before moving on!
ApplyState(true);
ApplyState();

// Unbind current VBOs.
OpenGLDevice.Instance.BindVertexBuffer(0);
Expand Down Expand Up @@ -886,8 +886,7 @@ VertexDeclaration vertexDeclaration
public void DrawPrimitives(PrimitiveType primitiveType, int vertexStart, int primitiveCount)
{
// Flush the GL state before moving on!
ApplyState(true);
OpenGLDevice.Instance.FlushGLState();
ApplyState();

// Set up the vertex buffers
foreach (VertexBufferBinding vertBuffer in vertexBufferBindings)
Expand Down Expand Up @@ -949,7 +948,7 @@ int primitiveCount
VertexDeclaration vertexDeclaration
) where T : struct {
// Flush the GL state before moving on!
ApplyState(true);
ApplyState();

// Unbind current buffer objects.
OpenGLDevice.Instance.BindVertexBuffer(0);
Expand Down Expand Up @@ -1016,7 +1015,7 @@ int primitiveCount
VertexDeclaration vertexDeclaration
) where T : struct, IVertexType {
// Flush the GL state before moving on!
ApplyState(true);
ApplyState();

// Unbind current buffer objects.
OpenGLDevice.Instance.BindVertexBuffer(0);
Expand Down Expand Up @@ -1093,7 +1092,7 @@ private static BeginMode PrimitiveTypeGL(PrimitiveType primitiveType)

#region Private State Flush Methods

private void ApplyState(bool applyShaders)
private void ApplyState()
{
// Apply BlendState
OpenGLDevice.Instance.AlphaBlendEnable.Set(
Expand Down Expand Up @@ -1157,12 +1156,6 @@ private void ApplyState(bool applyShaders)

// TODO: MSAA?

// If we're not applying shaders then drop out now.
if (!applyShaders)
{
return;
}

if (VertexShader == null)
{
throw new InvalidOperationException("A vertex shader must be set!");
Expand Down

0 comments on commit 8d5d7ef

Please sign in to comment.