/*
             CREATOR: DAn williams
                DATE:
         DESCRIPTION: test the viewport class
            FILENAME: viewertest.cpp
             STARTED: jan 22
    OPERATING SYSTEM: Linux
1st VERSION FINISHED:

*/


#include <stdio.h>
#include <stdlib.h>

void Error( char * desc );

#include "vif.h"
#include <conio.h>

//global variables

int main(int argc, char** argv)
{

  VIF      device;
  int      row;
  char     textbuff[100];
  char     propbuff[100];
  
  device.BufferPos  ( 1, 1 );
  device.BufferText ( "1 2 3 4 5 6 7 8 9101112131415161718192021222324252627282930313234353637383940",NULL);
  device.BufferPos  ( 1, 2 );
  device.BufferText ( "Hello World", "\03\05\06\03\03\03\04\06\08\03\04" );
  
  device.BufferPos ( 1, 2 );
  device.GetBuffer ( textbuff, propbuff, 20 );
  textbuff[20] = '\0';
  device.BufferPos ( 3, 3 );
  device.BufferText (textbuff, "\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01" );
  

  for(row = 4; row < device.Height; row++) {
    device.BufferPos (1,row);
    device.BufferText ("abcdefghabcdefghabcdefghabcdefgh", "\00\01\02\03\04\05\06\07\08\09\10\11\12\13\14\15\16\17\18\19\20\21\22\23\24\25\26\27\28\29\30\130");
  }

  // printf(" buffer contains %s", device.BuffText);
    device.ReDraw();

  return ( 0 );
}


//subroutines


void Error( char * desc ){
  printf ("%s\n", desc);
  exit ( 0 );
}


