
Suggestions for a OpenTK rookie (line stipple)
Posted Wednesday, 22 February, 2012 - 16:39 by m_elias inI've just started playing around with OpenTK, I have no previous OpenGL or DirectX type programming experience. I have been reading through OpenGL Superbible, Fourth Edition by Wright/Lipchak/Haemel and I would appreciate some pointers on how to convert the examples etc to OpenTK. At this point, specifically line stipple. I'm probably missing something obvious.
I am enabling it in my init routine.
GL.Enable(EnableCap.LineStipple);
Then in my rendering routine I am drawing a grid.
GL.Begin(BeginMode.Lines); { for (double i = -100.0; i < 101.0; i++) { GL.LineStipple(2, Convert.ToInt16("1111000011110000",2)); GL.Vertex3(i, -0.01, -100.0); GL.Vertex3(i, -0.01, 100.0); GL.LineStipple(1, Convert.ToInt16("1111111111111111", 2)); GL.Vertex3(-100, -0.01, i); GL.Vertex3(100, -0.01, i); } } GL.End();
It just shows up with solid lines, as if it's completely ignoring the stipple commands.


Comments
Re: Suggestions for a OpenTK rookie (line stipple)
Here it is the code...
For more information
http://www.java-tips.org/other-api-tips/jogl/how-to-draw-lines-in-differ...
Re: Suggestions for a OpenTK rookie (line stipple)
Ok, so commands such as GL.LineStipple have to be before/outside the GL.Begin/End blocks.
Thanks.