Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qglwidget cannot draw image
Qt 6.11 is out! See what's new in the release blog

Qglwidget cannot draw image

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 2 Posters 1.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    minamiman
    wrote on last edited by
    #1

    I am testing qt + opengl es in embedded system with mali400.
    First of all, I did testing mali sdk sample source in board for mali and opengl es, that is OK.
    and, I did coding sample program same as below, that is draw triangle in qglwidget, pc linux is OK.
    but, embedded system is not draw triangle, only black in qglwidget.

    thank....

    I did cross compile qt-everywhere-opensource-src-4.8.4 with below configuration

    ./configure -v -opensource -confirm-license -release -embedded arm -prefix /project/qte-dfb -no-neon -no-mmx -static -little-endian -no-accessibility -shared -no-cups -no-stl -qt-libpng -qt-libjpeg -no-qvfb -no-dbus -qt-freetype -no-nis -no-qt3support -no-largefile -no-libmng -no-separate-debug-info -nomake examples -nomake docs -nomake tools -depths 16,18,24 -optimized-qmake -pch -qt-libjpeg -qt-zlib -no-libtiff -ptmalloc -no-webkit -no-script -no-scripttools -xplatform qws/linux-arm-g++ -qt-mouse-tslib -I/home/tslib-master/arm_tslib/include -L/home/tslib-master/arm_tslib/lib -opengl -I/home/work/qt/OpenGLES_QT/OpenGLES -L/home/mali_drv

    //////////// source code /////////////////////////////
    @
    #include "glwidget.h"

    glwidget::glwidget(QWidget *parent) :
    QGLWidget(parent)
    {
    }

    void glwidget::initializeGL() {

    glEnable(GL_DEPTH_TEST);
    glEnable(GL_CULL_FACE);
    glShadeModel(GL_SMOOTH);
    

    }
    const GLfloat triangleVertices[] {
    -1.0f, -0.5f, 0.0f,
    1.0f, -0.5f, 0.0f,
    0.0f, 0.5f, 0.0f
    };

    void glwidget::resizeGL(int w, int h)
    {
    glViewport(0,0,640,300);
    glClearColor(1.0f,1.0f,1.0f,1.0f);
    }

    void glwidget::paintGL()
    {
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    
    //glColor3f(1.0f, 0.0f, 0.0f);
    glColor4f(0.0f,1.0f,0.0f,0.0f);
    glEnableClientState(GL_VERTEX_ARRAY);
    {
    
        glVertexPointer(3, GL_FLOAT, 0, triangleVertices);
        glDrawArrays(GL_TRIANGLE_FAN, 0, 3);
    
    }
    glDisableClientState(GL_VERTEX_ARRAY);
    

    }

    @@
    [edit, code wrappings introduced, koahnig]

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      Please check out the "code wrapping handling":http://qt-project.org/wiki/ForumHelp#e3f82045ad0f480d3fb9e0ac2d58fb01
      This makes your code easier to read in the forum.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • M Offline
        M Offline
        minamiman
        wrote on last edited by
        #3

        thanks your help...

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved