dwune
10-01-2007, 02:18 PM
Hi, I read about ClanLib a while back and recently decided to try it. I love the way the API is laid out. Anyway my problem is that CL_DisplayWindow doesn't work.
this is my code:
#include <ClanLib/core.h>
#include <ClanLib/application.h>
#include <ClanLib/display.h>
#include <ClanLib/gl.h>
#include <iostream>
using namespace std;
class MyApp : public CL_ClanApplication
{
public:
virtual int main(int, char**);
} app;
int MyApp::main(int argc, char **argv)
{
CL_SetupCore sc;
CL_SetupDisplay sd;
CL_DisplayWindowDescription desc;
CL_Size sz(640,480);
desc.set_title("test");
desc.set_size(sz);
try
{
CL_DisplayWindow window(desc);
}
catch (CL_Error err)
{
cout << err.message.c_str() << endl;
}
/*while (!CL_Keyboard::get_keycode(CL_KEY_ESCAPE))
{
//CL_Display::flip();
CL_System::keep_alive(20);
}*/
return 0;
}
I can compile and link this just fine, and if I remove the CL_DisplayWindow it runs through, ofc since it doesn't do anything hehe.
I get this error though if I include displaywindow:
You need to create a display target first.
Any idea what's up here? I've checked countless examples and the display overview among others. The code checks out afaik. Oh, and I've tried using the dipslaywindow constructor as well, to no avail.
Thanks.
this is my code:
#include <ClanLib/core.h>
#include <ClanLib/application.h>
#include <ClanLib/display.h>
#include <ClanLib/gl.h>
#include <iostream>
using namespace std;
class MyApp : public CL_ClanApplication
{
public:
virtual int main(int, char**);
} app;
int MyApp::main(int argc, char **argv)
{
CL_SetupCore sc;
CL_SetupDisplay sd;
CL_DisplayWindowDescription desc;
CL_Size sz(640,480);
desc.set_title("test");
desc.set_size(sz);
try
{
CL_DisplayWindow window(desc);
}
catch (CL_Error err)
{
cout << err.message.c_str() << endl;
}
/*while (!CL_Keyboard::get_keycode(CL_KEY_ESCAPE))
{
//CL_Display::flip();
CL_System::keep_alive(20);
}*/
return 0;
}
I can compile and link this just fine, and if I remove the CL_DisplayWindow it runs through, ofc since it doesn't do anything hehe.
I get this error though if I include displaywindow:
You need to create a display target first.
Any idea what's up here? I've checked countless examples and the display overview among others. The code checks out afaik. Oh, and I've tried using the dipslaywindow constructor as well, to no avail.
Thanks.