Draw shaded and wireframe

1
FH
9/18/2015 12:14 AM

I need to render a surface as shaded with the wireframe overtop.
The general sequence is a two pass:

GL.PolygonMode( frontandback, fill )
glGraphics.Paint(ClientSize.Width, ClientSize.Height) //Pass 1: Render the model as shaded
GL.PolygonMode( frontandback, line)
GL.PolygonOffset(1,1)
glGraphics.Paint(ClientSize.Width, ClientSize.Height) //Pass2: Render the model in wireframe
SwapBuffer

The problem is that Pass1 paint also does the swapbuffer.
Is there another way to do this? Or perhaps an enhancement?

Regards

FH
9/18/2015 1:04 AM

An approach that seems to work:
derive new class from GLGraphics3D and override OnDrawScene to draw two pass
e.g

base.OnDrawScene(e); // pass 1

GL.PolygonMode( frontandback, line)
GL.PolygonOffset(1,1)

base.OnDrawScene(e); // pass 2
// reset modes and offset

Any other suggestions welcome!

Regards

1