

#include "Mode_TextureDisplay.h"
using namespace iglu;

// Our main window
extern IGLUMultiDisplayWindow::Ptr    myWin;

// The texture for this display
IGLUTexture::Ptr simple2DTexture = 0;

// A user variable to determine if we display decimal or hex values
IGLUBool flipX   ( false, "Flip texture along x-axis" );
IGLUBool flipY   ( true,  "Flip texture along y-axis" );

void TextureDisplay::Display( void )
{
	uint drawFlags = 0;
	if (flipX) drawFlags |= IGLU_DRAW_FLIP_X;
	if (flipY) drawFlags |= IGLU_DRAW_FLIP_Y;

	IGLUDraw::Fullscreen( simple2DTexture, drawFlags ); 
}

// Initialize variables and stuff needed for our texture display
void TextureDisplay::Initialize( int trackNum )
{
	// Load a texture to display
	simple2DTexture = new IGLUTexture2D( "../../CommonSampleFiles/images/voxelShadowsFairy.jpg" );

	// Add widgets to the built-in UI window.  
	myWin->AddWidget( trackNum, &flipX );
	myWin->AddWidget( trackNum, &flipY );
}


