mycolorpalettewnd.h
资源名称:gloop.zip [点击查看]
上传用户:shxiangxiu
上传日期:2007-01-03
资源大小:1101k
文件大小:8k
源码类别:
OpenGL
开发平台:
Visual C++
- /////////////////////////////////////////////////////////////////////////////
- // MyColorPaletteWnd.h : Header file; Defines the class definitions
- //
- // glOOP (OpenGL Object Oriented Programming library)
- // Copyright (c) Craig Fahrnbach 1997, 1999
- //
- // OpenGL is a registered trademark of Silicon Graphics
- //
- //
- // This program is provided for educational and personal use only and
- // is provided without guarantee or warrantee expressed or implied.
- //
- // Commercial use is strickly prohibited without written permission
- // from ImageWare Development.
- //
- // This program is -not- in the public domain.
- //
- /////////////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////////////
- // Global definitions
- #define WM_CPW_LBUTTONDOWN WM_USER+20
- #define WM_CPW_RBUTTONDOWN WM_USER+21
- class CEditColorsDlg;
- /////////////////////////////////////////////////////////////////////////////
- // CMyglWnd class
- class AFX_EXT_CLASS CMyglWnd : public CWnd
- {
- DECLARE_DYNCREATE(CMyglWnd)
- // Operations
- public:
- // public constructor used by dynamic creation
- CMyglWnd();
- virtual ~CMyglWnd();
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CMyglWnd)
- public:
- virtual BOOL Create(DWORD dwExStyle, LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext);
- protected:
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- //}}AFX_VIRTUAL
- // Attributes
- public:
- protected:
- C3dCamera m_Camera; // Our windows camera
- CClientDC* m_pDC; // Pointer to our Device Context
- HGLRC m_hRC; // Handle to our Rendering Context
- // Implementation
- protected:
- // Generated message map functions
- //{{AFX_MSG(CMyglWnd)
- afx_msg BOOL OnEraseBkgnd(CDC* pDC);
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnPaletteChanged(CWnd* pFocusWnd);
- afx_msg BOOL OnQueryNewPalette();
- afx_msg void OnDestroy();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- /////////////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////////////
- class AFX_EXT_CLASS CMyColorPaletteWnd : public CMyglWnd
- {
- DECLARE_DYNCREATE(CMyColorPaletteWnd)
- // Operations
- public:
- // public constructor used by dynamic creation
- CMyColorPaletteWnd();
- virtual ~CMyColorPaletteWnd();
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CMyColorPaletteWnd)
- public:
- virtual BOOL Create(DWORD dwExStyle, LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
- //}}AFX_VIRTUAL
- // Attributes
- public:
- GLfloat m_fRed; // User selected Red color component
- GLfloat m_fGrn; // User selected Green color component
- GLfloat m_fBlu; // User selected Blue color component
- protected:
- // Implementation
- protected:
- GLfloat Normal360(GLfloat fSource);
- void RenderColorCube();
- // Generated message map functions
- //{{AFX_MSG(CMyColorPaletteWnd)
- afx_msg void OnPaint();
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
- afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
- afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
- afx_msg void OnDestroy();
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg BOOL OnQueryNewPalette();
- afx_msg void OnPaletteChanged(CWnd* pFocusWnd);
- afx_msg BOOL OnEraseBkgnd(CDC* pDC);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- /////////////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////////////
- class AFX_EXT_CLASS CMyMaterialWnd : public CMyglWnd
- {
- DECLARE_DYNCREATE(CMyMaterialWnd)
- // Operations
- public:
- // public constructor used by dynamic creation
- CMyMaterialWnd();
- virtual ~CMyMaterialWnd();
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CMyMaterialWnd)
- public:
- virtual BOOL Create(DWORD dwExStyle, LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
- //}}AFX_VIRTUAL
- // Attributes
- public:
- C3dMaterial* m_pMaterial; // Our objects' material
- GLUquadricObj* m_pQuad;
- protected:
- // Implementation
- protected:
- void RenderMaterial();
- // Generated message map functions
- //{{AFX_MSG(CMyMaterialWnd)
- afx_msg void OnPaint();
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnDestroy();
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnPaletteChanged(CWnd* pFocusWnd);
- afx_msg BOOL OnQueryNewPalette();
- afx_msg BOOL OnEraseBkgnd(CDC* pDC);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- /////////////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////////////
- class AFX_EXT_CLASS CMyTerrainWnd : public CMyglWnd
- {
- DECLARE_DYNCREATE(CMyTerrainWnd)
- // Operations
- public:
- // public constructor used by dynamic creation
- CMyTerrainWnd();
- virtual ~CMyTerrainWnd();
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CMyTerrainWnd)
- public:
- virtual BOOL Create(DWORD dwExStyle, LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
- //}}AFX_VIRTUAL
- // Attributes
- public:
- C3dObjectTerrain* m_pTerrainObject; // Our terrain preview object
- protected:
- // Implementation
- protected:
- void RenderPreviewWnd();
- // Generated message map functions
- //{{AFX_MSG(CMyTerrainWnd)
- afx_msg void OnPaint();
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnDestroy();
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnPaletteChanged(CWnd* pFocusWnd);
- afx_msg BOOL OnQueryNewPalette();
- afx_msg BOOL OnEraseBkgnd(CDC* pDC);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- /////////////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////////////
- class AFX_EXT_CLASS CMyCloudWnd : public CMyglWnd
- {
- DECLARE_DYNCREATE(CMyCloudWnd)
- // Operations
- public:
- // public constructor used by dynamic creation
- CMyCloudWnd();
- virtual ~CMyCloudWnd();
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CMyCloudWnd)
- public:
- virtual BOOL Create(DWORD dwExStyle, LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
- //}}AFX_VIRTUAL
- // Attributes
- public:
- C3dObjectCloud* m_pCloudObject; // Our cloud preview object
- protected:
- // Implementation
- protected:
- void RenderPreviewWnd();
- // Generated message map functions
- //{{AFX_MSG(CMyCloudWnd)
- afx_msg void OnPaint();
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnDestroy();
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnPaletteChanged(CWnd* pFocusWnd);
- afx_msg BOOL OnQueryNewPalette();
- afx_msg BOOL OnEraseBkgnd(CDC* pDC);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- /////////////////////////////////////////////////////////////////////////////