Results 1 to 6 of 6

Thread: Qt4/sdl

  1. #1
    Join Date
    Jan 2007
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Qt4/sdl

    Ave!
    How to make a SDLsurface on a QWidget?
    heard something with SDL_WINDOWID, but...

    Thanks

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Qt4/sdl

    Try QxtSdlWidget:
    J-P Nurmi

  3. #3
    Join Date
    Nov 2006
    Posts
    35
    Thanks
    25
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Re: Qt4/sdl

    Does this work under Windows? I remember reading somewhere that this approach does not work:
    Qt Code:
    1. snprintf(windowId, sizeof(windowId), "SDL_WINDOWID=0x%lx", winId());
    2. putenv(windowId);
    To copy to clipboard, switch view to plain text mode 

    I would like to try myself, but how do I get the Qxt (Qt extension libraray) compiled under Windows? The documentation on this is somewhat spare.

    I checkedout the sources from their SVN repository and then read the "deploy/docs/building.html" but that did not help. What 3rd party libs are needed, where must I copy their sources, etc?

    I get the following errors when trying to compile (qmake; make):
    Qt Code:
    1. makefile:214: *** multiple target patterns. Stop.
    To copy to clipboard, switch view to plain text mode 

    Running configure.bat outputs many project messages (autogenerating c++ style includes..., etc.) I have never seen before from any Qt qmake project.

    Thanks in advance,
    -Jens

  4. #4
    Join Date
    Nov 2006
    Posts
    35
    Thanks
    25
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt4/sdl

    Ok, got a minimal example running (without the whole Qxt library):

    1. Extract the attached ZIP file to a directory of your choice (I will refer to as project directory from now on).
    2. Get the SDL development libraries for MinGW for Windows from http://www.libsdl.org/download-1.2.php and extract them to the project directory and rename the SDL directory to SDL.
    3. Get the SDL_image development library for MinGW for Windows from http://www.libsdl.org/projects/SDL_image/ and extract the *.dll to "project/SDL/bin". Get the sources from the same site and extract the SDL_image.h to "project/SDL/include".
    4. Run qmake, make.
    5. Copy the SDL.dll, SDL_image.dll, png12.dll from the "SDL/bin" directory to the created executable directory (e.g. "project/release"). Copy the nerd.png there too.


    After starting the executable I get a blank black window. Moving it outside the screen and back in reveals the nerd.png image, so it's not working 100% at the moment.

    Notes: These are the changes I made to the Qxt files:
    QxtSdlWidget.h:
    - Commented qxtglobal.h proprocessor inlcude.
    - Removed library export macro from class definition.
    QxtSdlWidget.cpp:
    - Changed SDL preprocessor include to <SDL.h>
    MySdlWidget.pro:
    - Changed the project file completely.

    -Jens
    Attached Files Attached Files

  5. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Qt4/sdl

    Yeah, I had my reasons not to paste a link to the homepage but give direct links to the files instead. The library (including it's build system) is still at early development stage and way too immature to be anything usable, really.
    J-P Nurmi

  6. #6
    Join Date
    Jan 2007
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Qt4/sdl

    Thanks to jpn. will try it. There was no problem with qt3 !!
    Thanks to nononsense (i use x11)

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.