multithreading - glGenTextures not returning a texture name -
i creating opengl game on windows 7 machine using vs2010. in addition, sdl, qtcore, qtxml , fbxsdk used assist in development. experiencing peculiar problem glgentextures when running outside debug mode. let me explain.
when compile , run application in debug mode, models textured , displayed properly. debug application or compile , run application using release mode textures no longer being applied models.
i have tracked down problem glgentextures not giving me valid name. not give me errors either. way loading follows:
models loaded fbx through fbxsdk, required textures loaded model loaded. models loaded in thread, made sure no opengl functions called anywhere while thread loading models. if don't load models in thread works. tried can think of including halting main thread while models loaded guarantee nothing else if happening while models loaded. none of works.
again wouldn't weird except compiling debug works. release , debugging application doesn't work. thoughts?
i can guess, did maybe not make gl context current on model loading thread? remember opengl context thread specific!
on other hand, it's advised against use same gl context in different threads. either use different context , share resources, or defer gl calls main gl thread.
the difference when using debugging mode vs use debug-heap when debug, won't use when run debug build without actual debugging.
however, if threads thing wrong, kinds of crazy side-effects can happen debug heap might "hide".
Comments
Post a Comment