// // Here it is, what you've all been waiting for: ClanSimple.cpp!!! // To compile, make sure that you've got clanCore.lib added for linking // and make sure that your compiler can find the directory with both that // and core.h // #include class ClanSimpleApp: public CL_ClanApplication { public: virtual char *get_title() { return "ClanSimple"; } virtual void init_modules() { CL_SetupCore::init(); // init the core stuff CL_SetupCore::init_display(); // init the display } virtual void deinit_modules() { CL_SetupCore::deinit(); // deinit core stuff CL_SetupCore::deinit_display(); // deinit the display } virtual int main(int,char **) { try { CL_Display::set_videomode(640,480,8,false); // set to 640 x 480, 8 bpp, windowed mode (in Win32, the last paramater defaults to true, in Linux and BeOS, to false) CL_Surface *surface = CL_PCXProvider::create("pic.pcx",NULL); // create a new surface using the PCX provider, use the given filename while(CL_Keyboard::get_keycode(CL_KEY_ESCAPE) == false) // run until user hits escape { surface->put_screen(0,0); // place CL_Surface surface at (0,0) CL_Display::flip_display(); // flips the front and back buffers CL_System::keep_alive(); // does a bunch of stuff. ALWAYS put this at the end of your main loop } delete surface; // don't forget to clean up } catch(CL_Error err) { std::cout << "Error: " << err.message.c_str() << std::endl; return 1; } // that's all you really need to do for exception handling with CL, unless you want to catch exceptions from your own functions return 0; } } app;