Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: QT and Visual Studio caching when using GLUT objects?

  1. #1
    Newbie Newbie
    Join Date
    Sep 2015
    Posts
    1

    QT and Visual Studio caching when using GLUT objects?

    EDIT: Sorry for the mistake in the Title, it should have been: QT and Visual Studio CRASHING when using GLUT objects?

    Hi Guys,

    I am working in a task to create a program in OpenGL in Visual Studio with QT framework.

    I wanted to learn the first steps in this direction, so I wanted to create a TeaPot just for testing:

    #include "glwidget.h"
    #include <GL/glut.h>
    GLWidget::GLWidget(QWidget *parent)
    : QGLWidget(parent)
    {
    }

    void GLWidget::initiliazeGL(){
    glClearColor(1, 1, 0, 1);
    }
    void GLWidget:aintGL(){
    glClear(GL_COLOR_BUFFER_BIT);

    glutWireTeapot(1.0);
    }
    void GLWidget::resizeGL(int w, int h){

    }


    Above is the class where I put my code. First I have tried to create a Rectangle with GL_TRIANGLES, and it worked, but when I try to add "glutWireTeapot", or "glutSolidTeapot", or "glutSolidCube" etc... it crashes the application.

    In QT Creator it says:
    The program has unexpectedly finished.
    C:\~//~//~//~~~\debug\testBug2.exe crashed

    In Visual Studio 2013 it says:

    Unhandled exception at 0x000007FEE7C95AAF (freeglut.dll) in testBug2.exe: 0xC0000005: Access violation reading location 0x0000000000000034.

    When I saw the message in Visual Studio about the freeglut.dll, I went and deleted the freeglut files, downloaded freeglut again and added the files to the destination folders. But still, it didn't work


    Does anybody have any idea what the problem is?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    2,515
    I would expect GLUT and Qt to be mutually exclusive. They're both fundamentally GUI toolkits, so I wouldn't expect to be able to use both in the same program.

    In particular, most FreeGLUT functions (including glutWireTeapot) first check that GLUT has been initialised (via glutInit), and terminate if it hasn't. But calling glutInit in a program that's already using Qt to create a GUI may have its own problems.

  3. #3
    Member Regular Contributor
    Join Date
    Apr 2012
    Location
    Los Angeles
    Posts
    388
    Does anybody have any idea what the problem is?
    I use glut functions with a GUI tookit called FLTK. FLTK comes with explicit directions about usage with glut. I expect QT does too. I tried googling 'QT and GLUT' and got a few promising looking leads. But I'm not a QT user, so I leave it up to you to pursue it. Good luck.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •