Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. Beginning in Qt with OpenGL

Beginning in Qt with OpenGL

Scheduled Pinned Locked Moved Game Development
27 Posts 4 Posters 15.7k Views
  • 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.
  • D Offline
    D Offline
    Dinesh Balu
    wrote on 24 May 2011, 07:21 last edited by
    #18

    [quote author="Chuck.Gao" date="1306221357"]I can build it on both Desktop(also simulator) and Symbian device, but it’ll crash some where.
    [/quote]

    You mean the application that I sent you will crash somewhere,...

    [quote author="Chuck.Gao" date="1306221357"]Qt will use OpenGL ES automatically if you build Symbian based application.
    [/quote]

    Then why is it not working.... I got the simulator window opened but the triangle is not drawn on the screen...

    :)

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      ZapB
      wrote on 24 May 2011, 07:27 last edited by
      #19

      That's for you to debug. It's your app. Run it in the debugger and see why it crashes.

      Nokia Certified Qt Specialist
      Interested in hearing about Qt related work

      1 Reply Last reply
      0
      • D Offline
        D Offline
        Dinesh Balu
        wrote on 24 May 2011, 07:37 last edited by
        #20

        When I started debugging...
        A Warning is shown..
        It says..

        bq. The preferred debugger engine for debugging binaries of type 'x86-windows-msvc2008-pe-32bit' is not available.
        The debugger engine 'Gdb engine' will be used as a fallback.
        Details:There is no CDB binary available for binaries in format 'x86-windows-msvc2008-pe-32bit'

        What does that mean?

        :)

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          ZapB
          wrote on 24 May 2011, 07:40 last edited by
          #21

          Which build are you trying to debug? Desktop/simulator/symbian? I would try getting it working on the desktop first.

          Nokia Certified Qt Specialist
          Interested in hearing about Qt related work

          1 Reply Last reply
          0
          • D Offline
            D Offline
            Dinesh Balu
            wrote on 24 May 2011, 07:46 last edited by
            #22

            [quote author="ZapB" date="1306222858"]Which build are you trying to debug? Desktop/simulator/symbian? I would try getting it working on the desktop first.[/quote]

            That was Qt Simulator -> N900 simulator

            I tried that with desktop simulator,... It says Debugging starts..
            It does nothing...

            No window appears... no output...

            This is a Qt Mobile application...

            :)

            1 Reply Last reply
            0
            • Z Offline
              Z Offline
              ZapB
              wrote on 24 May 2011, 07:56 last edited by
              #23

              Can you try building your app for the desktop target (not the desktop mobile simulator) and debugging that. You should have all the tools needed to debug that.

              Nokia Certified Qt Specialist
              Interested in hearing about Qt related work

              1 Reply Last reply
              0
              • D Offline
                D Offline
                Dinesh Balu
                wrote on 24 May 2011, 08:07 last edited by
                #24

                That was the desktop target...

                This is the report when I interrupt debugging...

                bq. Debugging starts
                (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x0 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x0 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x4 in read in psymtab, but not in symtab.)
                (Internal error: pc 0x4 in read in psymtab, but not in symtab.)

                if you don't mind of testing my app yourself, I can mail you the project.... do you?

                :)

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  Dinesh Balu
                  wrote on 24 May 2011, 11:42 last edited by
                  #25

                  Guys I got it .....

                  I didn't use show function... now only i did...

                  Thanks for all your help..... :D

                  :)

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    Dinesh Balu
                    wrote on 25 May 2011, 05:17 last edited by
                    #26

                    I have one more problem...

                    In this project , I'm drawing a triangle in center of the screen...

                    The project clears the screen with the color I specified , but it doesn't draw the triangle...

                    Here is the code...

                    @GamePlay::GamePlay(QWidget *parent) :
                    QGLWidget(parent)
                    {
                    setFormat(QGLFormat(QGL::DoubleBuffer | QGL::DepthBuffer));
                    }

                    void GamePlay::initializeGL()
                    {
                    qglClearColor(Qt::green);

                    }

                    void GamePlay::resizeGL(int width,int height)
                    {
                    glViewport(0,0,width,height);
                    glMatrixMode(GL_PROJECTION);
                    glLoadIdentity();
                    GLfloat x = GLfloat(width) / height;
                    glFrustum(-x, x, -1.0, 1.0, 4.0, 15.0);
                    glMatrixMode(GL_MODELVIEW);
                    }
                    void GamePlay::paintGL()
                    {
                    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
                    draw();
                    }

                    void GamePlay::draw()
                    {
                    glMatrixMode(GL_MODELVIEW);
                    glLoadIdentity();
                    glTranslatef(0,0,-10.0f);
                    glBegin(GL_TRIANGLES);
                    qglColor(Qt::red);
                    glVertex3f(-0.5f,-0.5f,0);
                    glVertex3f(0,-0.5f,0);
                    glVertex3f(0.5f,-0.5f,0);
                    glEnd();
                    }@

                    :)

                    1 Reply Last reply
                    0
                    • Z Offline
                      Z Offline
                      zester
                      wrote on 11 Jun 2011, 10:41 last edited by
                      #27

                      First strait OpenGL isn't trivial and isn't for most people, just knowing how to program in C/C++ and the OpenGL api isn't enough you need a background in advanced mathematics. Also if your doing things in the wrong order or if your not in the right mode at the correct time you will end up with a different result than what you expected. When programming in OpenGL you have to think of it in a procedural mind set. Post a link to your complete source code if you want 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