// Lighting03View.h : interface of the CLighting03View class // ///////////////////////////////////////////////////////////////////////////// #include <gl\gl.h> #include <gl\glu.h> enum {Cube, Sphere}; #if !defined(AFX_LIGHTING03VIEW_H__1F4D4EAC_75A6_11D7_B5B9_00106090150C__INCLUDED_) #define AFX_LIGHTING03VIEW_H__1F4D4EAC_75A6_11D7_B5B9_00106090150C__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 class CLighting03View : public CView { protected: // create from serialization only CLighting03View(); DECLARE_DYNCREATE(CLighting03View) // Attributes public: CLighting03Doc* GetDocument(); protected: HGLRC m_hRC; GLfloat m_materialAmbient[4]; GLfloat m_materialSpecular[4]; GLfloat m_materialEmitted[4]; GLfloat m_ambientLight0[4]; GLfloat m_diffuseLight0[4]; GLfloat m_specularLight0[4]; GLfloat m_positionLight0[4]; GLfloat m_shininess; UINT m_currentObject; // Operations public: // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CLighting03View) public: virtual void OnDraw(CDC* pDC); // overridden to draw this view virtual BOOL PreCreateWindow(CREATESTRUCT& cs); protected: //}}AFX_VIRTUAL // Implementation public: virtual ~CLighting03View(); #ifdef _DEBUG virtual void AssertValid() const; virtual void Dump(CDumpContext& dc) const; #endif protected: // Generated message map functions protected: void CalcNormal(double *p1,double *p2, double *p3, double *n); void DrawSphere(); void DrawCube(); void DrawWithOpenGL(); //{{AFX_MSG(CLighting03View) afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg void OnDestroy(); afx_msg void OnSize(UINT nType, int cx, int cy); afx_msg void OnObjectCube(); afx_msg void OnObjectSphere(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; #ifndef _DEBUG // debug version in Lighting03View.cpp inline CLighting03Doc* CLighting03View::GetDocument() { return (CLighting03Doc*)m_pDocument; } #endif ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_LIGHTING03VIEW_H__1F4D4EAC_75A6_11D7_B5B9_00106090150C__INCLUDED_)