Results 1 to 4 of 4

Thread: why is clanlib so slow???

  1. #1

    Default why is clanlib so slow???

    Hi

    I've written a game using both clanlib and directx. The PC is a celeron 1.8ghz
    with Nvidia 7300LE Graphics card and 256mb ram, supporting OpenGL 2.0.

    I've deliberately chosen a celeron to get a good comparison in speed
    between clanlib v directx.

    I will say now, all my drawing is 2D only. No 3d at all.

    The game is a fruit machine simulation. So, it's nothing overly complex.

    The directx version of the game absolutely flies. Speed is perfect. The Clanlib version of the same game is so slow rendering it virtually useless.

    I have loaded all my graphics into memory as CL_Surface's ( in all about
    100 different graphics). These graphics occupy around 12meg of ram in total.

    I load them in like so:

    start_button = load_image_from_file( "graphics/start_button.png" );
    hold_button = load_image_from_file( "graphics/hold_button.png" );
    hold_button1 = load_image_from_file( "graphics/hold1.png" );


    In clanlib i then render these, and Flip them as such::

    CL_Display::clear(CL_Color(
    0, // red component
    0, // green component
    0)); // blue component

    // Draw all my graphics as surfaces. here...



    // Flip

    CL_Display::flip();
    CL_System::keep_alive();



    Sounds simple enough, so why so Slow!!!!!!

    That's all Im doing, so if any one can help me get the best out of Clanlib
    then please tell me, otherwise Its back to directx!

    thanks.

  2. #2
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    547

    Default

    There are many possible reasons for why it is slow on your system.

    One guess would have been that your OpenGL might not be accelerated, but thats less likely when its a Nvidia card you have.

    Another likely possibility is that you are using surfaces instead of sprites. ClanLib attempts to batch rendering commands it sends to OpenGL, but that batching functionality requires that the graphics are stored in the same texture. If you use CL_Surface in a way where each small piece of graphics is in its own surface, then that is probably what trashes the performance. You solve this problem by either using CL_Sprite with each image as a frame in the sprite, or you pack all images in the same file and then draw each part manually with CL_Surface.

  3. #3

    Default

    Hi Magnus

    Thanks for the reply.

    When you say pack all images in the same file, do you mean say, put them
    on one big surface of say 1024 x 768, and then extract each image off that one surface, to draw??

  4. #4
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    547

    Default

    Yes, that's what I mean

Similar Threads

  1. Installing ClanLib 0.8 and ClanLib 0.9 on linux
    By rombust in forum ClanLib: Developer Chat
    Replies: 4
    Last Post: 07-15-2008, 09:51 AM
  2. Is FileSponge running slow today
    By Grumpychumps in forum Funeral Quest
    Replies: 2
    Last Post: 05-03-2007, 05:12 AM
  3. boards gettin a lil slow
    By Wacko Darko in forum RTsoft Tavern
    Replies: 2
    Last Post: 11-09-2002, 12:27 AM

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
  •