indielib.com

IndieLib Forum
It is currently Sat Dec 15, 2018 7:35 am

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: QT + IndieLib = LOVE :)
PostPosted: Mon Feb 02, 2009 8:57 am 
Offline
User avatar

Joined: Mon Aug 11, 2008 8:56 pm
Posts: 62
Location: Kyiv, Ukraine
Made working example of mixing IndieLib with native OS GUI.
It is possible thanks to existing SDL's hack which allows to say to SDL to use existing window handle for video initialization.
Also I had to build IndieLib with the window centering feature turned off (I just commented code line with SetWindowPos. Can we make something out to provide the control to window centering from the outside of IND_Window class, Javier?)

Here is a demo app: (code requires a compiled QT lib to be built)
7-Zip archive (5MB)
ZIP archive (8MB)

Screenshot
Image

I have some small troubles with input focus distribution, but I think this can be solved.
I will try to make an util to help compile animations and collisions xml files to fully test the possibilities of mixing very rich QT controls library with IndieLib.

[UPD] Qt debug dlls included into archive.
[UPD] Fixed bug in SDL_1.2 for WINDOW_ID hack, all modules are free from external visual studio 2008 run-time libraries. QT is used only in Debug mode to test the process of enabling editing controls in development version and auto removing them in release version.


Last edited by Nomad on Tue Feb 17, 2009 2:32 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 02, 2009 10:11 am 
Offline
Site Admin
User avatar

Joined: Wed Dec 26, 2007 1:38 am
Posts: 626
Location: Murcia, Spain
This looks aweasome!

Please! Can you add qt lib dll? Just to try it directly.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 02, 2009 1:32 pm 
Offline
User avatar

Joined: Mon Aug 11, 2008 8:56 pm
Posts: 62
Location: Kyiv, Ukraine
Sorry.
I just have thought that QT was linked statically. Updated archive now (the drawback is the size jumps from 3 to 7 MB :( )

Also I just can't for now launch exe file on Windows XP 32bit systems, and I do not know why. I've got some very strange access violation. Maybe that's because I compiled QT from sources on Vista-like OS.
If you have Vista like system and can't run too tell me please, because on all systems with Vista and Server 2008 I tried I have installed QT, because they are my dev platforms.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 17, 2009 2:45 pm 
Offline
User avatar

Joined: Mon Aug 11, 2008 8:56 pm
Posts: 62
Location: Kyiv, Ukraine
Updated archives. Now, I think, it must work on big majority of systems on which IndieLib works.

The main problem was that I built some of my dependencies(SDL and QT) with MSVCRT lib from dll module. And as they were themselves used as dll the windows fired some strange error code, insted of just saying that some dlls were missing.

The SDL and IndieLib libraries I used there was changed a bit.
In SDL 1.2 there is a minor bug with WINDOW_ID hack, unfortunately I think the developers of SDL will not fix it in their svn version, because they making SDL 1.3 and WINDOW_ID stuff is used only when somebody wants to use SDL with some external windowing system and it is a very rare case.

As for IndieLib I hope we will make that change to allow the window not to be centered on the screen.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 17, 2009 3:58 pm 
Offline
Site Admin
User avatar

Joined: Wed Dec 26, 2007 1:38 am
Posts: 626
Location: Murcia, Spain
Great.

Quote:
As for IndieLib I hope we will make that change to allow the window not to be centered on the screen.


Yes, I can't forget that.


Top
 Profile  
 
PostPosted: Sat May 18, 2013 1:59 pm 
Offline

Joined: Sat Mar 16, 2013 7:11 pm
Posts: 36
Hey,

Sorry for bumping this old thread but I don't want to start a new one and I think it fits the topic.

I use the Qt Gui for my level Editor and I finally decided to update to from 1.03 to 0.51 so I don't need to store 2 different versions of IndieLib in my Project. But for some reason the SDL_WINDOWID hack doesn't seem to work and IndieLib is running in a seperate Window. ( Maybe it's because of SDL 2.0?).

Code:
// SDL hack to initialize SDL in an existing window
char variable[64];
 _snprintf(variable, sizeof(variable), "SDL_WINDOW=0x%lx", (winId)());
_putenv(variable);


I asked google but apparently no one else has this problem. Does anyone know what the problem could be?


Top
 Profile  
 
PostPosted: Mon May 20, 2013 7:41 pm 
Offline
Site Admin

Joined: Thu Jul 16, 2009 1:52 pm
Posts: 250
Location: London, UK
Hi,

i think you are in the right track. We changed to SDL 2.0 in crossplatform version. Most probably the hack does not work with newer SDL code.


Top
 Profile  
 
PostPosted: Fri Jun 14, 2013 3:39 pm 
Offline
Site Admin
User avatar

Joined: Sun Jan 02, 2011 2:06 pm
Posts: 222
Location: Denmark
faybe wrote:
I asked google but apparently no one else has this problem. Does anyone know what the problem could be?

Did you ever find a solution? Im asking because we might need to look into this to get the tileless editor complete up and running :) ( the reason for qt is that we need to make use of the filebrowser component ).

_________________
Cross-platform repository: https://github.com/DarthMike/indielib-crossplatform
Cross-platform roadmap: http://www.indielib.com/wiki/index.php? ... eloper_FAQ


Top
 Profile  
 
PostPosted: Thu Jul 04, 2013 7:03 am 
Offline

Joined: Sat Mar 16, 2013 7:11 pm
Posts: 36
MFK wrote:
Did you ever find a solution? Im asking because we might need to look into this to get the tileless editor complete up and running :) ( the reason for qt is that we need to make use of the filebrowser component ).


Sorry for the late reply. Unfortunately I didn't. I was just gonna use 1.03 since it provides anything I need need for my editor. There seems to be a way though, but I think you need to do something rigth when initialising SDL 2.0. If you find a Solution please tell me :D


Top
 Profile  
 
PostPosted: Thu Jul 04, 2013 5:07 pm 
Offline
Site Admin
User avatar

Joined: Sun Jan 02, 2011 2:06 pm
Posts: 222
Location: Denmark
Just noticed the "support desktop windows" bullit under wishlist in this page:http://wiki.libsdl.org/moin.fcg/Roadmap it seems that support for it eventually will be implemented :mrgreen:

_________________
Cross-platform repository: https://github.com/DarthMike/indielib-crossplatform
Cross-platform roadmap: http://www.indielib.com/wiki/index.php? ... eloper_FAQ


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group