The LPATT is a very small and simple C library developed to allow CD (Canvas Draw) programmers to incorporate EdPatt patterns into their applications.
Once constructed the pattern, CD applications can read its description (.pat file) and associate a simbolic name to it. Then, future references to this pattern are automatically managed in the library.
Creation and destruction
void main ( void ) { /* System initialization. Example: IupOpen(); */ LPattNew( "1", "1.pat", "pattern.pal" ); LPattNew( "2", "2.pat", "pattern.pal" ); /* Event loops or main routine. Example: IupMainLoop(); */ LPattDelete( LPattGetHandle("1") ); LPattDelete( LPattGetHandle("2") ); }Setting patterns and drawing using CD
LPattSet( mypat ); /* mypat is a valid LPatt* */ cdInteriorStyle( CD_PATTERN ); cdBegin( CD_FILL ); cdVertex( 0, 0 ); cdVertex( 100, 0 ); cdVertex( 100, 100 ); cdVertex( 0, 100 ); cdEnd();
This work was developed at TeCGraf / PUC-Rio. Suggestions, critics and bug reports can be sent to André Clinio.