![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2007 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: DtOsgWindow.h,v $ $Revision: 1.24 $ $State: Exp $ 00007 ******************************************************************************/ 00008 00012 00013 #ifndef DtOsgWindow_H_ 00014 #define DtOsgWindow_H_ 00015 00016 #include <vrvOsg/vrvOsg.h> 00017 #include <vrvCore/DtWindow.h> 00018 #include <osg/ref_ptr> 00019 #include <osg/GraphicsContext> 00020 #include <vrvUtil/DtWindowConfiguration.h> 00021 00022 namespace osgViewer 00023 { 00024 class GraphicsWindow; 00025 } 00026 00027 namespace makVrv 00028 { 00029 00033 class DT_DLL_VRVOSG DtOsgWindow : public DtWindow 00034 { 00035 public: 00036 00038 virtual ~DtOsgWindow(); 00039 00041 virtual osg::GraphicsContext* graphicsContext(); 00042 00044 virtual bool isValid() const; 00045 00049 virtual void sizeChanged(int width,int height); 00050 00052 static osg::GraphicsContext::Traits* createDefaultTraits(); 00053 00054 void adjustPerspective(); 00055 00057 virtual void clearEmptyWindow(); 00058 00059 protected: 00060 00062 DtOsgWindow(DtDe& de, DtWindowConfiguration& wc); 00063 00068 virtual void renderText(int x, int y, const std::string& text); 00069 00070 protected: 00071 00072 osg::ref_ptr<osg::GraphicsContext> myContext; 00073 00074 }; 00075 00076 00078 struct DT_DLL_VRVOSG DtOsgWindowResizeCallback : public osg::GraphicsContext::ResizedCallback 00079 { 00081 DtOsgWindowResizeCallback(DtOsgWindow* parent); 00082 00084 virtual ~DtOsgWindowResizeCallback(); 00085 00087 virtual void resizedImplementation(osg::GraphicsContext* gc, int x, int y, int width, int height); 00088 00089 protected: 00090 DtOsgWindow* myParent; 00091 00092 }; 00093 } 00094 00095 #endif 00096