File indexing completed on 2025-01-18 10:04:36
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef OpenGl_Window_HeaderFile
0017 #define OpenGl_Window_HeaderFile
0018
0019 #include <Aspect_RenderingContext.hxx>
0020 #include <Aspect_Window.hxx>
0021 #include <OpenGl_GlCore11.hxx>
0022 #include <OpenGl_Caps.hxx>
0023 #include <Standard_Transient.hxx>
0024
0025 #if defined(__APPLE__)
0026 #import <TargetConditionals.h>
0027 #endif
0028
0029 #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
0030 #ifdef __OBJC__
0031 @class UIView;
0032 #else
0033 struct UIView;
0034 #endif
0035 #endif
0036
0037 class OpenGl_Context;
0038 class OpenGl_GraphicDriver;
0039
0040 DEFINE_STANDARD_HANDLE(OpenGl_Window,Standard_Transient)
0041
0042
0043
0044 class OpenGl_Window : public Standard_Transient
0045 {
0046 DEFINE_STANDARD_RTTIEXT(OpenGl_Window, Standard_Transient)
0047 public:
0048
0049
0050 Standard_EXPORT OpenGl_Window();
0051
0052
0053
0054 Standard_EXPORT void Init (const Handle(OpenGl_GraphicDriver)& theDriver,
0055 const Handle(Aspect_Window)& thePlatformWindow,
0056 const Handle(Aspect_Window)& theSizeWindow,
0057 Aspect_RenderingContext theGContext,
0058 const Handle(OpenGl_Caps)& theCaps,
0059 const Handle(OpenGl_Context)& theShareCtx);
0060
0061
0062 Standard_EXPORT virtual ~OpenGl_Window();
0063
0064
0065 Standard_EXPORT virtual void Resize();
0066
0067
0068 const Handle(Aspect_Window)& PlatformWindow() { return myPlatformWindow; }
0069
0070
0071 const Handle(Aspect_Window)& SizeWindow() { return mySizeWindow; }
0072
0073 Standard_Integer Width() const { return mySize.x(); }
0074 Standard_Integer Height() const { return mySize.y(); }
0075
0076
0077 const Handle(OpenGl_Context)& GetGlContext() const { return myGlContext; }
0078
0079
0080 Standard_EXPORT virtual Standard_Boolean Activate();
0081
0082
0083 Standard_EXPORT void SetSwapInterval (Standard_Boolean theToForceNoSync);
0084
0085 protected:
0086
0087
0088 Standard_EXPORT void init();
0089
0090 protected:
0091
0092 Handle(OpenGl_Context) myGlContext;
0093 Standard_Boolean myOwnGContext;
0094 Handle(Aspect_Window) myPlatformWindow;
0095 Handle(Aspect_Window) mySizeWindow;
0096 #if defined(__APPLE__)
0097 #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
0098 UIView* myUIView;
0099 #endif
0100 Graphic3d_Vec2i mySizePt;
0101 #endif
0102 Graphic3d_Vec2i mySize;
0103
0104 Standard_Integer mySwapInterval;
0105
0106 };
0107
0108 #endif