OpenGL ES2

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

OpenGL ES2

2,924 Views
PlartiNuhtl
Contributor I

Hello,

I'm trying to cross-compile QT 4.x Embedded/QWS (no X11) for i.MX-53 with OpenGL ES2 support.

The problem is that the hellogl_es2/texture examples do not work. The GL widgets just stay black, the window etc is there.

My qmake.conf (in mkspecs/qws/linux-mxc-g++/):


#
# qmake configuration for building with arm-none-linux-gnueabi-g++
#

QMAKE_CC                = arm-none-linux-gnueabi-gcc
QMAKE_CFLAGS            += -pipe
QMAKE_CFLAGS_DEPS       += -M
QMAKE_CFLAGS_WARN_ON    += -Wall -W
QMAKE_CFLAGS_WARN_OFF   += -w
QMAKE_CFLAGS_RELEASE    += -O2
QMAKE_CFLAGS_DEBUG      += -g
QMAKE_CFLAGS_SHLIB      += -fPIC
QMAKE_CFLAGS_STATIC_LIB += -fPIC
QMAKE_CFLAGS_YACC       += -Wno-unused -Wno-parentheses
QMAKE_CFLAGS_HIDESYMS   += -fvisibility=hidden
QMAKE_CFLAGS_PRECOMPILE += -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
QMAKE_CFLAGS_USE_PRECOMPILE += -include ${QMAKE_PCH_OUTPUT_BASE}

QMAKE_CXX               = arm-none-linux-gnueabi-g++
QMAKE_CXXFLAGS          += $$QMAKE_CFLAGS
QMAKE_CXXFLAGS_DEPS     += $$QMAKE_CFLAGS_DEPS
QMAKE_CXXFLAGS_WARN_ON  += $$QMAKE_CFLAGS_WARN_ON
QMAKE_CXXFLAGS_WARN_OFF += $$QMAKE_CFLAGS_WARN_OFF
QMAKE_CXXFLAGS_RELEASE  += $$QMAKE_CFLAGS_RELEASE
QMAKE_CXXFLAGS_DEBUG    += $$QMAKE_CFLAGS_DEBUG
QMAKE_CXXFLAGS_SHLIB    += $$QMAKE_CFLAGS_SHLIB
QMAKE_CXXFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_STATIC_LIB
QMAKE_CXXFLAGS_YACC     += $$QMAKE_CFLAGS_YACC
QMAKE_CXXFLAGS_HIDESYMS += $$QMAKE_CFLAGS_HIDESYMS -fvisibility-inlines-hidden
QMAKE_CXXFLAGS_PRECOMPILE += -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE

QMAKE_LINK              = arm-none-linux-gnueabi-g++
QMAKE_LINK_SHLIB        = arm-none-linux-gnueabi-g++
QMAKE_LINK_C            = arm-none-linux-gnueabi-gcc
QMAKE_LINK_C_SHLIB      = arm-none-linux-gnueabi-gcc
QMAKE_LFLAGS            +=
QMAKE_LFLAGS_RELEASE    += -Wl,-O1
QMAKE_LFLAGS_DEBUG      +=
QMAKE_LFLAGS_APP        +=
QMAKE_LFLAGS_SHLIB      += -shared
QMAKE_LFLAGS_PLUGIN     += $$QMAKE_LFLAGS_SHLIB
QMAKE_LFLAGS_SONAME     += -Wl,-soname,
QMAKE_LFLAGS_THREAD     +=
QMAKE_LFLAGS_NOUNDEF    += -Wl,--no-undefined
QMAKE_RPATH             = -Wl,-rpath,

QMAKE_PCH_OUTPUT_EXT    = .gch

# -Bsymbolic-functions (ld) support
QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Wl,-Bsymbolic-functions
QMAKE_LFLAGS_DYNAMIC_LIST = -Wl,--dynamic-list,

#QMAKE_CFLAGS_THREAD    += -D_REENTRANT
#QMAKE_CXXFLAGS_THREAD  += $$QMAKE_CFLAGS_THREAD

QMAKE_INCDIR          = /targetbuild//rootfs/usr/include
QMAKE_LIBDIR          = /targetbuild//rootfs/usr/lib
QMAKE_INCDIR_X11      =
QMAKE_LIBDIR_X11      =
QMAKE_INCDIR_QT       = $$[QT_INSTALL_HEADERS]
QMAKE_LIBDIR_QT       = $$[QT_INSTALL_LIBS]
QMAKE_INCDIR_OPENGL   = /targetbuild//rootfs/usr/include/GL
QMAKE_LIBDIR_OPENGL   = /targetbuild//rootfs/usr/lib
QMAKE_INCDIR_OPENGL_ES2 = /targetbuild//rootfs/usr/include/GLES2
QMAKE_LIBDIR_OPENGL_ES2 = /targetbuild//rootfs/usr/lib
QMAKE_INCDIR_EGL      = /targetbuild//rootfs/usr/include/GL
QMAKE_LIBDIR_EGL      = /targetbuild//rootfs/usr/lib

QMAKE_MOC               = @(ROOTFS)@(PREFIX)/qt-@(version)/bin/moc
QMAKE_UIC               = @(ROOTFS)@(PREFIX)/qt-@(version)/bin/uic

QMAKE_LIBS            = -lglib-2.0 -lgthread-2.0 -lgstreamer-0.10 -lxml2 -lgmodule-2.0 -lgobject-2.0 -lts -lasound -lgsl-fsl -lEGL -lz -lfreetype -lpng
QMAKE_LIBS_DYNLOAD    = -ldl
QMAKE_LIBS_X11        =
QMAKE_LIBS_X11SM      =
QMAKE_LIBS_NIS        = -lnsl
QMAKE_LIBS_EGL        = -lEGL
QMAKE_LIBS_OPENGL     = -lGLU -lGL
QMAKE_LIBS_OPENGL_QT  = -lGL
QMAKE_LIBS_OPENGL_ES2 = -lGLESv2
QMAKE_LIBS_OPENGL_ES1 = -lGLESv1_CM
QMAKE_LIBS_OPENVG     = -lOpenVG

QMAKE_AR              = arm-none-linux-gnueabi-ar cqs
QMAKE_OBJCOPY         = arm-none-linux-gnueabi-objcopy
QMAKE_RANLIB          = arm-none-linux-gnueabi-ranlib

QMAKE_TAR             = tar -cf
QMAKE_GZIP            = gzip -9f

QMAKE_COPY            = cp -f
QMAKE_COPY_FILE       = $(COPY)
QMAKE_COPY_DIR        = $(COPY) -r
QMAKE_MOVE            = mv -f
QMAKE_DEL_FILE        = rm -f
QMAKE_DEL_DIR         = rmdir
QMAKE_STRIP           = arm-none-linux-gnueabi-strip
QMAKE_STRIPFLAGS_LIB += --strip-unneeded
QMAKE_CHK_DIR_EXISTS  = test -d
QMAKE_MKDIR           = mkdir -p
QMAKE_INSTALL_FILE    = install -m 644 -p
QMAKE_INSTALL_PROGRAM = install -m 755 -p

MAKEFILE_GENERATOR      = UNIX
TEMPLATE                = app
CONFIG                 += qt warn_on release incremental link_prl
QT                     += core gui network
QMAKE_INCREMENTAL_STYLE = sublib

load(qt_config)


The result of configure:


Building on:   qws/linux-x86-g++
Building for:  qws/linux-mxc-g++
Architecture:  arm
Host architecture: i386

qmake vars .......... cat: .qmake.vars: No such file or directory
qmake switches .........
Build .................. libs examples demos docs translations
Configuration ..........  cross_compile debug shared dll embedded precompile_header exceptions_off  minimal-config small-config medium-config large-config full-config qt3support egl opengl opengles2 embedded reduce_exports ipv6 clock-gettime clock-monotonic mremap getaddrinfo ipv6ifname getifaddrs inotify system-jpeg system-png png system-freetype system-zlib glib alsa multimedia audio-backend debug
Debug .................. yes
Qt 3 compatibility ..... yes
QtDBus module .......... no
QtConcurrent code ...... yes
QtGui module ........... yes
QtScript module ........ no
QtScriptTools module ... no
QtXmlPatterns module ... no
Phonon module .......... no
Multimedia module ...... auto
SVG module ............. no
WebKit module .......... no
Declarative module ..... no
Declarative debugging ...yes
Support for S60 ........ no
Symbian DEF files ...... no
STL support ............ no
PCH support ............ yes
MMX/3DNOW/SSE/SSE2/SSE3. no/no/no/no/no
SSSE3/SSE4.1/SSE4.2..... no/no/no
AVX..................... no
iWMMXt support ......... no
NEON support ........... no
IPv6 support ........... yes
IPv6 ifname support .... yes
getaddrinfo support .... yes
getifaddrs support ..... yes
Accessibility .......... no
NIS support ............ no
CUPS support ........... no
Iconv support .......... no
Glib support ........... yes
GStreamer support ...... no
PulseAudio support ..... no
Large File support ..... no
GIF support ............ plugin
TIFF support ........... plugin (qt)
JPEG support ........... plugin (system)
PNG support ............ yes (system)
MNG support ............ plugin (qt)
zlib support ........... system
Session management ..... no
Embedded support ....... arm
Freetype2 support ...... auto (system)
Graphics (qt) .......... linuxfb multiscreen linuxfb
Graphics (plugin) ......
Decorations (qt) ....... styled windows default
Decorations (plugin) ...
Keyboard driver (qt) ... tty tty
Keyboard driver (plugin) ..
Mouse driver (qt) ...... pc linuxtp tslib
Mouse driver (plugin) ..
OpenGL support ......... yes (OpenGL ES 2.x)
EGL support ............ yes <EGL/egl.h>
OpenVG support ......... no
SQLite support ......... plugin (qt)
OpenSSL support ........ no
Alsa support ........... yes
ICD support ............ no


Everything builds just fine and the binarys are correctly linked against the libraries. I can run normal OpenGL ES2 examples without QT, so this works.

I looked at the manuals of imxcommunity.org etc, but I could not find anything I do wrong.

Any hints would be greatly appreciated.


P.

Tags (2)
0 Kudos
Reply
5 Replies

1,839 Views
lipeng1z
Contributor I

It's my pleasure to see your response . 

can you tell me the way to modify the source code to support the QGLWideget showing crrectly??

just as your videos shows!!



Michael Grunditz said:

For OpenGL in Qt Embedded you need a special display plugin. The easiest way is to enable fullscreen GL. To do this you just need to open the framebuffer in getnativewindow (in the Qt sources) , just as you do in normal framebuffer GL.

 

I have a display plugin that does windowing , you can see it in a video here on this site. However it is currently

not fot public use.

 

/Michael

0 Kudos
Reply

1,839 Views
micken
Contributor I
simplegl should work for fullscreen , however I don't know if you get the surrounding widgets.

Plarti Nuhtl said:

Thank you very much for your response.

 

Is "simplegl" an example of a  "special display plugin" and can it be used on the MX53?

0 Kudos
Reply

1,838 Views
EijiKawai
Contributor I

Hello,


I'm Having the same problem with the the hellogl_es2/hellogl_es2 example on a DIGI int. board iMX515.

QtEmbedded-4.7.3

The GL widgets just stay black, and nothing else.

 

please any idea?

0 Kudos
Reply

1,838 Views
PlartiNuhtl
Contributor I

Thank you very much for your response.

 

Is "simplegl" an example of a  "special display plugin" and can it be used on the MX53?

0 Kudos
Reply

1,838 Views
micken
Contributor I

For OpenGL in Qt Embedded you need a special display plugin. The easiest way is to enable fullscreen GL. To do this you just need to open the framebuffer in getnativewindow (in the Qt sources) , just as you do in normal framebuffer GL.

 

I have a display plugin that does windowing , you can see it in a video here on this site. However it is currently

not fot public use.

 

/Michael

0 Kudos
Reply