Results 1 to 2 of 2

Thread: Opengl - Textures - Qt

  1. #1
    Join Date
    Jun 2006
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Opengl - Textures - Qt

    Hello,

    I 've made a game using Qt and opengl. I 'm using textures and when I run the game on my computer it works.
    But when I 'm running the game on an other computer I seems that the textures aren't loaded. If I install Qt on the other computer it works.
    Do you have any idea to avoid installing Qt ?
    Maybe a .dll to put in the game directory...

    Please help !

    Alex

    Here's my code to load textures :
    QImage t;
    QImage b;
    b.load( "images/128.jpg" );
    t = QGLWidget::convertToGLFormat( b );
    glGenTextures( 2, &textures[0] );
    glBindTexture( GL_TEXTURE_2D, textures[0] );
    gluBuild2DMipmaps( GL_TEXTURE_2D, 3, t.width(), t.height(), GL_RGBA, GL_UNSIGNED_BYTE, t.bits() );
    glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
    glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Opengl - Textures - Qt

    You might be missing a plugin for jpeg support. Make a subdirectory called imageformats in the directory containing the binary of your application and put the contents of your QTDIR/plugins/imageformats there.

  3. The following user says thank you to wysota for this useful post:

    Alex63 (30th June 2006)

Similar Threads

  1. Does OpenGL be supported in opensource of Qt-4.1.2?
    By showhand in forum Qt Programming
    Replies: 1
    Last Post: 15th May 2006, 10:46
  2. help on openGL context
    By mickey in forum Qt Programming
    Replies: 1
    Last Post: 29th March 2006, 19:21
  3. Qt's optimized OpenGL context switching
    By sverhoff in forum Qt Programming
    Replies: 0
    Last Post: 28th March 2006, 16:40
  4. Example OpenGL project?
    By brcain in forum Qt Tools
    Replies: 9
    Last Post: 23rd February 2006, 21:17
  5. problems with Opengl
    By SlawQ in forum Qt Programming
    Replies: 4
    Last Post: 12th February 2006, 22:49

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.