karlschiffmann's picture

LineStipple problems

Hello... I am having problems with LineStipple - please see the screenshot - it seems to wrap-around and double up - it depends upon the window size.

If this is just a case of my OpenGL inexperience - my apologies... but would you be able to help me anyway? Thank you!

Here is the section of code I am using to create the stippled lines...

GL.Color3(_Settings.DisplaySettings.Grid.RealColor);
GL.LineWidth((float)0.5);
GL.Enable(EnableCap.LineStipple);
GL.LineStipple(4, 0xAAAA);
for (int i = 0; i < grid_num_vert; i++)
{
double yval = units_per_line_y * i;
GL.Begin(BeginMode.Lines);
GL.Vertex2(posX_WedgeLeftBorder, yval);
GL.Vertex2(posX_WedgeRiteBorder, yval);
GL.End();
}
if (!_Settings.DisplaySettings.Horz_ShowAxis)
{
GL.Begin(BeginMode.Lines);
GL.Vertex2(posX_WedgeLeftBorder, posY_WedgeBotBorder);
GL.Vertex2(posX_WedgeRiteBorder, posY_WedgeBotBorder);
GL.End();
}
GL.Disable(EnableCap.LineStipple);

Inline Images