source: golgotha/src/maxtool/pan.cc

Last change on this file was 80, checked in by Sam Hocevar, 11 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 1.3 KB
Line 
1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9#include "lisp/li_init.hh"
10#include "m1_info.hh"
11#include "max_object.hh"
12#include "render.hh"
13#include "math/pi.hh"
14
15class m1_pan_state_class : public m1_utility_state_class
16{
17public:
18  virtual i4_bool mouse_drag()
19  {
20    i4_float p_x = i4_float(last_x() - mouse_x())/width();
21    i4_float p_y = i4_float(last_y() - mouse_y())/height();
22   
23    m1_render_window->pan(p_x,p_y);
24    m1_render_window->recalc_view();
25
26    return i4_T;
27  }
28
29  virtual i4_bool mouse_up()
30  {
31    m1_render_window->restore_state();
32    return i4_T;
33  }
34};
35
36static m1_pan_state_class pan;
37
38li_object *m1_pan(li_object *o, li_environment *env)
39//{{{
40{
41  m1_render_window->set_state(&pan);
42  return 0;
43}
44//}}}
45
46li_automatic_add_function(m1_pan, "pan");
47
48//{{{ Emacs Locals
49// Local Variables:
50// folded-file: t
51// End:
52//}}}
Note: See TracBrowser for help on using the repository browser.