Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
BlackBerry Development Advisor (Retired)
mgoulet
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha

Re: Accelerating QML with OpenGL

Can you show me your QML file?

Please use plain text.
Developer
trollixx
Posts: 60
Registered: ‎04-18-2012
My Device: BB10 Dev Alpha C

Re: Accelerating QML with OpenGL

Here's a simple qml I've used in my test app:

 

import QtQuick 1.1

Rectangle {
    anchors.fill: parent
    color: "red"

    Text {
        anchors.centerIn: parent
        color: "blue"
        text: "!!!"
    }
}

 

--
Oleg Shparber
Please use plain text.
Developer
connyhald
Posts: 102
Registered: ‎06-03-2012
My Device: Playbook

Re: Accelerating QML with OpenGL

Hi Oleg,

 

not sure if that helps, but I've sucessfully used QtQuick on OpenGL on Playbook and DevAlpha. One public project where I do that is "Plonk". Here is the main.c: https://gitorious.org/mong/mong/blobs/blackberry/src/main.cpp

 

I've used it with the preinstalled Qt 4.8.? on the DevAlpha and with custom build Qt 4.8.2. Both worked fine.

 

Cheers,

Conny

 

-----------
http://kodira.de
BB Apps: Pattern :: Plonk
Please use plain text.
Developer
trollixx
Posts: 60
Registered: ‎04-18-2012
My Device: BB10 Dev Alpha C

Re: Accelerating QML with OpenGL

Hi Conny!

Thank you! Will look at your code tomorrow and test on my device. If it works for you then somewhere should be a stupid mistake of mine :smileyhappy:
--
Oleg Shparber
Please use plain text.
Developer
connyhald
Posts: 102
Registered: ‎06-03-2012
My Device: Playbook

Re: Accelerating QML with OpenGL

Good luck :smileyhappy: Let me know how it goes.

 

Ah and if Plonk works but is laggy, that's a know (and now fixed) bug in Qt. Something to do with event handling but not related to the graphics system.

 

-----------
http://kodira.de
BB Apps: Pattern :: Plonk
Please use plain text.
Developer
trollixx
Posts: 60
Registered: ‎04-18-2012
My Device: BB10 Dev Alpha C

Re: Accelerating QML with OpenGL

Conny, thanks again. I've managed to run my app with OpenGL rendering. Now I got stuck with a new problem - orientation handling works very buggy, while without QGLWidget everything is fine.

 

Here's link to my test app: https://dl.dropbox.com/u/2535464/Bb10GlTest.tar.7z

 

P.S. Reason for my first trouble was showing QDeclarativeView after the start of event loop (QApplication::exec()). I don't know why it leads to problems on BB10 while works fine on Linux.

--
Oleg Shparber
Please use plain text.
Developer
connyhald
Posts: 102
Registered: ‎06-03-2012
My Device: Playbook

Re: Accelerating QML with OpenGL

Hmm... most of my tests had fixed orientation so I don't have too much experience with that. What exactly is the problem? And are you running on DevAlpha or Playbook? With default Qt or your own build?

-----------
http://kodira.de
BB Apps: Pattern :: Plonk
Please use plain text.
Developer
trollixx
Posts: 60
Registered: ‎04-18-2012
My Device: BB10 Dev Alpha C

Re: Accelerating QML with OpenGL

It's simpler to demonstrate the problem :smileyhappy:
1. Original screen http://ubuntuone.com/5QTnS0Gm20BemR1G1sHFFK
2. Rotated to portrait mode http://ubuntuone.com/5qQ4IdotD4PHsNgXiNlWel
3. Rotated back to landscape http://ubuntuone.com/2nhRL6F5D9bRdG7D8bSytS

I'm testing on Dev Alpha with default Qt libs.
--
Oleg Shparber
Please use plain text.
Developer
connyhald
Posts: 102
Registered: ‎06-03-2012
My Device: Playbook

Re: Accelerating QML with OpenGL

Thanks for the screenshots - that looks really strange. I will test it as soon as I manage to turn on my DevAlpha device. Currently having some issues with that :smileysad:

 

-----------
http://kodira.de
BB Apps: Pattern :: Plonk
Please use plain text.
BlackBerry Development Advisor (Retired)
mgoulet
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha

Re: Accelerating QML with OpenGL

I am not so familiar with OpenGL using QtQuick, but when your device is rotating, are you calling any code to accomodate the change?

 

e.g.

bbutil_init_egl(m_screen_cxt, GL_ES_1, newWidth, newHeight)

 

Martin

Please use plain text.