Results 1 to 10 of 10

Thread: Performance issues when drawing in two windows

  1. #1
    Squire
    Join Date
    Sep 2011
    Posts
    27

    Default Performance issues when drawing in two windows

    Hi All

    Currently using ClanLib V0.81

    I am currently making a poker game which has two windows, the bottom displays the main game and the top screen displays a pay table for the relevant wins for a hand. I have only just included the top screen window and straight away I have had a big performance hit. When I dont even draw anything in the top window it still has the same performance hit.

    This is how I am drawing in the two screens:

    CL_Display::set_current_window(window1_ptr);

    bottomScreenBackground->draw(0,0,gc);

    Other drawing calls.......

    CL_Display::flip(-1);

    CL_Display::set_current_window(window2_ptr);

    topScreenBackground->draw(0,0,gc);

    Other drawing calls.......

    CL_Display::flip(-1);

    Am I doing something wrong, any help would be greatly appreciated.

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Yeah you are using ClanLib V0.81

    I assume you used a package manager on linux to download it.

    Nobody that I know uses it anymore.

    Use ClanLib 2.3

  3. #3
    Squire
    Join Date
    Sep 2011
    Posts
    27

    Default

    Thanks for the reply. I work for a company and that's the version they gave me to use when I started. My project is upwards of 20k lines of code, how easy will it be to change to 2.3. Will there a be large amount of alterations.

    Thanks.

  4. #4
    Squire
    Join Date
    Sep 2011
    Posts
    27

    Default

    Also, is the approach I used there ok for drawing to two different windows.

  5. #5
    Master Sorcerer
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    554

    Default

    The latest version compatible with your game is ClanLib 1.0. If you are lucky upgrading to that version will fix your problem.

    The changes between ClanLib 1.0 and 2.0+ are significant enough to effectively call it a new API. If your code base is relying heavily on ClanLib it could take a long time to port it. The easiest approach may be to simply create some classes that emulate the old library (by forwarding it to the new version equivalent). It largely depends on how large a subset of ClanLib's API the application is using which method works best.

    An alternative could of course be to simply fix the issue in ClanLib 1.0, post a patch and release a new version. I can't say for sure what the nature of the slowdown is, except that it is probably related to switching between the OpenGL contexts of the two windows created. You could try run the program with a profiler (I recommend Very Sleepy, a free and very easy to use one) to get a clear picture of exactly what it is doing. If all you want is to fix a simple performance problem and then move on, this would probably be the most cost-efficient solution.

  6. #6
    Squire
    Join Date
    Sep 2011
    Posts
    27

    Default

    Hi, Where can I get the precompiled include and lib folders for V1.0. I can seem to find them.

    Thanks

  7. #7
    Squire
    Join Date
    Sep 2011
    Posts
    27

    Default

    I have looked into the difference in FPS when updating to the top screen and not updating the topscreen. it runs at 60 when I update the top but drops to between 20 - 30 when i do update the top screen. This will be due to the CL_Display::Flip() call wont it. When you call Flip() does it flip the buffer of the current window or both windows. if not is there a way to only update a certain portion of the top screen when asprite is animating.

    All the best.

  8. #8
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Bergen, Norway
    Posts
    588

    Default

    I'm sorry, but we only have precompiled libraries for ClanLib 2.x.

  9. #9
    Peasant
    Join Date
    May 2011
    Posts
    5

    Default

    Thanks Sphere, I am currently running through the installation off V1.0 but when i run the ClanLib.dsw file to compile the libs only half the projects build correctly. It give me the following errors:

    fatal error C1083: Cannot open include file: 'dsound.h': No such file or directory

    fatal error C1083: Cannot open include file: 'dinput.h': No such file or directory

    Also I dont suppose if you know about the drawing optimization I mentioned previously, regarding the Flip() function.

    All the best,
    Really appreciate the help.

  10. #10
    Squire
    Join Date
    Sep 2011
    Posts
    13

    Default

    These 2 headers are from the Directx SDK, i guess the clanlib 1 version was dependant of it. So you will most likely have to download the directx SDK and link it correctly to your project to be able to compile it. The directx sdk is avalaible on the microsoft website for free. But maybe you can just get the few nescesary headers / lib rather then the whole SDK wich is quite huge.

Similar Threads

  1. Windows app crashing on Maximize (Windows XP)
    By BigBMan in forum Proton SDK
    Replies: 8
    Last Post: 03-17-2011, 01:38 AM
  2. Issues with RT3DApp Windows & Visual C++ 2010 Express
    By Bryan C Dickson in forum Proton SDK
    Replies: 8
    Last Post: 11-08-2010, 08:13 AM
  3. ClanLib Layered Window design & performance issues
    By rmorison in forum Official ClanLib SDK Forums
    Replies: 4
    Last Post: 02-09-2010, 08:58 AM
  4. Performance numbers
    By sphair in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 04-29-2009, 08:42 AM
  5. Performance Issues in Fedora
    By Starclopsofish in forum Novashell Game Creation System
    Replies: 4
    Last Post: 02-09-2009, 03:32 PM

Bookmarks

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
  •