VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MFCClasses.h
Go to the documentation of this file.
1 #ifndef MFCClasses_H
2 #define MFCClasses_H
3 
4 #include <afxwin.h>
5 #include <GL/GL.h>
6 #include <osg/GraphicsContext>
7 #include <osgViewer/GraphicsWindow>
8 #include <vlutil/vlPerformanceStats.h>
9 #include <vrvCore/DtDe.h>
10 #include <vrvCore/DtDeMainWindow.h>
11 #include <vrvCore/DtWindow.h>
13 #include <vrvOsg/DtOsgWindow.h>
14 #include <vrvOsg/vrvOsg.h>
15 
18 {
19 public:
21 
22  //DtDeMainWindow Interface
24  virtual void setApplicationTitle(const std::string& appName);
25 
27  virtual std::string DtMfcMainWindow::applicationTitle() const;
28 
30  virtual void setApplicationIcon(const std::string& iconName);
31 
33  virtual void setShowQuitDialogOnClose(bool value);
34 
36  virtual void destroyWindow();
37 
39  virtual void quit();
40 
41 protected:
43 
44 };
45 
47 
50 {
51 public:
52  UINT_PTR m_unpTimer;
53 
56 
58  virtual ~DtEmbeddedMfcOsgWindow();
59 
61  virtual bool isValid() const;
62 
64  virtual void setPosition(int x,int y);
65 
67  virtual void resize(int width,int height);
68 
72  virtual void sizeChanged(int width,int height);
73 
74  //Create the OpenGL Window
75  void oglCreate(CRect rect, CWnd *parent);
76 
78  void oglInitialize(bool doubleBuffer, bool stereo, unsigned int colorBits,
79  unsigned int depthBits, unsigned int stencilBits, bool vsync);
80 
81  bool isRealizedImplementation() const;
82 
84  void oglClose();
85 
87  bool makeCurrent();
88 
90  bool release();
91 
93  void swapBuffers();
94 
96  void setVSync(bool enabled);
97 
98  // Added message classes:
99  afx_msg void OnPaint();
100  afx_msg void OnSize(UINT nType, int cx, int cy);
101  afx_msg void OnDraw(CDC *pDC);
102  afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
103  afx_msg void OnMouseMove(UINT nFlags, CPoint point);
104  afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
105  afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
106  afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
107  afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
108  afx_msg void OnMButtonDown(UINT nFlags, CPoint point);
109  afx_msg void OnMButtonUp(UINT nFlags, CPoint point);
110 
111  DECLARE_MESSAGE_MAP()
112 
113 private:
114 
117  HDC myHDC;
118  HGLRC myHGLRC;
120 
121 };
122 
124 class DtEmbeddedMfcOsgWindowCreator : public makVrv::DtWindowCreator
125 {
126 public:
127 
129  virtual makVrv::DtWindow* create(makVrv::DtDe& de,
131 };
132 
133 
135 class DtMfcControlAsOsgContext : public osgViewer::GraphicsWindowEmbedded
136 {
137 public:
138 
140  DtEmbeddedMfcOsgWindow* wnd, osg::GraphicsContext::Traits* traits);
141 
142  virtual bool valid() const;
143  virtual bool realizeImplementation();
144  virtual bool isRealizedImplementation() const;
145  virtual void closeImplementation();
146  virtual void grabFocus();
147  virtual void grabFocusIfPointerInWindow();
148  virtual bool makeCurrentImplementation();
149  virtual bool releaseContextImplementation();
150  virtual void swapBuffersImplementation();
151  virtual void requestWarpPointer( float x, float y );
152  virtual void useCursor( bool onOff );
153 
154 protected:
157 };
158 
161 {
162 public:
163 
166 
167 protected:
168 
170  virtual makVrv::DtDeMainWindow* createMainWindow(makVrv::DtDe& de);
171 };
172 
173 
174 #endif

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)