-
Notifications
You must be signed in to change notification settings - Fork 2
/
CPWidgetRen-old.h
89 lines (68 loc) · 1.75 KB
/
CPWidgetRen-old.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
//-------------------------------------------------------------------------
//
// Joe Kniss
// Cliping Plane widget
// CPWidgetRen.h Handles an arbitrary Clipping Plane
// 3-14-01
// ________ ____ ___
// | \ / | / /
// +---+ \/ |/ /
// +--+| |\ /| <
// | || | \ / | |\ \
// | | \/ | | \ \
// \_____| |__| \__\
// Copyright 2001
// Joe Michael Kniss
// "All Your Base are Belong to Us"
//-------------------------------------------------------------------------
#ifndef __CPWIDGETREN_DOT_H
#define __CPWIDGETREN_DOT_H
#include "gluvvPrimitive.h"
#include "BaseWidget.h"
#include <GL/gl.h>
#include <GL/glu.h>
#include "Trackball.h"
struct gluvvGlobal;
class CPWidgetRen : public gluvvPrimitive, public Widget
{
public:
CPWidgetRen();
~CPWidgetRen();
void draw();
int pick(int data1, int data2, int data3,
float x, float y, float z);
int pick();
int key(unsigned char key, int x, int y);
int mouse(int button, int state,
int x, int y);
int move(int x, int y);
int release();
int CPWidgetRenGlErr(char *c);
private:
void draw_widget();
void set_info();
void update_pos();
void mouse2plane(int x, int y);
enum{
cpObjectUnknown,
cpbar,
cpball,
alphaslide,
plane,
};
float pos[3];
float vpos[3];
float xform[16];
float mousepnt[3];
int lastwinpos[3];
int pickedObj;
float width;
float screenwidth;
float height;
float screenheight;
float screenbar;
float screenball;
float aslider;
Trackball tball;
};
#endif