VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MFCClasses.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2026 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 #ifndef MFCClasses_H
6 #define MFCClasses_H
7 
8 #include <afxwin.h>
9 #include <GL/GL.h>
10 #include <osg/GraphicsContext>
11 #include <osgViewer/GraphicsWindow>
12 #include <vlutil/vlPerformanceStats.h>
13 #include <vrvCore/DtDe.h>
14 #include <vrvCore/DtDeMainWindow.h>
15 #include <vrvCore/DtWindow.h>
17 #include <vrvOsg/DtOsgWindow.h>
18 #include <vrvOsg/vrvOsg.h>
19 
20 namespace makVrv
21 {
22  class DtDeSplashScreen;
23 }
24 
27 {
28 public:
30 
31  //DtDeMainWindow Interface
33  virtual void setApplicationTitle(const std::string& appName);
34 
36  virtual std::string DtMfcMainWindow::applicationTitle() const;
37 
39  virtual void setApplicationIcon(const std::string& iconName);
40 
42  virtual void setShowQuitDialogOnClose(bool value);
43 
45  virtual void destroyWindow();
46 
48  virtual void setSplashScreen(makVrv::DtDeSplashScreen* splashScreen);
49 
54  virtual void setStatusBarVisible(bool visible);
55 
60  virtual bool isStatusBarVisible() const;
61 
64  virtual void showBasedOnSettings();
65 
67  virtual void quit();
68 
69 protected:
71 
72 };
73 
75 
78 {
79 public:
82 
84  virtual ~DtEmbeddedMfcOsgWindow();
85 
87  virtual bool isValid() const;
88 
90  virtual void setPosition(int x,int y);
91 
93  virtual void resize(int width,int height);
94 
98  virtual void sizeChanged(int width,int height);
99 
100  //Create the OpenGL Window
101  void oglCreate(CRect rect, CWnd *parent);
102 
104  void oglInitialize(bool doubleBuffer, bool stereo, unsigned int colorBits,
105  unsigned int depthBits, unsigned int stencilBits, bool vsync);
106 
107  bool isRealizedImplementation() const;
108 
110  void oglClose();
111 
113  bool makeCurrent();
114 
116  bool release();
117 
119  void swapBuffers();
120 
122  void setVSync(bool enabled);
123 
124  // Added message classes:
125  afx_msg void OnPaint();
126  afx_msg void OnSize(UINT nType, int cx, int cy);
127  afx_msg void OnDraw(CDC *pDC);
128  afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
129  afx_msg void OnMouseMove(UINT nFlags, CPoint point);
130  afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
131  afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
132  afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
133  afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
134  afx_msg void OnMButtonDown(UINT nFlags, CPoint point);
135  afx_msg void OnMButtonUp(UINT nFlags, CPoint point);
136 
137  DECLARE_MESSAGE_MAP()
138 
139 private:
140 
143  HDC myHDC;
144  HGLRC myHGLRC;
146 
147 };
148 
151 {
152 public:
153 
155  virtual makVrv::DtWindow* create(makVrv::DtDe& de,
157 };
158 
159 
161 class DtMfcControlAsOsgContext : public osgViewer::GraphicsWindowEmbedded
162 {
163 public:
164 
166  DtEmbeddedMfcOsgWindow* wnd, osg::GraphicsContext::Traits* traits);
167 
168  virtual bool valid() const;
169  virtual bool realizeImplementation();
170  virtual bool isRealizedImplementation() const;
171  virtual void closeImplementation();
172  virtual void grabFocus();
173  virtual void grabFocusIfPointerInWindow();
174  virtual bool makeCurrentImplementation();
175  virtual bool releaseContextImplementation();
176  virtual void swapBuffersImplementation();
177  virtual void requestWarpPointer( float x, float y );
178  virtual void useCursor( bool onOff );
179 
180 protected:
183 };
184 
187 {
188 public:
189 
192 
193 protected:
194 
197 };
198 
199 
200 #endif
int myPixelFormat
Definition: MFCClasses.h:145
virtual void destroyWindow()
Destroy the window.
afx_msg void OnMButtonDown(UINT nFlags, CPoint point)
Abstract Base class.
Definition: DtWindow.h:25
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct)
void oglCreate(CRect rect, CWnd *parent)
A creator class for DtWindow instances.
Definition: DtWindow.h:130
afx_msg void OnDraw(CDC *pDC)
Provides a MFC Main Window.
Definition: MFCClasses.h:186
afx_msg void OnRButtonDown(UINT nFlags, CPoint point)
Simple MFC based Main Window.
Definition: MFCClasses.h:26
virtual int width() const
Get the window width.
DtMfcControlAsOsgContext * myControl
Definition: MFCClasses.h:141
Contains makVrv::DtViewFactory class.
virtual void sizeChanged(int width, int height)
Called when the size of the window has changed. This is necessary since often the window system will ...
DtDe & de()
Accessor to get the de;.
Definition: DtWindow.h:95
DtEmbeddedMfcOsgWindow(makVrv::DtDe &de, makVrv::DtWindowConfiguration &wc)
CTOR.
afx_msg void OnLButtonDown(UINT nFlags, CPoint point)
bool isRealizedImplementation() const
HGLRC myHGLRC
Definition: MFCClasses.h:144
afx_msg void OnPaint()
virtual void setStatusBarVisible(bool visible)
Shows or hides the background status bar dock widget.
virtual void setSplashScreen(makVrv::DtDeSplashScreen *splashScreen)
Not supported in this example.
virtual bool valid() const
A simple OpenGL OSG control window.
Definition: MFCClasses.h:77
afx_msg void OnSize(UINT nType, int cx, int cy)
virtual void resize(int width, int height)
Resize the window.
Creator class for making the Embedded Mfc window.
Definition: MFCClasses.h:150
afx_msg void OnRButtonUp(UINT nFlags, CPoint point)
The abstract main window provider.
Definition: DtDeMainWindow.h:84
Contains makVrv::DtDe class.
This owns a list of channel configurations.
Definition: DtWindowConfiguration.h:26
virtual bool makeCurrentImplementation()
DtMfcControlAsOsgContext(makVrv::DtDe &de, DtEmbeddedMfcOsgWindow *wnd, osg::GraphicsContext::Traits *traits)
virtual bool isValid() const
Check to see if the window is still valid.
virtual makVrv::DtDeMainWindow * createMainWindow(makVrv::DtDe &de)
Create a main window.
Contains makVrv::DtDeMainWindow class.
DtEmbeddedMfcOsgWindow * myControl
Definition: MFCClasses.h:181
afx_msg void OnMButtonUp(UINT nFlags, CPoint point)
void oglInitialize(bool doubleBuffer, bool stereo, unsigned int colorBits, unsigned int depthBits, unsigned int stencilBits, bool vsync)
Initialize the OpenGL context.
HDC myHDC
Definition: MFCClasses.h:143
virtual int height() const
Get the window height.
afx_msg void OnLButtonUp(UINT nFlags, CPoint point)
virtual bool realizeImplementation()
virtual void swapBuffersImplementation()
virtual void grabFocus()
virtual void quit()
Quit the application.
void setVSync(bool enabled)
Control this window&#39;s vsync.
Contains makVrv::DtIgView class.
virtual bool isRealizedImplementation() const
DtDe & de()
Definition: DtDeMainWindow.h:68
virtual bool isStatusBarVisible() const
Returns whether the background status bar dock widget is currently visible.
void oglClose()
Deinitialize OpenGL.
The abstract main window class.
Definition: DtDeMainWindow.h:24
virtual void closeImplementation()
virtual void grabFocusIfPointerInWindow()
void swapBuffers()
Swap this window&#39;s OpenGL buffers.
makVrv::DtDe & myDe
Definition: MFCClasses.h:182
bool release()
Release this window&#39;s context.
afx_msg void OnMouseMove(UINT nFlags, CPoint point)
virtual void showBasedOnSettings()
Show the main window based on application settings. This also handles the creation of the startup dia...
virtual void setApplicationIcon(const std::string &iconName)
Set the application&#39;s icon, typically use a resource name.
virtual void requestWarpPointer(float x, float y)
CWnd * myHWnd
Definition: MFCClasses.h:142
bool myShowQuitFlag
Definition: MFCClasses.h:70
Contains DLL export macros.
virtual void setApplicationTitle(const std::string &appName)
Set the application&#39;s name, typically for the Title Bar.
virtual void useCursor(bool onOff)
The VR-Vantage Splash Screen Interface.
Definition: DtDeSplashScreen.h:34
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
virtual std::string applicationTitle() const
Get the application&#39;s name.
Contains makVrv::DtOsgView class.
virtual ~DtEmbeddedMfcOsgWindow()
DTOR.
virtual void setPosition(int x, int y)
Set the position of the window in screen coordinates.
DtMfcMainWindowProvider(makVrv::DtDe &de)
Constructor.
virtual makVrv::DtWindow * create(makVrv::DtDe &de, makVrv::DtWindowConfiguration &config)
Create an window instance.
DtMfcMainWindow(makVrv::DtDe &de)
A basic OSG display window, used to get the osg context for a display window.
Definition: DtOsgWindow.h:36
bool makeCurrent()
Make this window&#39;s context current.
virtual bool releaseContextImplementation()
Internal class for embedding The OpenGL Qt code into OSG.
Definition: MFCClasses.h:161
virtual void setShowQuitDialogOnClose(bool value)
Set whether or not to show quit dialog on close if this is the last window.

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)