|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
Peter Bladon
Joined: 29 Sep 2008 Posts: 4 Location: Glasgow
|
Posted: Wed May 20, 2009 9:00 pm Post subject: Problem with swap_opengl_buffers in ClearWin+ OpenGl code. |
|
|
If a call is made thus:
call swap_opengl_buffers()
and there is not an open buffer (i.e. if there have been no calls to openGl drawing routines in the current window) then a fatal error results, and the program crashes.
I have a work around. This basically makes sure that the swap call only occurs in one place in a program and that a global logical is set true only
when drawing has been initiated. Then this logical is tested immediately prior to the swap call. This works, but it is not elegant, and more seriously, makes restrictions on the design of the code.
Is it possible that the error generated could be made not fatal? _________________ Dr. Peter Bladon
Gallowhill House, Larch Avenue
Lenzie, Kirkintilloch
Glasgow G66 4HX |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7929 Location: Salford, UK
|
Posted: Thu May 21, 2009 8:15 am Post subject: |
|
|
I don't have a satisfactory answer to your problem.
TRAP_EXCEPTION@ and SET_TRAP@ can be used in some circumstances but maybe not for an exception generated in a third-party DLL. Recovery after using these routines is limited anyway. |
|
Back to top |
|
|
JohnHorspool
Joined: 26 Sep 2005 Posts: 270 Location: Gloucestershire UK
|
Posted: Fri May 22, 2009 10:27 am Post subject: |
|
|
Peter,
As Paul has stated your error is generated from code not supplied by Silverfrost and thus he can do nothing to change this.
I had many bugs, crashes and general problems when I first started using OpenGL, as it is so different to any other graphics I had worked on previously (GDI, HPstarbase, Tektronix). I use glGetError to trap OpenGL specific errors, though I have never got the program to recover it does at least give me a more graceful exit.
I have found OpenGL to be intolerant to any bad data passed to it, thus I had to be sure that plot data was sanitised and the code robust. (plotting STL data created by CAD where a facet had almost zero area, evaluating the surface normal caused numerical problems for OpenGL and I had to filter out such stuff)
I use lists to store plot data, then call a routine that sets the background, displays all the defined lists and finally does the buffer swap at the end. Thus I have never experienced your particular problem. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|