Getting the OpenGL context?
BlitzMax Forums/BlitzMax Programming/Getting the OpenGL context?
| ||
Hi, So, we just released a compatibility demo for Flow, but found there were issues with OpenGL in Fullscreen. The purpose: Attaching OGRE to the BlitzMax window. Basically we need to retrieve the actual OpenGL context- GetActiveWindow() is not working for some reason when using fullscreen, I'm not entirely sure that it's working correctly in windowed mode but Ogre seems to work with it happily. Basically, Ogre is using the value from GetActiveWindow(). This is invalid, so Ogre is creating it's own window, which does not receive Events that the Max window would use. SO! How can we go about getting the OpenGL context? Why was the _context value of Tgraphics driver made private? Could there be a GetGLContext() function in a future module update? Thanks, |
| ||
so for the demo you could just alter it or create the function and put in the models board then it will surely soon be within the SVN version of BM :) but yes I agree in some cases its hard to understand why important private variables didn't get at least getter functions |
| ||
I would recommend writing code to create the windows/contexts/what have you on your own. Doing this, you're far more likely to not have to fight against the current setup, and it's not like it's hard to do anyway. |
| ||
Dreamora, aha, could look into the function, BUT,really, the value i want is right in front of me. _context. @dingbat_blump. This is one option, but then, when you have what you are looking for right in front of you but cant use it, and are told to do something a little more complex to achieve what you want, it seems like a waste of time, yes? Either way, before release Flow will most likely route all bmax events to an Ogre created window, eliminating the problem, but this is a feature that will not only benefit Flow but any engine that can plug into an OpenGL context. [edit] Bugger, after all that it *is* returning the right value. odd behavior somewhere... Thanks guys. |
| ||
Doesn't canvasgraphics() and creategraphics() both return OpenGL context objects? |
| ||
No. |
| ||
Well then create a functionfunction GetGLContext:int() return _context end function and put it into the corresponding bmx and the module board as addition suggestion for the SVN :) |
| ||
Guys. I traced the Max sourcecode, GetActiveWindow() *does* return the GL context. (like, all it does is return _context) Our problem lies elsewhere now. |
| ||
You are using the correct way to create it right? not max2d gl context but the creategl... stuff with the correct buffer flags for OGRE |
| ||
not max2d gl context but the creategl... stuff with the correct buffer flags for OGRE Tried this last night, in this instance Ogre recognises there is a window but throws an exception. We are looking into it. there are a couple of solutions, just need to try them and see which works better :-) |
| ||
can't wait for it :D |