Including "ptc" will bring in the newest ANSI C++ standard interface with namespaces, and including "ptc.h" will bring all classes and typedefs into the global namespace.
ANSI C++ compilers may use the "ptc" namespace:
#include "ptc"
using ptc::Error;
using ptc::Format;
using ptc::Surface;
using ptc::Console;
int main()
{
try
{
// create format
Format format(32,0x00FF0000,0x0000FF00,0x000000FF);
// create surface
Surface surface(320,200,format);
// create console
Console console;
// open console
console.open("Example program",320,200,format);
// ...
}
catch (Error &error)
{
// report error
error.report();
}
}However, older compilers that do not support namespaces have to work in the global namespace:
#include "ptc.h"
int main()
{
try
{
// create format
Format format(32,0x00FF0000,0x0000FF00,0x000000FF);
// create surface
Surface surface(320,200,format);
// create console
Console console;
// open console
console.open("Example program",320,200,format);
// ...
}
catch (Error &error)
{
// report error
error.report();
}
}
An unsigned 8 bit value.
An unsigned 16 bit value.
An unsigned 32 bit value.