LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-18-2009, 05:37 PM   #1
CoderMan
Member
 
Registered: Jan 2009
Location: Gemini Capsule 25164
Distribution: Gentoo
Posts: 375
Blog Entries: 24

Rep: Reputation: 43
Unhappy Learning clanlib: cannot get my first sprite to display


Hi. I am trying to learn ClanLib, but I can't even get my first sprite to display. I am using libclanlib-dev version 0.8.1-1 on a Debian Lenny amd64 system. I have been following the sprites tutorial that comes with clanlib-doc package.

Here is code from the application file:
Code:
...
      CL_SetupCore::init();
      CL_SetupDisplay::init();
      CL_SetupGL::init();
      // Set display mode                                                                                                                      
      CL_DisplayWindow * window = new CL_DisplayWindow("LususApp", 800, 600);

      CL_ResourceManager * resources = new CL_ResourceManager("../data/resources.xml");

      CL_Sprite * belt3roller = new CL_Sprite("belt3roller", resources);

      belt3roller->update();
      belt3roller->draw(50,50);

      CL_System::sleep(1000);

      // CL deinitialization functions                                                                                                         
      CL_SetupGL::deinit();
      CL_SetupDisplay::deinit();
      CL_SetupCore::deinit();
...
And here is the resources.xml file:

Code:
<?xml version="1.0" ?>
<resources>
<sprite
   name="belt3roller">
  <image file="../data/belt3roller.png">
    <grid
       pos="0, 0"
       size="137, 29"
       array="6, 1" />
    </image>
</sprite>
</resources>
"belt3roller.png" contains 6 sprite frames lined up in a single row. My window displays, but it only displays a black background - no sprite appears.
 
Old 07-18-2009, 06:19 PM   #2
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,784

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083
According to CL_DisplayWindow, double buffering is on by default. So you probably need to do
Code:
window->flip();
before anything shows up.
 
Old 07-28-2009, 06:57 AM   #3
rombust
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Rep: Reputation: 0
Note, ClanLib 0.8 is very old

ClanLib 1.0 accepts patches, but is no longer being developed

ClanLib 2.0 is a vast improvement.
 
Old 07-28-2009, 06:58 AM   #4
rombust
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Rep: Reputation: 0
Also, see http://www.rtsoft.com/forums/showthread.php?t=2751 for example screen shots
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem compiling clanlib: SDL_gfxPrimitives.h: No such file rocknroll Linux - Software 1 04-08-2008 04:35 AM
ClanLib problems on Fedora core 1# TippyToes Linux - Software 1 01-05-2005 11:19 PM
Installing ClanLib Problems somerandomdude Linux - Software 0 11-29-2004 04:36 PM
compiling and clanlib tardigrade Programming 1 10-20-2004 12:37 AM
problem compiling Clanlib 0.6.5 freeindy Linux - Software 1 05-30-2004 02:49 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration