Results 1 to 2 of 2

Thread: CL_Sprite draw problem

  1. #1
    Lesser Knight
    Join Date
    May 2010
    Posts
    32

    Default CL_Sprite draw problem

    Hello all (srry my English). I used ClanLib and VS 2010.

    PHP Code:
    #include "main.h"

    int Game::App(const std::vector<CL_String> &args)
    {
        
    Game Game;
        
    Game.quit false;

        
    CL_SetupCore sc;
        
    CL_SetupDisplay sd;
        
    CL_SetupGL sgl;

        
    Game.Run();

        return 
    0;
    }

    void Game::on_window_close()
    {
        
    this->quit true;
    }

    void Game::Run()
    {
        
    CL_DisplayWindowDescription    desc;
        
    desc.set_size(CL_Size(1024768), true);
        
    desc.set_title("Journey Sticks");
        
    desc.set_allow_resize(false);
        
    desc.show_maximize_button(false);

        
    CL_DisplayWindow window(desc);

        
    CL_GraphicContext gc window.get_gc();
        
    CL_InputContext ic window.get_ic();

        
    CL_Slot    slot_window_close window.sig_window_close().connect(this, &Game::on_window_close);


        
    CL_ResourceManager resources("resources.xml");

        
    CL_Sprite wall(gc"Wall", &resources);


        while(!(
    this->quit == true))
        {
            
    gc.clear(CL_Colorf::white);

            
    wall.update();
            
    wall.draw(gc00);


            
    window.flip();
            
    CL_KeepAlive::process();

        }

    }

    CL_ClanApplication app(&Game::App); 
    Game - very slow and CPU - 100%, but if i remove "wall.draw(gc, 0, 0);" then all normal and CPU - 30-50%.

    "CL_KeepAlive:: process(10);" - not solved problem
    "CL_System::sleep(10);" - not solved problem

    Info abount image:
    Format - PNG
    Size - 1024x768
    Transparency - On

    Help me, plz

  2. #2
    Lesser Knight
    Join Date
    May 2010
    Posts
    32

    Default

    i found this problem in ClanLib 2.2.8. if i load 2 and more images (and sprites) i take problem with CPU and very slow work =(

    example:

    PHP Code:
            gc.clear(CL_Colorf::white);


            
    wall.draw(gc00);
            
    stick.draw(gc300300);


            
    window.flip();
            
    CL_KeepAlive::process(); 
    Solved. Problem: ClanLib + run Photoshop CS5 = very bad =)
    Last edited by Aikidos; 04-22-2011 at 02:47 PM.

Similar Threads

  1. Draw image behind collada sphere
    By p1s in forum Official ClanLib SDK Forums
    Replies: 6
    Last Post: 12-02-2010, 07:44 PM
  2. webcam frames as CL_Sprite ... problem :(
    By tamberlo in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 10-18-2010, 04:21 PM
  3. draw sprites without background
    By Koli14 in forum Official ClanLib SDK Forums
    Replies: 5
    Last Post: 01-14-2010, 09:26 AM
  4. CL_Surface draw a picture
    By DavinciZhe in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 08-08-2009, 02:01 AM
  5. GDI Target Draw Problems
    By rombust in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 05-01-2009, 01:21 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
  •