
with system;
with text_io;


package body zoomwheel is

	null_window: exception;

procedure scroll(
	addr: access GLFWwindow;
	dx  : double;
	dy  : double ) is
begin

	if abs(dy)>0.01 then
		if dy<0.0 then
			zdist:=0.99*zdist;
			if zdist<0.1 then zdist:=0.1; end if;
		else
			zdist:=1.01*zdist;
			if zdist>10.0 then zdist:=10.0; end if;
		end if;
	end if;

end scroll;


procedure enable( win: access GLFWwindow ) is
	use text_io;
	use system;
	mySFaccess : GLFWscrollfun; -- glfw3_h.ads:1239
begin

	-- must be called AFTER creating window
	mySFaccess := glfwSetScrollCallback(win, zoomwheel.scroll'access);

end enable;

end zoomwheel;
