summaryrefslogtreecommitdiff
path: root/common/preview.h
blob: e60a2be4cd51d3a09da26acf85a0124a4fbb59a6 (plain)
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
#ifndef _PREVIEW_H_
#define _PREVIEW_H_

#include "glwindow.h"

class PieceInfo;

class PiecePreview : public GLWindow
{
public:
	PiecePreview(GLWindow *share);
	virtual ~PiecePreview();

	void OnDraw();
  void OnLeftButtonDown(int x, int y, bool Control, bool Shift);
  void OnLeftButtonUp(int x, int y, bool Control, bool Shift);
  void OnLeftButtonDoubleClick(int x, int y, bool Control, bool Shift);
  void OnRightButtonDown(int x, int y, bool Control, bool Shift);
  void OnRightButtonUp(int x, int y, bool Control, bool Shift);
  void OnMouseMove(int x, int y, bool Control, bool Shift);

	PieceInfo* GetCurrentPiece() const
	{ return m_PieceInfo; }
	void SetCurrentPiece(PieceInfo* Info);

protected:
	PieceInfo* m_PieceInfo;

	// Mouse tracking.
	int m_Tracking;
	int m_DownX;
	int m_DownY;

	// Current camera settings.
	float m_Distance;
	float m_RotateX;
	float m_RotateZ;
	bool m_AutoZoom;
};

#endif // _PREVIEW_H_