[SailfishDevel] OpenGL usage
Petr Vytovtov
osanwe at protonmail.ch
Wed Jul 15 07:53:58 UTC 2015
Hello!
I've tried to make this example: http://doc.qt.io/qt-5/qtquick-scenegraph-openglunderqml-example.html. But the app shows only a label and a rectangle (the screenshot in attachments). Is it possible to use OpenGL on Sailfish? If yes how can I do it?
My opengl-test.cpp file:
```
#ifdef QT_QML_DEBUG
#include <QtQuick>
#endif
#include <sailfishapp.h>
#include <QGuiApplication>
#include <QScopedPointer>
#include <QQuickView>
#include <QQmlContext>
#include "squircle.h"
int main(int argc, char *argv[])
{
qmlRegisterType<Squircle>("OpenGLUnderQML", 1, 0, "Squircle");
QScopedPointer<QGuiApplication> app(SailfishApp::application(argc, argv));
QScopedPointer<QQuickView> view(SailfishApp::createView());
view->setResizeMode(QQuickView::SizeRootObjectToView);
view->setSource(SailfishApp::pathTo("qml/opengl-test.qml"));
view->show();
return app->exec();
}
```
Regards,
Petr
[Linux User Group Udmurtia](https://udmlug.wordpress.com/)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20150715/977f0c83/attachment-0001.html>
More information about the Devel
mailing list