Re: [SailfishDevel] opengl again..

2013-12-05 Thread Thomas Perl
Hi,

On 05 Dec 2013, at 09:56, Wim de Vries  wrote:
>> 1) using QML writing C++ items to integrate into the scene graph (see 
>> http://qt-project.org/doc/qt-5.0/qtquick/qquickitem.html for the base class) 
>> - this also means you’ll be able to use Silica in your application
>> 2) using C++, instantiating a QWindow, and doing all your rendering by 
>> yourself (ideally using OpenGL ES) - something like 
>> http://qt-project.org/doc/qt-5.0/qtgui/openglwindow.html
> 
> Does this example run on Sailfish (it's now all QQuickView as mainwin in SF)?

Yes, every application should have (from the point of the compositor) one 
window, and that basically is one fullscreen QQuickView (or QWindow, as 
QQuickView is subclassed from QWindow).

> Very, very important, how do create a second GUI (QML) Window?

In Sailfish Silica, you can have multiple “Page” elements which are basically 
“windows” inside the main window. That’s the native UI paradigm here, not 
multiple windows. You can use the page stack to push and pop windows (or 
pop’ing of windows can also happen by the user swiping back or tapping back):

https://sailfishos.org/sailfish-silica/qml-sailfishsilica-pagestack.html


HTH :)
Thomas
___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] opengl again..

2013-12-05 Thread Wim de Vries

Thanks.
1) using QML writing C++ items to integrate into the scene graph (see 
http://qt-project.org/doc/qt-5.0/qtquick/qquickitem.html for the base 
class) - this also means you'll be able to use Silica in your application
2) using C++, instantiating a QWindow, and doing all your rendering by 
yourself (ideally using OpenGL ES) - something like 
http://qt-project.org/doc/qt-5.0/qtgui/openglwindow.html


Does this example run on Sailfish (it's now all QQuickView as mainwin in 
SF)?

Very, very important, how do create a second GUI (QML) Window?


3) other, as-yet-to-be-finalised routes like doing *everything* 
yourself, using SDL, etc.


So it seems that only QML apps are supported, but I have no clue how 
to add a QWindow in a QML app. There's an example in QtCreator "Scene 
Graph - OpenGL under QML" but they use QQuickItem,

for OpenGL, so I still don't have a clue how to use OpenGL in a QML app.


Your QML application has a C++ entry point (though if you're using 
something like qmlscene... you'll need to create such an entry point 
yourself) with your 'main' function. You can create a QWindow in 
there, and show it. You can hook into QML using Q_INVOKABLE methods to 
show it based on a clicked action on a Silica button, etc, etc, etc.


I'd need more information to be able to really provide useful help here :)


Regards
João de Deus


BR,
Robin


___
SailfishOS.org Devel mailing list

regards
wim
___
SailfishOS.org Devel mailing list

Re: [SailfishDevel] opengl again..

2013-12-04 Thread joao morgado
Hi

What I want to achieve is something similar to a cad / paint app, with a menu 
with buttons (circle, line, ...) and a drawing area. In Qt Widgets, I would 
have done a QMainWindow with a menu with buttons and a QGLwidget in the mdi 
area.
In QML, I have a main rectangle, with a menu with some buttons, now how do I 
set a child opengl drawing area ?


1) using QML writing C++ items to integrate into the scene graph (see 
http://qt-project.org/doc/qt-5.0/qtquick/qquickitem.html for the base class) - 
this also means you’ll be able to use Silica in your application


I'm not sure if this is what I want/need but I will check better the link 


2) using C++, instantiating a QWindow, and doing all your rendering by yourself 
(ideally using OpenGL ES) - something like 
http://qt-project.org/doc/qt-5.0/qtgui/openglwindow.html


I like this option because I want to use OpenGL ES for my drawing area, where 
the user can input lines, circles, ... with touch events. But can I have best 
of both worlds and use also a fancy QML menu with buttons ? I would have to 
have a main (something ???) with a child qml menu and a child opengl QWindow.


3) other, as-yet-to-be-finalised routes like doing *everything* yourself, using 
SDL, etc.
 
Not a change in hell :) Life is short and I just want to keep it simple, and 
use whenever possible all the goodies Qt has to offer :)

Thanks for your replay, and patience, has I am not, yet, very familiar with QML 
world.

Regards
João  






Em Quarta-feira, 4 de Dezembro de 2013 22:40, Robin Burchell 
 escreveu:
 
Hi, 


On 04 Dec 2013, at 20:18, joao morgado  wrote:
@: Wim de Vries. 
>I share your frustation about OpenGL with QWindow, and I'm also frustated with 
>Qt widgets. 
>I have a very nice app in OVI, symbian, with QWidgets and OpenGL, I'll have to 
>do a complete redesign, since widgets are black listed.

The reason for the blacklist is twofold:
1) we do not (and have not) done any work on QWidget-using applications on 
Sailfish, either in terms of working at all/working correctly, let alone 
working performantly - and as we don’t have infinite resources, we have to 
choose where to focus, and that isn’t on widget-using applications
2) they will not work performantly at all, due to being stuck with the software 
rendering stack (we’re talking something well under the display refresh rate on 
an un-loaded device)

Separately from the problem of actually working, and working well, any use of 
QtWidgets also imposes some pretty nasty resource penalties on your application 
(mostly in terms of startup, but also resource usage) as it’s a pretty massive 
library.

Generally speaking - they just aren’t very mobile-friendly.


That example of QWindow with OpenGL, to me, it's an over complicated mess, 
luckly I managed to port my opengl code to QWindow but took me quite a while to 
do it. To me, there is a better example here 
https://github.com/advancingu/Qt5OpenGL

An example rather depends on what you want to do. Either you’re:
1) using QML writing C++ items to integrate into the scene graph (see 
http://qt-project.org/doc/qt-5.0/qtquick/qquickitem.html for the base class) - 
this also means you’ll be able to use Silica in your application
2) using C++, instantiating a QWindow, and doing all your rendering by yourself 
(ideally using OpenGL ES) - something like 
http://qt-project.org/doc/qt-5.0/qtgui/openglwindow.html
3) other, as-yet-to-be-finalised routes like doing *everything* yourself, using 
SDL, etc.

So it seems that only QML apps are supported, but I have no clue how to add a 
QWindow in a QML app. There's an example in QtCreator "Scene Graph - OpenGL 
under QML" but they use QQuickItem, 
>for OpenGL, so I still don't have a clue how to use OpenGL in a QML app.

Your QML application has a C++ entry point (though if you’re using something 
like qmlscene… you’ll need to create such an entry point yourself) with your 
‘main’ function. You can create a QWindow in there, and show it. You can hook 
into QML using Q_INVOKABLE methods to show it based on a clicked action on a 
Silica button, etc, etc, etc.

I’d need more information to be able to really provide useful help here :)


Regards
>João de Deus 

BR,
Robin___
SailfishOS.org Devel mailing list

Re: [SailfishDevel] opengl again..

2013-12-04 Thread Gabriel Boehme
Hi,

couldn't you use setContextProperty to bind (a) C++ Object(s) to QML? Or
do I miss some OpenGL specific thing?

http://qt-project.org/doc/qt-5.0/qtqml/qtqml-cppintegration-contextproperties.html

Works also with Sailfish, but is a bit different due to SailfishApp
startup stuff, I also asked about that here:

https://lists.sailfishos.org/pipermail/devel/2013-November/001171.html

Gabriel.


Am Mittwoch, den 04.12.2013, 22:55 +0100 schrieb Wim de Vries:
> On 12/04/2013 08:18 PM, joao morgado wrote:
> 
> > @: Wim de Vries. 
> > I share your frustation about OpenGL with QWindow, and I'm also
> > frustated with Qt widgets. 
> > I have a very nice app in OVI, symbian, with QWidgets and OpenGL,
> > I'll have to do a complete redesign, since widgets are black listed.
> > 
> > 
> > That example of QWindow with OpenGL, to me, it's an over complicated
> > mess, luckly I managed to port my opengl code to QWindow but took me
> > quite a while to do it. To me, there is a better example
> > here https://github.com/advancingu/Qt5OpenGL
> I managed it with QDeclarative some time ago, but that's also black
> listed now...
> 
> > 
> > 
> > So it seems that only QML apps are supported, but I have no clue how
> > to add a QWindow in a QML app. There's an example in QtCreator
> > "Scene Graph - OpenGL under QML" but they use QQuickItem, 
> > for OpenGL, so I still don't have a clue how to use OpenGL in a QML
> > app.
> also black listed now see
> http://qt-project.org/doc/qt-5.0/qtdoc/whatsnew.html
> 
> I implemented just a little part of my app
> (https://github.com/sailfishapps/checklists) in a small app, using c++
> <> QML-Sailfish communication.
> It works, but for the communication you need a lot of code. And the
> code is very hard to understand.
> I do hope that we will be able to access the sailfish GUI via C++
> somewhere in the future. 
> C(++) is THE language for openGL.
> 
> I'll post a separate topic on this.
> Thanks.
> regards
> wim
> 
> 
> > 
> > 
> > Regards
> > João de Deus 
> > 
> > 
> > Em Quarta-feira, 4 de Dezembro de 2013 16:24, Filip Kłębczyk
> >  escreveu:
> > 
> > W dniu 04.12.2013 17:05, Wim de Vries pisze:
> > > Thanks.
> > > I presume it's a buck in the emulator then.
> > > I'll wait for the Jolla device, before any further development.
> > 
> > Hi Wim,
> > 
> > you can try to contact my former student, one part of his master
> > thesis 
> > was writing EGL app for Sailfish (he made some kind of 3D snake in
> > the 
> > emulator). His e-mail:
> > 
> > bar.rem...@gmail.com
> > 
> > Regards,
> > Filip 
> > 
> > 
> > 
> > 
> > 
> > ___
> > SailfishOS.org Devel mailing list
> > 
> > 
> > 
> > 
> > 
> > 
> > ___
> > SailfishOS.org Devel mailing list
> 
> ___
> SailfishOS.org Devel mailing list


___
SailfishOS.org Devel mailing list

Re: [SailfishDevel] opengl again..

2013-12-04 Thread Robin Burchell
Hi,

On 04 Dec 2013, at 20:18, joao morgado 
mailto:joaodeusmorg...@yahoo.com>> wrote:
@: Wim de Vries.
I share your frustation about OpenGL with QWindow, and I'm also frustated with 
Qt widgets.
I have a very nice app in OVI, symbian, with QWidgets and OpenGL, I'll have to 
do a complete redesign, since widgets are black listed.

The reason for the blacklist is twofold:
1) we do not (and have not) done any work on QWidget-using applications on 
Sailfish, either in terms of working at all/working correctly, let alone 
working performantly - and as we don’t have infinite resources, we have to 
choose where to focus, and that isn’t on widget-using applications
2) they will not work performantly at all, due to being stuck with the software 
rendering stack (we’re talking something well under the display refresh rate on 
an un-loaded device)

Separately from the problem of actually working, and working well, any use of 
QtWidgets also imposes some pretty nasty resource penalties on your application 
(mostly in terms of startup, but also resource usage) as it’s a pretty massive 
library.

Generally speaking - they just aren’t very mobile-friendly.

That example of QWindow with OpenGL, to me, it's an over complicated mess, 
luckly I managed to port my opengl code to QWindow but took me quite a while to 
do it. To me, there is a better example here 
https://github.com/advancingu/Qt5OpenGL

An example rather depends on what you want to do. Either you’re:
1) using QML writing C++ items to integrate into the scene graph (see 
http://qt-project.org/doc/qt-5.0/qtquick/qquickitem.html for the base class) - 
this also means you’ll be able to use Silica in your application
2) using C++, instantiating a QWindow, and doing all your rendering by yourself 
(ideally using OpenGL ES) - something like 
http://qt-project.org/doc/qt-5.0/qtgui/openglwindow.html
3) other, as-yet-to-be-finalised routes like doing *everything* yourself, using 
SDL, etc.

So it seems that only QML apps are supported, but I have no clue how to add a 
QWindow in a QML app. There's an example in QtCreator "Scene Graph - OpenGL 
under QML" but they use QQuickItem,
for OpenGL, so I still don't have a clue how to use OpenGL in a QML app.

Your QML application has a C++ entry point (though if you’re using something 
like qmlscene… you’ll need to create such an entry point yourself) with your 
‘main’ function. You can create a QWindow in there, and show it. You can hook 
into QML using Q_INVOKABLE methods to show it based on a clicked action on a 
Silica button, etc, etc, etc.

I’d need more information to be able to really provide useful help here :)

Regards
João de Deus

BR,
Robin
___
SailfishOS.org Devel mailing list

Re: [SailfishDevel] opengl again..

2013-12-04 Thread Wim de Vries

On 12/04/2013 08:18 PM, joao morgado wrote:

@: Wim de Vries.
I share your frustation about OpenGL with QWindow, and I'm also 
frustated with Qt widgets.
I have a very nice app in OVI, symbian, with QWidgets and OpenGL, I'll 
have to do a complete redesign, since widgets are black listed.


That example of QWindow with OpenGL, to me, it's an over complicated 
mess, luckly I managed to port my opengl code to QWindow but took me 
quite a while to do it. To me, there is a better example here 
https://github.com/advancingu/Qt5OpenGL
I managed it with QDeclarative some time ago, but that's also black 
listed now...




So it seems that only QML apps are supported, but I have no clue how 
to add a QWindow in a QML app. There's an example in QtCreator "Scene 
Graph - OpenGL under QML" but they use QQuickItem,

for OpenGL, so I still don't have a clue how to use OpenGL in a QML app.
also black listed now see 
http://qt-project.org/doc/qt-5.0/qtdoc/whatsnew.html


I implemented just a little part of my app 
(https://github.com/sailfishapps/checklists) in a small app, using c++ 
<> QML-Sailfish communication.
It works, but for the communication you need a lot of code. And the code 
is very hard to understand.
I do hope that we will be able to access the sailfish GUI via C++ 
somewhere in the future.

C(++) is THE language for openGL.

I'll post a separate topic on this.
Thanks.
regards
wim




Regards
João de Deus


Em Quarta-feira, 4 de Dezembro de 2013 16:24, Filip K?e;bczyk 
 escreveu:

W dniu 04.12.2013 17:05, Wim de Vries pisze:
> Thanks.
> I presume it's a buck in the emulator then.
> I'll wait for the Jolla device, before any further development.

Hi Wim,

you can try to contact my former student, one part of his master thesis
was writing EGL app for Sailfish (he made some kind of 3D snake in the
emulator). His e-mail:

bar.rem...@gmail.com 

Regards,
Filip





___
SailfishOS.org Devel mailing list




___
SailfishOS.org Devel mailing list


___
SailfishOS.org Devel mailing list

Re: [SailfishDevel] opengl again..

2013-12-04 Thread joao morgado
@: Wim de Vries. 
I share your frustation about OpenGL with QWindow, and I'm also frustated with 
Qt widgets. 
I have a very nice app in OVI, symbian, with QWidgets and OpenGL, I'll have to 
do a complete redesign, since widgets are black listed.

That example of QWindow with OpenGL, to me, it's an over complicated mess, 
luckly I managed to port my opengl code to QWindow but took me quite a while to 
do it. To me, there is a better example here 
https://github.com/advancingu/Qt5OpenGL

So it seems that only QML apps are supported, but I have no clue how to add a 
QWindow in a QML app. There's an example in QtCreator "Scene Graph - OpenGL 
under QML" but they use QQuickItem, 
for OpenGL, so I still don't have a clue how to use OpenGL in a QML app.

Regards
João de Deus 



Em Quarta-feira, 4 de Dezembro de 2013 16:24, Filip Kłębczyk 
 escreveu:
 
W dniu 04.12.2013 17:05, Wim de Vries pisze:
> Thanks.
> I presume it's a buck in the emulator then.
> I'll wait for the Jolla device, before any further development.

Hi Wim,

you can try to contact my former student, one part of his master thesis 
was writing EGL app for Sailfish (he made some kind of 3D snake in the 
emulator). His e-mail:

bar.rem...@gmail.com

Regards,
Filip





___
SailfishOS.org Devel mailing list___
SailfishOS.org Devel mailing list

Re: [SailfishDevel] opengl again..

2013-12-04 Thread Wim de Vries

Thanks.
I was also thinking that maybe QGLWidget isn't supported in Sailfish.

On 12/04/2013 05:24 PM, Filip Kłębczyk wrote:

W dniu 04.12.2013 17:05, Wim de Vries pisze:

Thanks.
I presume it's a buck in the emulator then.
I'll wait for the Jolla device, before any further development.


Hi Wim,

you can try to contact my former student, one part of his master 
thesis was writing EGL app for Sailfish (he made some kind of 3D snake 
in the emulator). His e-mail:


bar.rem...@gmail.com

Regards,
Filip




___
SailfishOS.org Devel mailing list



___
SailfishOS.org Devel mailing list

Re: [SailfishDevel] opengl again..

2013-12-04 Thread Filip Kłębczyk

W dniu 04.12.2013 17:05, Wim de Vries pisze:

Thanks.
I presume it's a buck in the emulator then.
I'll wait for the Jolla device, before any further development.


Hi Wim,

you can try to contact my former student, one part of his master thesis 
was writing EGL app for Sailfish (he made some kind of 3D snake in the 
emulator). His e-mail:


bar.rem...@gmail.com

Regards,
Filip




___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] opengl again..

2013-12-04 Thread Marcin M.
Well, if you want to use some unsupported stuff, check out openrepos.net ;)
--
Marcin


2013/12/4 Wim de Vries 

> On 12/04/2013 03:31 PM, Thomas Perl wrote:
>
>> Hi,
>>
>> On 04 Dec 2013, at 14:18, Wim de Vries  wrote:
>>
>>> I have a simple app with a standard Qt C++ GUI that runs fine on the
>>> host as well as the emulator.
>>> I have added a QGLWiget (with shaders) which shows a triangle nicely on
>>> the host.
>>> Still, on the emulator (with 3D acc enabled) the QGLWidget is just
>>> black, no errors.
>>> Does the (linux) emulator support 3D?
>>>
>>
>> The emulator should support OpenGL rendering (not sure if has good
>> performance, but as Qt renders our stuff using OpenGL, your application
>> should be able to as well). In general, you don’t want to use QGLWidget
>> (=depends on qtwidgets), but use QWindow with OpenGL instead:
>>
> Thanks.
> I presume it's a buck in the emulator then.
> I'll wait for the Jolla device, before any further development.
> About QWindow.
> Quite frustrating. Waiting for a mobile device to deploy my flight nav app
> on, and when it's there, it only supports a completely redesigned Qt
> version ;-(
> Anyhow, thanks for the reply.
>
>
>> http://qt-project.org/doc/qt-5.0/qtgui/openglwindow.html
>>
>>
>> HTH :)
>> Thomas
>>
>
> ___
> SailfishOS.org Devel mailing list
>
___
SailfishOS.org Devel mailing list

Re: [SailfishDevel] opengl again..

2013-12-04 Thread Wim de Vries

On 12/04/2013 03:31 PM, Thomas Perl wrote:

Hi,

On 04 Dec 2013, at 14:18, Wim de Vries  wrote:

I have a simple app with a standard Qt C++ GUI that runs fine on the host as 
well as the emulator.
I have added a QGLWiget (with shaders) which shows a triangle nicely on the 
host.
Still, on the emulator (with 3D acc enabled) the QGLWidget is just black, no 
errors.
Does the (linux) emulator support 3D?


The emulator should support OpenGL rendering (not sure if has good performance, 
but as Qt renders our stuff using OpenGL, your application should be able to as 
well). In general, you don’t want to use QGLWidget (=depends on qtwidgets), but 
use QWindow with OpenGL instead:

Thanks.
I presume it's a buck in the emulator then.
I'll wait for the Jolla device, before any further development.
About QWindow.
Quite frustrating. Waiting for a mobile device to deploy my flight nav 
app on, and when it's there, it only supports a completely redesigned Qt 
version ;-(

Anyhow, thanks for the reply.



http://qt-project.org/doc/qt-5.0/qtgui/openglwindow.html


HTH :)
Thomas


___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] opengl again..

2013-12-04 Thread Thomas Perl
Hi,

On 04 Dec 2013, at 14:18, Wim de Vries  wrote:
> I have a simple app with a standard Qt C++ GUI that runs fine on the host as 
> well as the emulator.
> I have added a QGLWiget (with shaders) which shows a triangle nicely on the 
> host.
> Still, on the emulator (with 3D acc enabled) the QGLWidget is just black, no 
> errors.
> Does the (linux) emulator support 3D?


The emulator should support OpenGL rendering (not sure if has good performance, 
but as Qt renders our stuff using OpenGL, your application should be able to as 
well). In general, you don’t want to use QGLWidget (=depends on qtwidgets), but 
use QWindow with OpenGL instead:

http://qt-project.org/doc/qt-5.0/qtgui/openglwindow.html


HTH :)
Thomas
___
SailfishOS.org Devel mailing list


[SailfishDevel] opengl again..

2013-12-04 Thread Wim de Vries

Hi,
I am developing on a ubuntu 12.10 notebook host.
I have a simple app with a standard Qt C++ GUI that runs fine on the 
host as well as the emulator.
I have added a QGLWiget (with shaders) which shows a triangle nicely on 
the host.
Still, on the emulator (with 3D acc enabled) the QGLWidget is just 
black, no errors.

Does the (linux) emulator support 3D?
thanks.
___
SailfishOS.org Devel mailing list