Merged fix for issue [#1089]: "TextPrinter is affected by TextureGen* and TextureEnvMode" from 0.9.8 branch.

This commit is contained in:
the_fiddler 2009-08-09 18:54:35 +00:00
parent 5edfb98d03
commit fbab14bb7a
2 changed files with 38 additions and 11 deletions

View file

@ -17,7 +17,6 @@ using System.Diagnostics;
using System.Reflection.Emit;
#endregion
// Add a dummy namespace to keep old code compiling.
@ -968,8 +967,7 @@ namespace OpenTK.Graphics
unsafe
{
int length;
GL.GetProgram(program, OpenTK.Graphics.ProgramParameter.InfoLogLength, out length);
if (length == 0)
GL.GetProgram(program, OpenTK.Graphics.ProgramParameter.InfoLogLength, out length); if (length == 0)
{
info = String.Empty;
return;
@ -1274,6 +1272,27 @@ namespace OpenTK.Graphics
#endregion
#region TexEnv
public static void TexEnv(TextureEnvTarget target, TextureEnvParameter pname, System.Drawing.Color color)
{
Color4 c = new Color4(color);
unsafe
{
TexEnv(target, pname, &c.R);
}
}
public static void TexEnv(TextureEnvTarget target, TextureEnvParameter pname, Color4 color)
{
unsafe
{
TexEnv(target, pname, &color.R);
}
}
#endregion
#pragma warning restore 3019
#pragma warning restore 1591
#pragma warning restore 1572

View file

@ -86,6 +86,14 @@ namespace OpenTK.Graphics.Text
GL.Disable(EnableCap.DepthTest);
GL.TexEnv(TextureEnvTarget.TextureEnv, TextureEnvParameter.TextureEnvMode, (int)All.Modulate);
GL.TexEnv(TextureEnvTarget.TextureEnv, TextureEnvParameter.TextureEnvColor, new Color4(0, 0, 0, 0));
GL.Disable(EnableCap.TextureGenQ);
GL.Disable(EnableCap.TextureGenR);
GL.Disable(EnableCap.TextureGenS);
GL.Disable(EnableCap.TextureGenT);
RectangleF position;
SetColor(color);