If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

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
Developer
trollixx
Posts: 60
Registered: ‎04-18-2012
My Device: BB10 Dev Alpha C
My Carrier: T-Mobile

Accelerating QML with OpenGL

[ Edited ]

I've stuck with enabling OpenGL rendering on BB10 Dev Alpha.

 

The following code works correctly on Linux desktop, but not on BB10 device it leads to white screen.

QDeclarativeView *view = new QDeclarativeView;
QGLFormat format = QGLFormat::defaultFormat();
QGLWidget *glWidget = new QGLWidget(format);
glWidget->setAutoFillBackground(false);
view->setViewport(glWidget);
view->setSource("qml/main.qml");

 Have anyone managed to run QML app accelerated?

--
Oleg Shparber
Please use plain text.
BlackBerry Development Advisor (Retired)
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: Accelerating QML with OpenGL

Are you using cascades QML or Qt QML?

Cascades is restricted to the cascades UI classes.  You can use any class documented in https://bdsc.webapps.blackberry.com/cascades/reference/classes.html

 

If you want to use openGL in cascades, try using a ForeignWindow.

 

Stuart

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

Re: Accelerating QML with OpenGL

I use Qt Quick, not Cascades.
--
Oleg Shparber
Please use plain text.
Developer
HorizonXP
Posts: 133
Registered: ‎03-28-2011
My Device: BlackBerry 9900 & PlayBook
My Carrier: Bell

Re: Accelerating QML with OpenGL

You can login to your Dev Alpha via SSH, and navigate to your app's sandbox to view the logs to confirm what I'm about to say, but I'm betting your error is related to the fact that the QtGui library is not included on the device. So you will have to package it yourself.

 

If you're still having issues, I can post the code i use for the PlayBook. 


Founder of Pulsecode Inc. and taab
Authomator - Two-factor authentication codes on BlackBerry 10 - http://www.xitijpatel.com/ - Follow @xitijpatel
Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Accelerating QML with OpenGL

HorizonXP, actually libQtGui is included:

-rwxr-xr-x 1 root nto 8258064 Apr 15 10:48 libQtGui.so.4.8.0

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
BlackBerry Development Advisor (Retired)
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: Accelerating QML with OpenGL

I assume you've stepped through in the debugger, ensured that all pointers are non-zero and that glWidget->isValid returns true?  Has the debugger given you any other clues?

 

Stuart

Please use plain text.
Developer
Zingam
Posts: 187
Registered: ‎05-09-2012
My Device: Playbook, Z10 LE

Re: Accelerating QML with OpenGL

[ Edited ]

Isn't the QML runtime using OpenGL as a rendering API automatically when available?

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

Re: Accelerating QML with OpenGL

[ Edited ]

Hi, Stuart

 

I've just tested everything on the device again with the following code:

QGLFormat format = QGLFormat::defaultFormat();
QGLWidget *glWidget = new QGLWidget(format);
qDebug() << "GLWidget: " <<  glWidget;
qDebug() << "GLWidget validity: " <<  glWidget->isValid();
m_view->setViewport(glWidget); // m_view is QDeclarativeView
glWidget->showFullScreen();

 Here's the debug output:

GLWidget:  QGLWidget(0x93a9f0) 
GLWidget validity:  true 

 And the result is just a blank screen :smileysad:

--
Oleg Shparber
Please use plain text.
BlackBerry Development Advisor (Retired)
mgoulet
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha
My Carrier: N/A

Re: Accelerating QML with OpenGL

Hey there,

 

Have you made any progress on this issue? where do you stand?

Let me know and I will investigate further;

 

Regards,

 

Martin

 

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

Re: Accelerating QML with OpenGL

Hi, Martin.

I haven't spent much time investigating this issue due to some other tasks, so my last message has all information I have at the moment. Using QGLWidget as context for QDeclarativeView leads to gray screen.
--
Oleg Shparber
Please use plain text.