OpenGL Requirements?
-
I'm trying to run a Qt Quick Project with OpenGL. I can not get it to work. Please point me in the right direction.
Hardware
The hardware is an OmniChrome which supports OpenGL 1.2 (No FBOs, No Shaders, Only BackBuffer Flips). glxgears is running correctly. glxinfo is posted below.
Does Qt Support Back Buffer?
What I'm Trying
I created an application that uses QGLWidget as the view. The application loads a single QML file (Mainmenu.qml) that draws a single rectangle. The outcome is that it crashes (assertion) with Direct Rending Off and just shows a black screen with Direct Rendering On.
Output: Direct Render OFF
The rectangle is drawn, but the application quickly crashes. I assume it is crashing when trying to render the 2nd frame.
@# mainQIconvCodec::convertFromUnicode: using Latin-1 for conversion, iconv failed for BOM: Bad file descriptor
QIconvCodec::convertFromUnicode: using Latin-1 for conversion, iconv_open failed
QIconvCodec::convertToUnicode: using Latin-1 for conversion, iconv_open failed
QDeclarativeImportDatabase::addImportPath: "/usr/local/Trolltech/Qt-4.7.1/imports"
QDeclarativeImportDatabase::addImportPath: "/usr/qtengine/imports"
QDeclarativeImportDatabase::addImportPath: "/mnt/remote/test/engine3dtest-build"
libGL warning: 3D driver claims to not support visual 0x23
libGL warning: 3D driver claims to not support visual 0x24
libGL warning: 3D driver claims to not support visual 0x25
QDeclarativeImports(file:///mnt/remote/test/engine3dtest-build/Menutest/Mainmenu.qml)::addImport: "." -1.-1 File as ""
QDeclarativeImports(file:///mnt/remote/test/engine3dtest-build/Menutest/Mainmenu.qml)::addImport: "Qt" 4.7 Library as ""
QDeclarativeImports(file:///mnt/remote/test/engine3dtest-build/Menutest/Mainmenu.qml)::resolveType: "Rectangle" => "QDeclarativeRectangle"
SAREA: fbvid=500000 fbgl=51eae0 fbtex=0 agptex=7000000
nGL = 1
engine3dtest: indirect_vertex_array.c:1359: __indirect_glTexCoordPointer: Assertion `a != ((void *)0)' failed.
Aborted
@Output: Direct Rendering ON
Does not crash, but blank (Black) screen.
@# main direct_renderingQIconvCodec::convertFromUnicode: using Latin-1 for conversion, iconv failed for BOM: Bad file descriptor
QIconvCodec::convertFromUnicode: using Latin-1 for conversion, iconv_open failed
QIconvCodec::convertToUnicode: using Latin-1 for conversion, iconv_open failed
Direct Rendering Enabled.
QDeclarativeImportDatabase::addImportPath: "/usr/local/Trolltech/Qt-4.7.1/imports"
QDeclarativeImportDatabase::addImportPath: "/usr/qtengine/imports"
QDeclarativeImportDatabase::addImportPath: "/mnt/remote/test/engine3dtest-build"
libGL warning: 3D driver claims to not support visual 0x23
libGL warning: 3D driver claims to not support visual 0x24
libGL warning: 3D driver claims to not support visual 0x25
SAREA: fbvid=500000 fbgl=51eae0 fbtex=0 agptex=7000000
nGL = 1
QDeclarativeImports(file:///mnt/remote/test/engine3dtest-build/Menutest/Mainmenu.qml)::addImport: "." -1.-1 File as ""
QDeclarativeImports(file:///mnt/remote/test/engine3dtest-build/Menutest/Mainmenu.qml)::addImport: "Qt" 4.7 Library as ""
QDeclarativeImports(file:///mnt/remote/test/engine3dtest-build/Menutest/Mainmenu.qml)::resolveType: "Rectangle" => "QDeclarativeRectangle"
SAREA: fbvid=500000 fbgl=51eae0 fbtex=0 agptex=7000000
nGL = 1
@main.cpp
@#include <QApplication>
#include <QDeclarativeEngine>
#include <QDeclarativeView>
#include <QDebug>
#include <QGLFormat>int main(int argc, char **argv) {
QApplication app(argc, argv); QStringList args = app.arguments(); QGLFormat format; format.setDepth(false); format.setStencil(false); format.setSampleBuffers(false); format.setDoubleBuffer(false); format.setAlpha(false); format.setDirectRendering(false); for (int i = 1; i < args.count(); i++) { if (args.at(i) == "depth") { qDebug() << "Depth Enabled."; format.setDepth(true); } else if (args.at(i) == "stencil") { qDebug() << "Stencil Enabled."; format.setStencil(true); } else if (args.at(i) == "sample_buffers") { qDebug() << "Sample Buffers Enabled."; format.setSampleBuffers(true); } else if (args.at(i) == "double_buffers") { qDebug() << "Double Buffers Enabled."; format.setDoubleBuffer(true); } else if (args.at(i) == "alpha") { qDebug() << "Alpha Enabled."; format.setAlpha(true); } else if (args.at(i) == "direct_rendering") { qDebug() << "Direct Rendering Enabled."; format.setDirectRendering(true); } } QGLFormat::setDefaultFormat(format); QDeclarativeView *view = new QDeclarativeView; view->setAttribute(Qt::WA_OpaquePaintEvent); view->setAttribute(Qt::WA_NoSystemBackground); view->setAttribute(Qt::WA_DeleteOnClose); view->setViewport(new QGLWidget()); view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); view->setViewportUpdateMode(QGraphicsView::FullViewportUpdate); view->setFrameStyle(0); view->setViewportUpdateMode(QGraphicsView::FullViewportUpdate); view->setFocus(); view->setSource(QUrl::fromLocalFile("Mainmenu.qml")); view->show(); return app.exec();
}
@Mainmenu.qml
@import Qt 4.7Rectangle {
width: 100
height: 100
}
@ -
glxinfo
@name of display: :0.0
libGL warning: 3D driver claims to not support visual 0x23
libGL warning: 3D driver claims to not support visual 0x24
libGL warning: 3D driver claims to not support visual 0x25
SAREA: fbvid=500000 fbgl=51eae0 fbtex=0 agptex=7000000
nGL = 1
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.2
server glx extensions:
GLX_ARB_multisample, GLX_EXT_visual_info, GLX_EXT_visual_rating,
GLX_EXT_import_context, GLX_OML_swap_method, GLX_SGI_make_current_read,
GLX_SGIS_multisample, GLX_SGIX_hyperpipe, GLX_SGIX_swap_barrier,
GLX_SGIX_fbconfig
client glx vendor string: SGI
client glx version string: 1.4
client glx extensions:
GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_allocate_memory,
GLX_MESA_swap_control, GLX_MESA_swap_frame_usage, GLX_OML_swap_method,
GLX_OML_sync_control, GLX_SGI_make_current_read, GLX_SGI_swap_control,
GLX_SGI_video_sync, GLX_SGIS_multisample, GLX_SGIX_fbconfig,
GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group
GLX extensions:
GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_swap_control,
GLX_MESA_swap_frame_usage, GLX_OML_swap_method, GLX_SGI_video_sync,
GLX_SGIS_multisample, GLX_SGIX_fbconfig
OpenGL vendor string: GUE Tech
OpenGL renderer string: TDX [CN400]
OpenGL version string: 1.2 Mesa 6.4.1
OpenGL extensions:
GL_ARB_imaging, GL_ARB_multisample, GL_ARB_multitexture,
GL_ARB_point_parameters, GL_ARB_texture_env_add,
GL_ARB_texture_env_combine, GL_ARB_texture_mirrored_repeat,
GL_ARB_texture_rectangle, GL_ARB_transpose_matrix, GL_ARB_window_pos,
GL_EXT_abgr, GL_EXT_bgra, GL_EXT_blend_color, GL_EXT_blend_minmax,
GL_EXT_blend_subtract, GL_EXT_clip_volume_hint,
GL_EXT_compiled_vertex_array, GL_EXT_convolution, GL_EXT_copy_texture,
GL_EXT_draw_range_elements, GL_EXT_fog_coord, GL_EXT_histogram,
GL_EXT_packed_pixels, GL_EXT_paletted_texture, GL_EXT_point_parameters,
GL_EXT_polygon_offset, GL_EXT_rescale_normal, GL_EXT_secondary_color,
GL_EXT_separate_specular_color, GL_EXT_shared_texture_palette,
GL_EXT_stencil_wrap, GL_EXT_subtexture, GL_EXT_texture, GL_EXT_texture3D,
GL_EXT_texture_compression_s3tc, GL_EXT_texture_edge_clamp,
GL_EXT_texture_env_add, GL_EXT_texture_env_combine,
GL_EXT_texture_lod_bias, GL_EXT_texture_object, GL_EXT_texture_rectangle,
GL_EXT_vertex_array, GL_APPLE_packed_pixels, GL_IBM_rasterpos_clip,
GL_IBM_texture_mirrored_repeat, GL_MESA_window_pos, GL_NV_blend_square,
GL_NV_light_max_exponent, GL_NV_texture_rectangle,
GL_NV_texgen_reflection, GL_OES_read_format, GL_SGI_color_matrix,
GL_SGI_color_table, GL_SGIS_texture_edge_clamp, GL_SGIS_texture_lod,
GL_S3_s3tc
glu version: 1.3
glu extensions:
GLU_EXT_nurbs_tessellator, GLU_EXT_object_space_tessvisual x bf lv rg d st colorbuffer ax dp st accumbuffer ms cav
id dep cl sp sz l ci b ro r g b a bf th cl r g b a ns b eat0x22 16 tc 0 16 0 r y . 5 6 5 0 0 16 0 0 0 0 0 0 0 None
0x23 16 tc 0 16 0 r y . 5 6 5 0 0 16 8 16 16 16 0 0 0 None
0x24 16 tc 0 24 0 r y . 5 6 5 8 0 16 8 16 16 16 16 0 0 None
0x25 16 tc 0 24 0 r . . 5 6 5 8 0 16 8 16 16 16 16 0 0 None
@