I have an application with my .Net OpenGL component that basically Shows a form with my openGL control, then creates, shows and closes at intervals of 1 second another form with my opengl control.
I have these problems on a pc with ATI Radeon HD 5450, Catalyst 12.4:
If I run my application from outside Visual Studio, sooner or later (but not after a fixed number of opened forms) I will get an “Attempted to read or write protected memory” exception in various part of my code where I do various things (for example a glCallList(), or glDeleteTexture()…).
If I run it from Visual Studio, when the second form is closed and the third one is created and shown (the first one remains always visible) the code hangs in the initialization of my OpenGL control where I compile a shader and in particular at the call where I get its GL_COMPILE_STATUS value:
glGetShaderiv(shaderObj, GL_COMPILE_STATUS, ref shaderStatus);
Note that the shader compilation was fine for the first 2 forms…
If I remove the creation and compilation of the shaders the crashes and the hang disappear.
Also, If I don’t keep the first Form visible, but just open and close a Form, the crashes disappear too.
To make things worse, these problems don’t happen on another machine with another ATI card (FirePro V3750) and an older Catalyst version.
Do you have any idea of what I could be doing wrong or how could I debug this problem?
I tried using gDebugger but had not success with it (it doesn’t seem to intercept my OpenGL calls…).
Any idea is welcome…