/*FILE HEADER**************************************************************
 *
 *  File name		: $Id$
 *  RCS Revision Number	: $Revision: 1.1 $
 *  Last Modified	: $Date: 94/10/28 09:23:33 $
 *  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_newfifo( void );
/*-----------------------------------------------------------------------*/


void test_newfifo( void )
{
    fifo_t *fifo;

    init( "Create fifo test" );
    
    fifo = ( fifo_t * )Gcc_malloc( sizeof( fifo_t ), 0 );
    malloc_check( fifo );

    Set_current_fifo( DEFAULT_FIFO ); /* adding to default */
    Create_fifo( fifo );
    Key_wait();

    Set_foreground_colour( RED );
    Draw_filled_rectangle( 20, 20, 200, 200 );
    Printf("Should be a red rectangle on the screen\n");
    Key_wait();

    Release_fifo(); /* reading from new fifo */
    Set_current_fifo( fifo ); /* adding to new fifo */
    Set_foreground_colour( CYAN );
    Draw_filled_rectangle( 20, 20, 200, 200 );
    Printf("should be a cyan rectangle\n");
    Key_wait();

    Release_fifo(); /* reading from default fifo */
    Set_current_fifo( DEFAULT_FIFO ); /* adding to default */

    Set_foreground_colour( BLUE );
    Draw_filled_rectangle( 20, 20, 200, 200 );
    Printf("should be a blue rectangle\n");

    Key_wait();
}
