
separate( sokerban )


procedure getMouseInputs( 
	mainWin : access GLFWwindow; 
	--Wwid,Whit: gldouble;
	change: out boolean) is
	use interfaces.c;
	use type interfaces.c.double;

	xpos,ypos : aliased interfaces.c.double;

	--msr,
	msl : glint;

	--currentTime, dt: float;

begin
	change:=false;

	glfwgetcursorpos(mainWin,xpos'access,ypos'access);
	--msr := glfwGetMouseButton(mainWin, glfw_mouse_button_2); -- ?3?
	msl := glfwGetMouseButton(mainWin, glfw_mouse_button_1);

	if msl=glfw_press then
		change:=true;
		if dragging then
			--roty:=0.2*float(xpos-xold);
			--rotx:=0.002*float(ypos-yold);
			vertAng := vertAng + 0.002*float(ypos-yold);
			xold:=xpos;
			yold:=ypos;
		else --not dragging yet
			dragging:=true;
			xold:=xpos;
			yold:=ypos;
		end if;

	elsif msl=glfw_release then
		change:=true;
		dragging:=false;
	end if;

	--23mar21 this interferes w/ rt.click to disable highlight
	--see getmouseclick...
	--currentTime:=float(glfwGetTime);
	--dt := currentTime-oldTimeMs;
	--if (msr=glfw_press) and (dt>btndlay) then
	--	change:=true;
	--	oldTimeMs:=currentTime;

		--restore default view
	--	vertang:=cvertang;
	--	eyepos:=ceyepos;

	--elsif msr=glfw_release then
	--	null;

	--end if;

end getMouseInputs;


