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.