[Interest] glGetString from QML-based Wayland compositor

Pier Luigi pierluigi.fiorini at gmail.com
Tue Jan 8 10:05:15 CET 2013


Thanks it works!

2013/1/8 Samuel Rødal <samuel.rodal at digia.com>:
> On 01/07/2013 08:22 PM, Pier Luigi wrote:
>>
>> 2013/1/2 Samuel Rødal <samuel.rodal at digia.com>:
>>>
>>> On 12/28/2012 09:53 AM, Pier Luigi wrote:
>>>>
>>>>
>>>> However glGetString() always return NULL, I call it from the
>>>> sceneGraphInitialized() slot and I noticed that despite
>>>> openglContext() returns a valid pointer,
>>>> QOpenGLContext::currentContext() is 0.
>>>>
>>>> Someone has an idea on what I'm doing wrong?
>>>
>>>
>>> On which thread do you execute the slot connected to
>>> sceneGraphInitialized() ? The scene graph might run on a separate thread
>>> from the main UI thread, and the QOpenGLContext will then be made
>>> current there.
>>
>>
>> I first tried to use glGetString() from main after the compositor
>> creation but that should be a different thread than the rendering
>> thead:
>>
>>
>> https://github.com/hawaii-desktop/greenisland/blob/master/src/greenisland/main.cpp
>>
>> Then I tried to connect the signal on the QQuickView subclass constructor
>> to a
>> private slot.
>> The slot should be called from the rendering thread, giving me access
>> to the context but it doesn't seem to happen.
>
>
> The QQuickView exists in the main thread, so if you want the slot that you
> connect to the sceneGraphInitialized() signal to be executed on the
> rendering thread you need to make the connection a Qt::DirectConnection by
> passing that as the final argument to connect. The default will otherwise be
> Qt::QueuedConnection and the slot will still be executed on the main thread.
>
> --
> Samuel



-- 
Out of the box experience
http://www.maui-project.org/



More information about the Interest mailing list