Skip to content

Commit

Permalink
adding blending enable/disable statements
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Dillon committed May 20, 2012
1 parent 222baae commit 207485a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions FieldRenderer.cs
Expand Up @@ -199,8 +199,10 @@ protected override void DoDraw(FrameEventArgs e)
GL.ActiveTexture(TextureUnit.Texture0); GL.ActiveTexture(TextureUnit.Texture0);
GL.BindTexture(TextureTarget.Texture2D, ResourceCommons.BlockGhost); GL.BindTexture(TextureTarget.Texture2D, ResourceCommons.BlockGhost);
GL.BindSampler(0, ResourceCommons.BlockGhostSampler); GL.BindSampler(0, ResourceCommons.BlockGhostSampler);
GL.Enable(EnableCap.Blend);
DrawGhostBlock(); DrawGhostBlock();
DrawOther(); DrawOther();
GL.Disable(EnableCap.Blend);
} }


internal void DrawScoreUI() internal void DrawScoreUI()
Expand Down
2 changes: 2 additions & 0 deletions InterleavedFieldManager.cs
Expand Up @@ -102,11 +102,13 @@ protected override void DoDraw(FrameEventArgs e)
GL.ActiveTexture(TextureUnit.Texture0); GL.ActiveTexture(TextureUnit.Texture0);
GL.BindTexture(TextureTarget.Texture2D, ResourceCommons.BlockGhost); GL.BindTexture(TextureTarget.Texture2D, ResourceCommons.BlockGhost);
GL.BindSampler(0, ResourceCommons.BlockGhostSampler); GL.BindSampler(0, ResourceCommons.BlockGhostSampler);
GL.Enable(EnableCap.Blend);
for (int i = 0; i < (int)players; i++) for (int i = 0; i < (int)players; i++)
{ {
renderer[i].DrawGhostBlock(); renderer[i].DrawGhostBlock();
renderer[i].DrawOther(); renderer[i].DrawOther();
} }
GL.Disable(EnableCap.Blend);
} }
} }
} }
Expand Down
1 change: 0 additions & 1 deletion Program.cs
Expand Up @@ -92,7 +92,6 @@ protected override void OnRenderFrame(FrameEventArgs e)
GL.Enable(EnableCap.Texture2D); GL.Enable(EnableCap.Texture2D);
GL.Enable(EnableCap.DepthTest); GL.Enable(EnableCap.DepthTest);
GL.Enable(EnableCap.CullFace); GL.Enable(EnableCap.CullFace);
GL.Enable(EnableCap.Blend);
//GL.Enable(EnableCap.FramebufferSrgb); //GL.Enable(EnableCap.FramebufferSrgb);
GL.BlendEquation(BlendEquationMode.FuncAdd); GL.BlendEquation(BlendEquationMode.FuncAdd);
GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha); GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
Expand Down

0 comments on commit 207485a

Please sign in to comment.