
Troubles with lines without GL.Disable(EnableCap.Texture2D)
Posted Friday, 4 December, 2009 - 08:26 by eugene.chepurnykh inThe trouble is very simple. I'm working with textures and in init function call
OpenGLHelper.EnabledTexture2D
later, in renderer I must call
<b> OpenGLHelper.DisableTexture2D();</b> // Сursor line GL.Color3(Color.Black); GL.Begin(BeginMode.Lines); GL.Vertex2(timeline.TracksAreaBounds.Left, timeline.CursorOffset); GL.Vertex2(timeline.TracksAreaBounds.Width, timeline.CursorOffset); GL.End(); <b>OpenGLHelper.EnableTexture2D();</b>
Without these bold lines I have unpredictable behaviour. Sometimes alpha near 255, sometimes color of lines unexpected.
Does anybody have this kind of troubles?
Any suggestions will be appreciate.


Comments
Re: Troubles with lines without ...
If you don't disable texturing, then the lines will be textured. Since you aren't specifying a texture coordinate, OpenGL is simply using the last texture coordinate for both points in the line, which will give the entire line the color of whatever texel is addressed by the last call to GL.TexCoord. If you don't want your lines textured, then you need to disable texturing.