Results 1 to 6 of 6

Thread: xlib: extension "XFree86-DRI" missing on display ":0.0".

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2007
    Posts
    19
    Thanks
    2
    Qt products
    Qt3
    Platforms
    Unix/X11

    Smile xlib: extension "XFree86-DRI" missing on display ":0.0".

    when i trying to display image the above error is coming
    my program is

    Qt Code:
    1. #include "qgl.h"
    2. #include "qapplication.h"
    3. #include "qimage.h"
    4. class PaintWidget : public QGLWidget{
    5. public:
    6. PaintWidget(const QString &filename,QWidget *parent=0);
    7. void paintGL();
    8. void resizeGL(int w,int h);
    9. protected:
    10. QImage data,gldata;
    11. float width,height;
    12. };
    13.  
    14. PaintWidget::PaintWidget(const QString &filename,QWidget *parent):QGLWidget(parent){
    15. data.load(filename);
    16. resize(data.size());
    17. }
    18.  
    19.  
    20. void PaintWidget::paintGL(){
    21. QImage half=data.copy(0,0,data.width()/2,data.height()/2);
    22.  
    23. gldata = QGLWidget::convertToGLFormat(half);
    24. glDrawPixels(gldata.width(), gldata.height(), GL_RGBA, GL_UNSIGNED_BYTE, gldata.bits());
    25.  
    26. }
    27.  
    28. void PaintWidget::resizeGL(int w, int h){
    29. glViewport(0,0,w,h);
    30. width=w;
    31. height=h;
    32. glMatrixMode(GL_PROJECTION);
    33. glLoadIdentity();
    34. glOrtho(0,w,0,h,-1,1);
    35. glMatrixMode(GL_MODELVIEW);
    36. }
    37.  
    38. int main(int argc, char** argv){
    39. QApplication app(argc,argv);
    40. PaintWidget pw(argv[1]);
    41. pw.showFullScreen();
    42. return app.exec();
    43.  
    44. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by wysota; 17th March 2007 at 08:55. Reason: missing [code] tags

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.