Hello,

I'm a very newbie (or so) an I have this problem:

here is the source:

#ifndef _WORLD_H_
#define _WORLD_H_

#include <ClanLib/core.h>

class CL_Surface;
class CL_InputEvent;

class World
{
// Construction
public:
World();
~World();

// Attributes:
public:
CL_ResourceManager *resources;

// Operations:
public:

void run();

// Slots:
public:
void on_quit() { quit = true; }

// Implementation:
private:
void draw();

CL_Surface *background;
CL_Font *font;

bool quit;
int i;
};

#endif

Here the cpp:

#include <ClanLib/core.h>
#include <ClanLib/display.h>
#include <ClanLib/gl.h>

#include "world.h"

World::World()
{
// Setup resources
resources = new CL_ResourceManager("resources.xml");

background = new CL_Surface("background", resources);
font = new CL_Font("Font2", resources);
i=0;
}

World::~World()
{
delete background;
delete font;
delete resources;
}

void World::run()
{
while(CL_Keyboard::get_keycode(CL_KEY_ESCAPE) == false)
{
draw();

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

void World::draw()
{
int static nCount = 0;
nCount++;
CL_Display::clear(CL_Color(0,0,56));
// Draw background
background->draw();
font->draw(10, 400, "Durchlauf " + CL_String::from_int(nCount));
//font->draw(10, 400, "AaBbCc1234567890");
}

/************************************************** ********

If I do the make, everything is ok.

If i start the little programm I become this error:

Segmentation fault (core dumped)

If I erase the red marked lines, everything works.

Whats wrong.

Andreas

(Sorry for bad english!)