From: <am...@it...> - 2003-08-07 08:35:44
|
It=92s simple, just remove the last line=20 =20 =93this.swapBuffer();=94 =20 You mustn=92t call SwapBuffer inside your glDraw implementation.=20 OnPaint method in CsGL.OpenGL.OpenGLControl class, triggers SwapBuffer = by you: =20 /// <summary> /// prepare OpenGL for rendering on this window = by grabbing context and /// call glDraw. /// override glDraw to do gl operation. /// <p>this method Grab() the control context. /// </summary> protected override void OnPaint(PaintEventArgs pevent) { base.OnPaint(pevent); Context.Grab(); glDraw(); GL.glFinish(); SwapBuffer(); OpenGLException.Assert(); } =20 _____ =20 From: csg...@li... [mailto:csg...@li...] On Behalf Of Alban BARTHELEMY Sent: jueves, 07 de agosto de 2003 10:00 To: csg...@li... =20 Hi. sorry for my english... Nice work all, but i still have some trouble implementing double-buffer (openGL and not forms). I've written my control class, overriden OpenGLControl, and overriden glDraw. I'm using the screenSetting as Forms, and when i past this.swapBuffer() = in the overriden glDraw, my screen is flipping whit writting my openGL = render and a blank form. does anyone can help me, before i go back to c++ :)=3D i'll send you what shoold be in cause: ------------------------------------------------------- class ctrl: OpenGLControl{ ... public override void glDraw(){ GL.glClear(...); ... this.swapBuffer(); } ... public void Main(){ CsGL.Util.screenSetting sf =3D new ... ctrl c =3D new ctrl(); ctrl.Parent =3D sf; Application.run(sf); } } =20 Yeh, see you all |