The following code listing is the minimum program you can do with libpxl. It's a good starting point to test if libpxl is well installed and setup in your development environment. If the compiling and linking of this program went well, you should have a simple black window, meaning that libpxl has correctly iniatialized and it is running.
#!c
#include <PXL/pxl.h>
int main( int argc, char* argv[] )
{
pxl::init( argc, argv );
pxl::loop();
pxl::quit();
return 0;
}
On the first line is the inclusion on the libpxl header, that's all you need to use it.
On line 3, libpxl is initialized. Note that the init function requires the main arguments to be passed in. The main arguments has used to pass some commands to libpxl, for example for debugging.
The line 6, is the main loop. This is where your application is running most of the time.
The line 7 is reached when the application ends. The quit function has the task of freeing the ressources before the program exits.
The line 9 is the standard return to signal the operating system that the programmed ended correctly without any error.