00001 #pragma once 00002 #include "afxwin.h" 00003 #include <gl/gl.h> 00004 #include <gl/glu.h> 00005 #include "types.h" 00006 #include "functions.h" 00007 00008 class COpenGLControl : public CWnd 00009 { 00010 public: 00011 UINT_PTR m_unpTimer; 00012 00013 COpenGLControl(void); 00014 ~COpenGLControl(void); 00015 BOOL PreCreateWindow(CREATESTRUCT &cs); 00016 void oglCreate(CRect rect, CWnd *parent); 00017 void oglInitialize(void); 00018 void oglDrawScene(void); 00019 void SetFlag_ShowBoundingBox(BOOL _bShowBB); 00020 void SetFlag_OutlineVertices(BOOL _bVOutline); 00021 void SetFlag_ShowMesh(BOOL _bShowMesh); 00022 00023 void SetRotation(float _fRotation[3]); 00024 void GetRotation(float _fRotation[3]); 00025 00026 void SetZoom(float _fZoom); 00027 float GetZoom(void); 00028 00029 void ResetModel(); 00030 00031 afx_msg void OnDraw(CDC *pDC); 00032 00033 model_t *m_Model; 00034 00035 void StoreKeyframe(char * _lpcstrKeyframeName); 00036 void InsertBoneToKeyframe(keyframe_t *Keyframe, bone_t *Root); 00037 00038 void Play(); 00039 00040 private: 00041 CWnd *hWnd; 00042 HDC hdc; 00043 HGLRC hrc; 00044 int m_nPixelFormat; 00045 CRect m_rect; 00046 CRect m_oldWindow; 00047 CRect m_originalRect; 00048 float m_fZoom; 00049 BOOL m_bShowBB; 00050 BOOL m_bOutlineVertices; 00051 BOOL m_bShowMesh; 00052 00053 float m_fRotation[3]; 00054 float m_fLastMousePos[2]; 00055 00056 keyframelibrary_t *m_KeyframeLibrary; 00057 animationlibrary_t *m_AnimationLibrary; 00058 int m_iCurrentAnimation; 00059 00060 bool m_bIsPlaying; 00061 float dt; 00062 00063 public: 00064 DECLARE_MESSAGE_MAP() 00065 afx_msg void OnPaint(); 00066 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 00067 afx_msg void OnSize(UINT nType, int cx, int cy); 00068 afx_msg void OnTimer(UINT_PTR nIDEvent); 00069 afx_msg void OnMouseMove(UINT nFlags, CPoint point); 00070 afx_msg void OnLButtonDown(UINT nFlags, CPoint point); 00071 afx_msg void OnRButtonDown(UINT nFlags, CPoint point); 00072 };