The following program doesn't work:
#include <grx20.h> #include <grxkeys.h>
#include <stdio.h>
int GRXMain( int argc, char **argv ) { int x, y; int maxX, maxY;
GrColor color; GrContext *context;
GrSetMode( GR_biggest_graphics ); GrSetRGBcolorMode(); GrClearScreen( GrBlack() );
maxX = GrScreenX(); maxY = GrScreenY();
printf("%d %d\n", maxX, maxY );
context = GrCreateContext( maxX, maxY, 0, 0 ); if ( context == 0 ) { printf("Error creating context\n"); exit(0); }
GrSetContext( context );
color = GrAllocCell();
for( y=0; y<maxY; y++ ) { for( x=0; x<maxX; x++ ) { GrSetColor( color, x, y, 0 ); GrPlot( x, y, color ); } }
GrBitBlt( 0, 0, 0, context, 0, 0 ,maxX, maxY, GrWRITE ); GrDestroyContext( context ); GrFreeColor( color ); GrKeyRead(); return 0; }
Please tell me why?