View Full Version : help, OGL crash
08-12-2002, 02:18 AM
I've added PFD_DRAW_TO_BITMAP OpenGL support and after that the OGL crashes appeared. I have multithreaded rendering, and my first thinking is bad synchronization with device context changes, because maybe GL rendering exist when I try to resize or reallocate bitmap for DC. I'm trying glFlush and CriticalSection but with no result, maybe you can give me some advices or which can be a reason of my problem?
08-12-2002, 04:07 AM
Start your debugger and pinpoint the exact codeline that crashes, perhaps?
DRAW_TO_BITMAP is probably only supported by the generic MS OpenGL implementation. Are you using any OpenGL functions not in version 1.1?
Do you check all extension functions got via wglGetProcAddress for correct pointers?
08-13-2002, 06:15 AM
There is no exact line where is crash appeared, more often this is a glGetIntegerv(GL_VIEWPORT...). I don't use any function which are not OpenGL 1.1.
08-14-2002, 04:26 AM
It's impossible to tell what's wrong by your description.
The multithreaded aspect of this is disturbing. If you say it crashes while you're resizing the window and the crash appears more often in glGetIntegerv(GL_VIEWPORT,), well, that sounds like a sychronization issue.
If you reallocate the bitmap while you're drawing onto it with a parallel thread using OpenGL, all sorts of bad things could happen.
The same thread that draws must be responsible for the bitmap it draws onto, or you must serialize drawing with window resizes. Don't allow resize until other thread has finished drawing.
08-14-2002, 07:30 AM
Ok, thank you
I have fixed the problem!
In fact I synchronized only bitmap drawing early, so using glFinish and synchronizing all OGL drawing resolves the problem.
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.