

#include <GL/glut.h>
#include "stdheader.h"

#include <stdio.h>

int g_nDepth=0;
int g_nLastDepth=0;
int g_nDiff=0;
int g_nLastX=0, g_nLastY=0;

void mouseEvent(int button, int state, int x, int y)
{
	if(button==GLUT_LEFT_BUTTON)
	{
		if(state ==  GLUT_DOWN)
		{
			g_nLastX = x;
			g_nLastY = y;
		}	
		else
		{
			g_nLastDepth = g_nDepth;
		}
	}
}

void mouseActiveMotion(int x, int y)
{	
	g_nDiff= y - g_nLastY;

	g_nDepth = g_nLastDepth + g_nDiff;	

}
