Results 1 to 4 of 4

Thread: [Qt 4.6.3/OpenGL 4.1] : Unrecognized OpenGL

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2010
    Posts
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [Qt 4.6.3/OpenGL 4.1] : Unrecognized OpenGL

    Quote Originally Posted by Dong Back Kim View Post
    Are you using overpainting with the QGLWidget?
    A this time, no. I have just written this piece of code.


    Qt Code:
    1. class GLWidget :public QGLWidget
    2. {
    3. Q_OBJECT
    4. public:
    5. GLWidget(QWidget* argParent = 0,
    6. const QGLWidget* argShareWidget = 0,
    7. Qt::WindowFlags argFlags = 0 );
    8.  
    9. signals:
    10. void sizeChanges(QSize const&);
    11. void doubleClick(QPoint const&);
    12. void click(QPoint const&);
    13.  
    14. protected:
    15. void initializeGL();
    16. void resizeGL(int argWidth, int argHeight);
    17. void mouseDoubleClickEvent(QMouseEvent* event);
    18. void mouseReleaseEvent(QMouseEvent* event);
    19. void paintGL();
    20.  
    21. };
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. #include "../include/GLWidget.h"
    2.  
    3. GLWidget::GLWidget(QWidget* argParent,
    4. const QGLWidget* argShareWidget,
    5. Qt::WindowFlags argFlags)
    6.  
    7. :QGLWidget(argParent,
    8. argShareWidget,
    9. argFlags)
    10. {
    11. }
    12.  
    13. void GLWidget::initializeGL()
    14. {
    15. }
    16.  
    17. void GLWidget::resizeGL(int argWidth, int argHeight)
    18. {
    19. emit sizeChanges(QSize(argWidth, argHeight));
    20. }
    21.  
    22.  
    23. void GLWidget::paintGL()
    24. {
    25. }
    26.  
    27. void GLWidget::mouseDoubleClickEvent(QMouseEvent* event)
    28. {
    29. emit doubleClick(event->pos());
    30. }
    31.  
    32. void GLWidget::mouseReleaseEvent(QMouseEvent* event)
    33. {
    34. emit click(event->pos());
    35. }
    To copy to clipboard, switch view to plain text mode 

    I've believed, an instant, it's because my OpenGL implementation is 4.1 and Qt 4.6.3 wouldn't recognize OpenGL 4.1 because of enum QGLFormat::OpenGLVersionFlag's definition.

    About glGetString(). The problem is over. I've discovered glContext is inititialized in after QGLWidget() constructor. In paintGL(), it works well.
    Last edited by didier; 5th August 2011 at 12:02.

  2. #2
    Join Date
    Aug 2011
    Location
    Seoul, Korea
    Posts
    46
    Thanks
    9
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [Qt 4.6.3/OpenGL 4.1] : Unrecognized OpenGL

    Quote Originally Posted by didier View Post
    A this time, no. I have just written this piece of code.


    Qt Code:
    1. class GLWidget :public QGLWidget
    2. {
    3. Q_OBJECT
    4. public:
    5. GLWidget(QWidget* argParent = 0,
    6. const QGLWidget* argShareWidget = 0,
    7. Qt::WindowFlags argFlags = 0 );
    8.  
    9. signals:
    10. void sizeChanges(QSize const&);
    11. void doubleClick(QPoint const&);
    12. void click(QPoint const&);
    13.  
    14. protected:
    15. void initializeGL();
    16. void resizeGL(int argWidth, int argHeight);
    17. void mouseDoubleClickEvent(QMouseEvent* event);
    18. void mouseReleaseEvent(QMouseEvent* event);
    19. void paintGL();
    20.  
    21. };
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. #include "../include/GLWidget.h"
    2.  
    3. GLWidget::GLWidget(QWidget* argParent,
    4. const QGLWidget* argShareWidget,
    5. Qt::WindowFlags argFlags)
    6.  
    7. :QGLWidget(argParent,
    8. argShareWidget,
    9. argFlags)
    10. {
    11. }
    12.  
    13. void GLWidget::initializeGL()
    14. {
    15. }
    16.  
    17. void GLWidget::resizeGL(int argWidth, int argHeight)
    18. {
    19. emit sizeChanges(QSize(argWidth, argHeight));
    20. }
    21.  
    22.  
    23. void GLWidget::paintGL()
    24. {
    25. }
    26.  
    27. void GLWidget::mouseDoubleClickEvent(QMouseEvent* event)
    28. {
    29. emit doubleClick(event->pos());
    30. }
    31.  
    32. void GLWidget::mouseReleaseEvent(QMouseEvent* event)
    33. {
    34. emit click(event->pos());
    35. }
    To copy to clipboard, switch view to plain text mode 

    I've believed, an instant, it's because my OpenGL implementation is 4.1 and Qt 4.6.3 wouldn't recognize OpenGL 4.1 because of enum QGLFormat::OpenGLVersionFlag's definition.

    About glGetString(). The problem is over. I've discovered glContext is inititialized in after QGLWidget() constructor. In paintGL(), it works well.
    Good to know about QGLFormat::OpenGLVersionFlag.

Similar Threads

  1. Replies: 0
    Last Post: 6th December 2009, 00:41
  2. Qt with OpenGL ES for ARM9 - All OpenGL ES tests have failed!
    By vinpa in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 3rd December 2009, 10:10
  3. Problem from OpenGL to QT OpenGL
    By nuts_fever_007 in forum Newbie
    Replies: 5
    Last Post: 15th May 2009, 09:37
  4. Qt in opengl
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 16th June 2007, 16:38
  5. openGL
    By dragon in forum Qt Programming
    Replies: 2
    Last Post: 13th July 2006, 16:07

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.