rubber.h 2.44 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*
 *  GEM - Graphics Environment for Multimedia
 *
 *  rubber.h
 *  gem_darwin
 *
 *  Created by Jamie Tittle on Sun Jan 19 2003.
 *  Copyright (c) 2003 tigital. All rights reserved.
 *    For information on usage and redistribution, and for a DISCLAIMER OF ALL
 *    WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
 *
 */
#ifndef INCLUDE_RUBBER_H_
#define INCLUDE_RUBBER_H_
dheck's avatar
dheck committed
15
16
17
18
19

// I hate Microsoft...I shouldn't have to do this!
#ifdef _WINDOWS
#include <windows.h>
#endif
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93

#ifdef MACOSX
#include <OpenGL/glu.h>
#else
#include <GL/glu.h>
#endif MACOSX

#include "Base/GemShape.h"

/*-----------------------------------------------------------------
-------------------------------------------------------------------
CLASS
    rubber
    
    based on the SGI demo distort

KEYWORDS
    geo
    
DESCRIPTION

-----------------------------------------------------------------*/
class GEM_EXTERN rubber : public GemShape
{
  CPPEXTERN_HEADER(rubber, GemShape)

    public:

  //////////
  // Constructor
  rubber( t_floatarg width, t_floatarg height);
    	
 protected:
    	
  //////////
  // Destructor
  virtual ~rubber();

  //////////
  // The height of the object
  short		size, ctrX, ctrY;
  void	    	heightMess(float height);
  void		ctrXMess(float center);
  void		ctrYMess(float center);
  //void		otherMess(float other);        
  //////////
  // Do the rendering
  virtual void 	render(GemState *state);
  
    	//////////
    	// How the object should be drawn
    	virtual void	typeMess(t_symbol *type);
        
        virtual void	rubber_init();
        virtual void	rubber_dynamics();
        virtual void	rubber_bang();
        virtual int	rubber_grab();
		
    	//////////
    	// The height of the object
        GLfloat	    	m_height;

        //////////
        // The height inlet
        t_inlet         *m_inletH;
        t_inlet		*inletcX;
        t_inlet		*inletcY;
        //t_inlet		*inletOt;
  
  //////////
  // Stuff
  
    int 	m_size;
    int		m_speed;
tigital's avatar
tigital committed
94
    int		m_blend;
95
96
97
98
99
100
101
102
103
104
105
106
    int		alreadyInit;
    float	xsize, ysize;
    int		win_size_x, win_size_y;
    
 private:

  //////////
  // static member functions
  static void	bangMessCallback(void *data);
  static void 	heightMessCallback(void *data, t_floatarg height);
  static void 	ctrXMessCallback(void *data, t_floatarg center);
  static void 	ctrYMessCallback(void *data, t_floatarg center);
tigital's avatar
tigital committed
107
  static void 	blendMessCallback(void *data, t_floatarg size);
108
109
110
};

#endif	// for header file