/*************************************************************************
** uiInteractionCallbacks.cpp                                           **
** --------------------------                                           **
**                                                                      **
** I envision this source file containing all the basic window event    **
**    related callbacks for this demo.  These might include reshape,    **
**    mouse click, mouse move, key press, hide, show, mouse enter,      **
**    mouse exit, and idle events.                                      **
**                                                                      **
** These are not specific to any display mode (though IGLU may one day  **
**    allow specific callbacks depending on the selected display mode)  **
**                                                                      **
** Chris Wyman (04/06/2012)                                             **
*************************************************************************/

#include "projectIncludes.h"

// A global data structure containing all shared data for this program
extern RenderingData *data;


// A window callback that tracks changes when the mouse moves 
void MouseMotion( int x, int y )
{
	data->ui->ball->UpdateOnMotion(x, y);
}

// When the user clicks/releases in the main window, start/stop tracking with our trackball
void MouseButton( int button, int state, int x, int y )
{
	if(IGLU_EVENT_DOWN == state)
		data->ui->ball->SetOnClick( x, y );
	else
		data->ui->ball->Release();
}


