Results 1 to 6 of 6

Thread: Help with Qt and SDL

  1. #1
    Join Date
    Jul 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    2

    Default Help with Qt and SDL

    Hi all,

    I try to use SDL lib in a Qt Project using a Visual Studio 2008, but i cant use SDL with QT.

    In SDL i make this function

    Qt Code:
    1. void setpixel(SDL_Surface *screen, int x, int y, Uint8 r, Uint8 g, Uint8 b)
    2. {
    3. Uint32 *pixmem32;
    4. Uint32 colour;
    5.  
    6. colour = SDL_MapRGB( screen->format, r, g, b );
    7.  
    8. pixmem32 = (Uint32*) screen->pixels + y + x;
    9. *pixmem32 = colour;
    10. }
    To copy to clipboard, switch view to plain text mode 

    now i cant use this function on Qt, does anyone know how i can use SDL with Qt or how i can modify this function to work on Qt?

    Thanks for all!

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

    Default Re: Help with Qt and SDL

    What is it supposed to do?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Apr 2009
    Posts
    132
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    67
    Thanked 6 Times in 5 Posts

    Wink Re: Help with Qt and SDL

    Use SDL and Qt is a bad idea. Both of them have their own event and windowing system. Try to use QGLWidget or try to look for a wrapper.

  4. #4
    Join Date
    Jul 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    2

    Default Re: Help with Qt and SDL

    Quote Originally Posted by wysota View Post
    What is it supposed to do?
    I have a sparse matrix with a range between -inf to inf, this function paint in a blank image diferents colors for each number of matrix.

    Quote Originally Posted by ricardo View Post
    Use SDL and Qt is a bad idea. Both of them have their own event and windowing system. Try to use QGLWidget or try to look for a wrapper.
    Thanks for your help, i will see this class now! =)

  5. #5
    Join Date
    Apr 2009
    Posts
    132
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    67
    Thanked 6 Times in 5 Posts

    Default Re: Help with Qt and SDL

    Quote Originally Posted by bottin View Post
    I have a sparse matrix with a range between -inf to inf, this function paint in a blank image diferents colors for each number of matrix.
    In that case, the best and easiest choice is to use QGLWidget.

  6. The following user says thank you to ricardo for this useful post:

    bottin (30th July 2009)

  7. #6
    Join Date
    Jul 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    2

    Default Re: Help with Qt and SDL

    Quote Originally Posted by ricardo View Post
    In that case, the best and easiest choice is to use QGLWidget.

    Thanks brow, now i use QGLWidget and resolve my problem!

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.