OpenGLDriver: Calling makeCurrent() on every beginScene() ?

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

OpenGLDriver: Calling makeCurrent() on every beginScene() ?

Post by devsh »

Why are you doing this to me?

No, but really, what is the reason for calling changeRenderContext every frame?

*Its like the most painfully slow OpenGL call you can make (takes roughly 0.25ms)
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: OpenGLDriver: Calling makeCurrent() on every beginScene(

Post by Nadro »

Hi,

Thanks for a report this issue, it'll be fixed in the upcoming commit.

Cheers,
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: OpenGLDriver: Calling makeCurrent() on every beginScene(

Post by hendu »

I wonder if that's needed for the Qt and WxWidgets embedders?
elvman
Posts: 253
Joined: Sun Sep 17, 2006 9:37 am
Location: Riga, Latvia
Contact:

Re: OpenGLDriver: Calling makeCurrent() on every beginScene(

Post by elvman »

Actually this is needed for OSX, because render context can be changed by OSX GUI. I fixed this bug for cocos2d-x by also making the context current before every frame: https://github.com/cocos2d/cocos2d-x/pull/14598
Ouzel – 2D game engine
Realistic water node
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: OpenGLDriver: Calling makeCurrent() on every beginScene(

Post by Mel »

Perhaps you could make that "changeRenderContext" OSX specific then?
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: OpenGLDriver: Calling makeCurrent() on every beginScene(

Post by hendu »

Qt and Wx also run on Linux, Windows, etc. So if they need it, you can't filter by platform.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: OpenGLDriver: Calling makeCurrent() on every beginScene(

Post by Nadro »

I'll check how this situation looks at OSX 10.9. If it will be required for Qt, wx etc. we can call glMakeCurrent only when SIrrlichtCreationParams::windowId isn't equal NULL, however IIRC this issue is just my mistake (missing simple 'if') :P
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Post Reply