/*FILE HEADER**************************************************************
 *
 *  File name		: $Id$
 *  RCS Revision Number	: $Revision: 1.1 $
 *  Last Modified	: $Date: 94/10/28 09:23:34 $
 *  CSCI name		: Real-Time Graphics System - Applications Interface
 *  CSC name		: All functions
 *  Notes:
 *      This file contains code used to debug and test the SVME-770 RTGS.
 *      This code is provided as an example of how to call the RTGS functions
 *      from a host application.
 *  History		:
 *      Created 94/01/17 by Jeff Sanderson
 *
 *END FILE HEADER*********************************************************/

#include "dy4std.h"
#include "es.h"
#include "css.h"

#include "rtgs_ai.h"
#include "video.h"
#include "colours.h"

#include "test.h"


void test_scale( void );
/*-----------------------------------------------------------------------*/

void test_scale( void )
{

    init( "Scale and offset test" );

    Set_foreground_colour( BLACK );
    Draw_filled_rectangle( 0x10, 0x20, 0x30, 0x40 );
    Set_foreground_colour( RED );
    Draw_line( 0x10, 0x20, 0x30, 0x40 );
    Key_wait();

    Printf("2*x 3*y, offx= 0, offy = 0, tx = 0, ty = 0 \n");
    Set_scale_and_offset((uint32)0x00020000, (uint32)0x00030000, 0, 0, 0, 0);
    Set_foreground_colour( BLACK );
    Draw_filled_rectangle( 0x10, 0x20, 0x30, 0x40 );
    Set_foreground_colour( GREEN );
    Draw_line( 0x10, 0x20, 0x30, 0x40 );
    Key_wait();

    Printf("3*x 2*y, offx= 0x30, offy = 0x40, tx = 0, ty = 0 \n");
    Set_scale_and_offset((uint32)0x00030000, (uint32)0x00020000, 
                         0x30, 0x40, 0, 0);
    Set_foreground_colour( BLACK );
    Draw_filled_rectangle( 0x10, 0x20, 0x30, 0x40 );
    Set_foreground_colour( BLUE );
    Draw_line( 0x10, 0x20, 0x30, 0x40 );
    Key_wait();

    Printf("1*x 1*y, offx= 0x30, offy = 0x40, tx = 0, ty = 0 \n");
    Set_scale_and_offset((uint32)0x00010000, (uint32)0x00010000, 
                         0x30, 0x40, 0, 0);
    Set_foreground_colour( BLACK );
    Draw_filled_rectangle( 0x10, 0x20, 0x30, 0x40 );
    Set_foreground_colour( CYAN );
    Draw_line( 0x10, 0x20, 0x30, 0x40 );
    Key_wait();

    Printf("1*x 1*y, offx= 0, offy = 0, tx = 0x40, ty = 0x30 \n");
    Set_scale_and_offset((uint32)0x00010000, (uint32)0x00010000, 
                         0, 0, 0x40, 0x30);
    Set_foreground_colour( BLACK );
    Draw_filled_rectangle( 0x10, 0x20, 0x30, 0x40 );
    Set_foreground_colour( MAGENTA );
    Draw_line( 0x10, 0x20, 0x30, 0x40 );
    Key_wait();
}

/*-----------------------------------------------------------------------*/
