Aspect_Window - add interface methods NativeHandle() and NativeParentHandle().
OpenGl_Window - pass OpenGl_GraphicDriver instance to the constructor.
OpenGl_Caps - add option to disable buffers swap at the end of frame redraw.
uses
Background from Aspect,
+ Drawable from Aspect,
GradientBackground from Aspect,
TypeOfResize from Aspect,
FillMethod from Aspect,
---Purpose: Returns The Window SIZE in PIXEL
---Category: Inquire methods
+ NativeHandle ( me ) returns Drawable from Aspect is deferred;
+ ---Purpose: Returns native Window handle (HWND on Windows, Window with Xlib, and so on)
+
+ NativeParentHandle ( me ) returns Drawable from Aspect is deferred;
+ ---Purpose: Returns parent of native Window handle (HWND on Windows, Window with Xlib, and so on)
+
fields
MyBackground : Background from Aspect is protected;
MyGradientBackground : GradientBackground from Aspect is protected;
//! Setup new NSView.
Standard_EXPORT void SetHView (NSView* theView);
+ //! @return native Window handle
+ virtual Aspect_Drawable NativeHandle() const
+ {
+ return (Aspect_Drawable )HView();
+ }
+
+ //! @return parent of native Window handle
+ virtual Aspect_Drawable NativeParentHandle() const
+ {
+ return 0;
+ }
+
protected:
NSWindow* myHWindow;
: vboDisable (Standard_False),
pntSpritesDisable (Standard_False),
keepArrayData (Standard_False),
+ buffersNoSwap (Standard_False),
contextStereo (Standard_False),
#ifdef DEB
contextDebug (Standard_True),
vboDisable = theCopy.vboDisable;
pntSpritesDisable = theCopy.pntSpritesDisable;
keepArrayData = theCopy.keepArrayData;
+ buffersNoSwap = theCopy.buffersNoSwap;
contextStereo = theCopy.contextStereo;
contextDebug = theCopy.contextDebug;
contextNoAccel = theCopy.contextNoAccel;
public: //! @name context creation parameters
+ /**
+ * Specify that driver should not swap back/front buffers at the end of frame.
+ * Useful when OCCT Viewer is integrated into existing OpenGL rendering pipeline as part,
+ * thus swapping part is performed outside.
+ *
+ * OFF by default.
+ */
+ Standard_Boolean buffersNoSwap;
+
/**
* Request stereoscopic context (with Quad Buffer). This flag requires support in OpenGL driver.
*
#include <OpenGl_Trihedron.hxx>
#include <OpenGl_Workspace.hxx>
+#include <Aspect_GraphicDeviceDefinitionError.hxx>
+#include <Message_Messenger.hxx>
#include <OSD_Environment.hxx>
#include <Standard_NotImplemented.hxx>
-#if (!defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)))
+#if !defined(_WIN32) && !defined(__ANDROID__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
#include <X11/Xlib.h> // XOpenDisplay()
#endif
+#if defined(HAVE_EGL) || defined(__ANDROID__)
+ #include <EGL/egl.h>
+#endif
+
IMPLEMENT_STANDARD_HANDLE(OpenGl_GraphicDriver,Graphic3d_GraphicDriver)
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_GraphicDriver,Graphic3d_GraphicDriver)
// function : OpenGl_GraphicDriver
// purpose :
// =======================================================================
-OpenGl_GraphicDriver::OpenGl_GraphicDriver (const Handle(Aspect_DisplayConnection)& theDisp)
+OpenGl_GraphicDriver::OpenGl_GraphicDriver (const Handle(Aspect_DisplayConnection)& theDisp,
+ const Standard_Boolean theToStealActiveContext)
: Graphic3d_GraphicDriver (theDisp),
+#if defined(HAVE_EGL) || defined(__ANDROID__)
+ myEglDisplay ((Aspect_Display )EGL_NO_DISPLAY),
+ myEglContext ((Aspect_RenderingContext )EGL_NO_CONTEXT),
+ myEglConfig (NULL),
+#endif
myCaps (new OpenGl_Caps()),
myMapOfView (1, NCollection_BaseAllocator::CommonBaseAllocator()),
myMapOfWS (1, NCollection_BaseAllocator::CommonBaseAllocator()),
myUserDrawCallback (NULL),
myTempText (new OpenGl_Text())
{
-#if (!defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)))
+#if !defined(_WIN32) && !defined(__ANDROID__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
if (myDisplayConnection.IsNull())
{
//Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_GraphicDriver: cannot connect to X server!");
|| ::getenv ("CALL_SYNCHRO_X") != NULL;
XSynchronize (aDisplay, toSync);
+#if !defined(HAVE_EGL)
// does the server know about OpenGL & GLX?
int aDummy;
if (!XQueryExtension (aDisplay, "GLX", &aDummy, &aDummy, &aDummy))
#endif
}
#endif
+#endif
+
+#if defined(HAVE_EGL) || defined(__ANDROID__)
+ if (theToStealActiveContext)
+ {
+ myEglDisplay = (Aspect_Display )eglGetCurrentDisplay();
+ myEglContext = (Aspect_RenderingContext )eglGetCurrentContext();
+ EGLSurface aEglSurf = eglGetCurrentSurface(EGL_DRAW);
+ if ((EGLDisplay )myEglDisplay == EGL_NO_DISPLAY
+ || (EGLContext )myEglContext == EGL_NO_CONTEXT)
+ {
+ Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_GraphicDriver: no active EGL context to steal!");
+ return;
+ }
+
+ TCollection_AsciiString anEglInfo = TCollection_AsciiString()
+ + "EGL info"
+ + "\n Version: " + eglQueryString ((EGLDisplay )myEglDisplay, EGL_VERSION)
+ + "\n Vendor: " + eglQueryString ((EGLDisplay )myEglDisplay, EGL_VENDOR)
+ + "\n Client APIs: " + eglQueryString ((EGLDisplay )myEglDisplay, EGL_CLIENT_APIS)
+ + "\n Extensions: " + eglQueryString ((EGLDisplay )myEglDisplay, EGL_EXTENSIONS);
+ ::Message::DefaultMessenger()->Send (anEglInfo, Message_Info);
+
+ EGLint aCfgId = 0;
+ eglQuerySurface((EGLDisplay )myEglDisplay, aEglSurf, EGL_CONFIG_ID, &aCfgId);
+ const EGLint aConfigAttribs[] =
+ {
+ EGL_CONFIG_ID, aCfgId,
+ EGL_NONE
+ };
+
+ EGLint aNbConfigs = 0;
+ if (eglChooseConfig ((EGLDisplay )myEglDisplay, aConfigAttribs, &myEglConfig, 1, &aNbConfigs) != EGL_TRUE)
+ {
+ Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_GraphicDriver: EGL does not provide compatible configurations!");
+ }
+ return;
+ }
+
+#if !defined(_WIN32) && !defined(__ANDROID__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
+ myEglDisplay = (Aspect_Display )eglGetDisplay (aDisplay);
+#else
+ myEglDisplay = (Aspect_Display )eglGetDisplay (EGL_DEFAULT_DISPLAY);
+#endif
+ if ((EGLDisplay )myEglDisplay == EGL_NO_DISPLAY)
+ {
+ Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_GraphicDriver: no EGL display!");
+ return;
+ }
+
+ EGLint aVerMajor = 0; EGLint aVerMinor = 0;
+ if (eglInitialize ((EGLDisplay )myEglDisplay, &aVerMajor, &aVerMinor) != EGL_TRUE)
+ {
+ Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_GraphicDriver: EGL display is unavailable!");
+ return;
+ }
+
+ TCollection_AsciiString anEglInfo = TCollection_AsciiString()
+ + "EGL info"
+ + "\n Version: " + aVerMajor + "." + aVerMinor + " (" + eglQueryString ((EGLDisplay )myEglDisplay, EGL_VERSION)
+ + "\n Vendor: " + eglQueryString ((EGLDisplay )myEglDisplay, EGL_VENDOR)
+ + "\n Client APIs: " + eglQueryString ((EGLDisplay )myEglDisplay, EGL_CLIENT_APIS)
+ + "\n Extensions: " + eglQueryString ((EGLDisplay )myEglDisplay, EGL_EXTENSIONS);
+ ::Message::DefaultMessenger()->Send (anEglInfo, Message_Info);
+
+ const EGLint aConfigAttribs[] =
+ {
+ EGL_RED_SIZE, 8,
+ EGL_GREEN_SIZE, 8,
+ EGL_BLUE_SIZE, 8,
+ EGL_ALPHA_SIZE, 0,
+ EGL_DEPTH_SIZE, 24,
+ EGL_STENCIL_SIZE, 8,
+ #if defined(GL_ES_VERSION_2_0)
+ EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
+ #else
+ EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
+ #endif
+ EGL_NONE
+ };
+
+ EGLint aNbConfigs = 0;
+ if (eglChooseConfig ((EGLDisplay )myEglDisplay, aConfigAttribs, &myEglConfig, 1, &aNbConfigs) != EGL_TRUE)
+ {
+ Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_GraphicDriver: EGL does not provide compatible configurations!");
+ return;
+ }
+
+#if defined(GL_ES_VERSION_2_0)
+ if (eglBindAPI (EGL_OPENGL_ES_API) != EGL_TRUE)
+ {
+ Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_GraphicDriver: EGL does not provide OpenGL ES client!");
+ return;
+ }
+#else
+ if (eglBindAPI (EGL_OPENGL_API) != EGL_TRUE)
+ {
+ Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_GraphicDriver: EGL does not provide OpenGL client!");
+ return;
+ }
+#endif
+
+#if defined(GL_ES_VERSION_2_0)
+ EGLint anEglCtxAttribs[] =
+ {
+ EGL_CONTEXT_CLIENT_VERSION, 2,
+ EGL_NONE
+ };
+#else
+ EGLint* anEglCtxAttribs = NULL;
+#endif
+
+ myEglContext = (Aspect_RenderingContext )eglCreateContext ((EGLDisplay )myEglDisplay, myEglConfig, EGL_NO_CONTEXT, anEglCtxAttribs);
+ if ((EGLContext )myEglContext == EGL_NO_CONTEXT)
+ {
+ Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_GraphicDriver: EGL is unable to create OpenGL context!");
+ return;
+ }
+ if (eglMakeCurrent ((EGLDisplay )myEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, (EGLContext )myEglContext) != EGL_TRUE)
+ {
+ Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_GraphicDriver: EGL is unable bind OpenGL context!");
+ return;
+ }
+#else
+ // not yet implemented
+ (void )theToStealActiveContext;
+#endif
}
// =======================================================================
Standard_Size Increment() { return ++myCounter; }
private:
-
+
Standard_Size myCounter;
};
{
public:
- //! Constructor
- Standard_EXPORT OpenGl_GraphicDriver (const Handle(Aspect_DisplayConnection)& theDisp);
+ //! Constructor.
+ //! @param theDisp connection to display, required on Linux but optional on other systems
+ //! @param theToStealActiveContext option to use OpenGL context currently bound to the thread rather than creating own one, currently implemented only for Android
+ Standard_EXPORT OpenGl_GraphicDriver (const Handle(Aspect_DisplayConnection)& theDisp,
+ const Standard_Boolean theToStealActiveContext = Standard_False);
Standard_EXPORT Standard_Integer InquireLightLimit ();
Standard_EXPORT Standard_Integer InquireViewLimit ();
//! marks primitive set for rebuild.
Standard_EXPORT void InvalidateBVHData (Graphic3d_CView& theCView, const Standard_Integer theLayerId);
+#if defined(HAVE_EGL) || defined(__ANDROID__)
+ Aspect_Display getRawGlDisplay() const { return myEglDisplay; }
+ Aspect_RenderingContext getRawGlContext() const { return myEglContext; }
+ void* getRawGlConfig() const { return myEglConfig; }
+#endif
+
public:
DEFINE_STANDARD_RTTI(OpenGl_GraphicDriver)
private:
+#if defined(HAVE_EGL) || defined(__ANDROID__)
+ Aspect_Display myEglDisplay; //!< EGL connection to the Display : EGLDisplay
+ Aspect_RenderingContext myEglContext; //!< EGL rendering context : EGLContext
+ void* myEglConfig; //!< EGL configuration : EGLConfig
+#endif
+
Handle(OpenGl_Caps) myCaps;
NCollection_DataMap<Standard_Integer, Handle(OpenGl_View)> myMapOfView;
NCollection_DataMap<Standard_Integer, Handle(OpenGl_Workspace)> myMapOfWS;
}
Handle(OpenGl_Context) aShareCtx = GetSharedContext();
- Handle(OpenGl_Workspace) aWS = new OpenGl_Workspace (myDisplayConnection, theCView.DefWindow, theCView.GContext, myCaps, aShareCtx);
+ Handle(OpenGl_Workspace) aWS = new OpenGl_Workspace (this, theCView.DefWindow, theCView.GContext, myCaps, aShareCtx);
Handle(OpenGl_View) aView = new OpenGl_View (theCView.Context, &myStateCounter);
myMapOfWS .Bind (theCView.WsId, aWS);
myMapOfView.Bind (theCView.ViewId, aView);
#include <OpenGl_Window.hxx>
#include <OpenGl_Context.hxx>
+#include <OpenGl_GraphicDriver.hxx>
#include <Aspect_GraphicDeviceDefinitionError.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
+#if defined(HAVE_EGL) || defined(__ANDROID__)
+ #include <EGL/egl.h>
+#endif
+
IMPLEMENT_STANDARD_HANDLE(OpenGl_Window,MMgt_TShared)
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_Window,MMgt_TShared)
{
static const TEL_COLOUR THE_DEFAULT_BG_COLOR = { { 0.F, 0.F, 0.F, 1.F } };
-#if defined(_WIN32)
+#if defined(HAVE_EGL) || defined(__ANDROID__)
+ //
+#elif defined(_WIN32)
// WGL_ARB_pixel_format
#ifndef WGL_NUMBER_PIXEL_FORMATS_ARB
// function : OpenGl_Window
// purpose :
// =======================================================================
-OpenGl_Window::OpenGl_Window (const Handle(Aspect_DisplayConnection)& theDisplayConnection,
+OpenGl_Window::OpenGl_Window (const Handle(OpenGl_GraphicDriver)& theDriver,
const CALL_DEF_WINDOW& theCWindow,
Aspect_RenderingContext theGContext,
const Handle(OpenGl_Caps)& theCaps,
myBgColor.rgb[1] = theCWindow.Background.g;
myBgColor.rgb[2] = theCWindow.Background.b;
-#if defined(_WIN32)
- (void )theDisplayConnection;
+#if defined(HAVE_EGL) || defined(__ANDROID__)
+ EGLDisplay anEglDisplay = (EGLDisplay )theDriver->getRawGlDisplay();
+ EGLContext anEglContext = (EGLContext )theDriver->getRawGlContext();
+ EGLConfig anEglConfig = (EGLConfig )theDriver->getRawGlConfig();
+ if (anEglDisplay == EGL_NO_DISPLAY
+ || anEglContext == EGL_NO_CONTEXT
+ || anEglConfig == NULL)
+ {
+ Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_Window, EGL does not provide compatible configurations!");
+ return;
+ }
+
+ EGLSurface anEglSurf = EGL_NO_SURFACE;
+ if (theGContext == (EGLContext )EGL_NO_CONTEXT)
+ {
+ // create new surface
+ anEglSurf = eglCreateWindowSurface (anEglDisplay, anEglConfig, (EGLNativeWindowType )theCWindow.XWindow, NULL);
+ if (anEglSurf == EGL_NO_SURFACE)
+ {
+ Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_Window, EGL is unable to create surface for window!");
+ return;
+ }
+ }
+ else if (theGContext != anEglContext)
+ {
+ Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_Window, EGL is used in unsupported combination!");
+ return;
+ }
+ else
+ {
+ anEglSurf = eglGetCurrentSurface(EGL_DRAW);
+ if (anEglSurf == EGL_NO_SURFACE)
+ {
+ Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_Window, EGL is unable to retrieve current surface!");
+ return;
+ }
+ }
+
+ myGlContext->Init ((Aspect_Drawable )anEglSurf, (Aspect_Display )anEglDisplay, (Aspect_RenderingContext )anEglContext);
+#elif defined(_WIN32)
+ (void )theDriver;
HWND aWindow = (HWND )theCWindow.XWindow;
HDC aWindowDC = GetDC (aWindow);
HGLRC aGContext = (HGLRC )theGContext;
Window aParent = (Window )theCWindow.XWindow;
Window aWindow = 0;
- Display* aDisp = theDisplayConnection->GetDisplay();
+ Display* aDisp = theDriver->GetDisplayConnection()->GetDisplay();
GLXContext aGContext = (GLXContext )theGContext;
XWindowAttributes wattr;
// =======================================================================
OpenGl_Window::~OpenGl_Window()
{
- if (!myOwnGContext)
+ if (!myOwnGContext
+ || myGlContext.IsNull())
{
myGlContext.Nullify();
return;
// release "GL" context if it is owned by window
// Mesa implementation can fail to destroy GL context if it set for current thread.
// It should be safer to unset thread GL context before its destruction.
-#if defined(_WIN32)
+#if defined(HAVE_EGL) || defined(__ANDROID__)
+ if ((EGLSurface )myGlContext->myWindow != EGL_NO_SURFACE)
+ {
+ eglDestroySurface ((EGLDisplay )myGlContext->myDisplay,
+ (EGLSurface )myGlContext->myWindow);
+ }
+#elif defined(_WIN32)
HWND aWindow = (HWND )myGlContext->myWindow;
HDC aWindowDC = (HDC )myGlContext->myWindowDC;
HGLRC aWindowGContext = (HGLRC )myGlContext->myGContext;
// =======================================================================
void OpenGl_Window::Resize (const CALL_DEF_WINDOW& theCWindow)
{
-#if !defined(_WIN32)
+#if !defined(_WIN32) && !defined(HAVE_EGL) && !defined(__ANDROID__)
Display* aDisp = (Display* )myGlContext->myDisplay;
if (aDisp == NULL)
return;
myWidth = (Standard_Integer )theCWindow.dx;
myHeight = (Standard_Integer )theCWindow.dy;
-#if !defined(_WIN32)
+#if !defined(_WIN32) && !defined(HAVE_EGL) && !defined(__ANDROID__)
XResizeWindow (aDisp, myGlContext->myWindow, (unsigned int )myWidth, (unsigned int )myHeight);
XSync (aDisp, False);
#endif
if (!Activate())
return;
-#if defined(_WIN32)
+#if defined(HAVE_EGL) || defined(__ANDROID__)
+ eglQuerySurface ((EGLDisplay )myGlContext->myDisplay, (EGLSurface )myGlContext->myWindow, EGL_WIDTH, &myWidth);
+ eglQuerySurface ((EGLDisplay )myGlContext->myDisplay, (EGLSurface )myGlContext->myWindow, EGL_HEIGHT, &myHeight);
+#elif defined(_WIN32)
RECT cr;
GetClientRect ((HWND )myGlContext->myWindow, &cr);
myWidth = cr.right - cr.left;
#include <Handle_OpenGl_Context.hxx>
#include <Handle_OpenGl_Window.hxx>
-#include <Aspect_DisplayConnection.hxx>
+#include <Handle_OpenGl_GraphicDriver.hxx>
#include <MMgt_TShared.hxx>
public:
//! Main constructor - prepare GL context for specified window.
- OpenGl_Window (const Handle(Aspect_DisplayConnection)& theDisplayConnection,
+ OpenGl_Window (const Handle(OpenGl_GraphicDriver)& theDriver,
const CALL_DEF_WINDOW& theCWindow,
Aspect_RenderingContext theGContext,
const Handle(OpenGl_Caps)& theCaps,
// function : OpenGl_Workspace
// purpose :
// =======================================================================
-OpenGl_Workspace::OpenGl_Workspace (const Handle(Aspect_DisplayConnection)& theDisplayConnection,
+OpenGl_Workspace::OpenGl_Workspace (const Handle(OpenGl_GraphicDriver)& theDriver,
const CALL_DEF_WINDOW& theCWindow,
Aspect_RenderingContext theGContext,
const Handle(OpenGl_Caps)& theCaps,
const Handle(OpenGl_Context)& theShareCtx)
-: OpenGl_Window (theDisplayConnection, theCWindow, theGContext, theCaps, theShareCtx),
+: OpenGl_Window (theDriver, theCWindow, theGContext, theCaps, theShareCtx),
NamedStatus (0),
HighlightColor (&THE_WHITE_COLOR),
//
// fetch OpenGl context state
aGlCtx->FetchState();
- Tint toSwap = (aGlCtx->IsRender()); // swap buffers
+ Tint toSwap = (aGlCtx->IsRender() && !aGlCtx->caps->buffersNoSwap) ? 1 : 0; // swap buffers
GLint aViewPortBack[4];
OpenGl_FrameBuffer* aFrameBuffer = (OpenGl_FrameBuffer* )theCView.ptrFBO;
if (aFrameBuffer != NULL)
public:
//! Main constructor - prepare GL context for specified window.
- OpenGl_Workspace (const Handle(Aspect_DisplayConnection)& theDisplayConnection,
+ OpenGl_Workspace (const Handle(OpenGl_GraphicDriver)& theDriver,
const CALL_DEF_WINDOW& theCWindow,
Aspect_RenderingContext theGContext,
const Handle(OpenGl_Caps)& theCaps,
MyWindow = theWindow;
MyCView.WsId = MyCView.ViewId;
MyCView.DefWindow.IsDefined = 1;
-#if defined(_WIN32)
- const Handle(WNT_Window) aWin = Handle(WNT_Window)::DownCast (theWindow);
- MyCView.DefWindow.XWindow = (HWND )(aWin->HWindow());
- MyCView.DefWindow.XParentWindow = (HWND )(aWin->HParentWindow());
-#elif (defined(__APPLE__) && !defined(MACOSX_USE_GLX))
- const Handle(Cocoa_Window) aWin = Handle(Cocoa_Window)::DownCast (theWindow);
- MyCView.DefWindow.XWindow = (Aspect_Drawable )aWin->HView();
- MyCView.DefWindow.XParentWindow = NULL;
- //MyCView.DefWindow.XParentWindow = aWin->HParentWindow();
-#elif defined(__ANDROID__)
- //
-#else
- const Handle(Xw_Window) aWin = Handle(Xw_Window)::DownCast (theWindow);
- MyCView.DefWindow.XWindow = aWin->XWindow();
- //MyCView.DefWindow.XParentWindow = aWin->XParentWindow();
-#endif
+ MyCView.DefWindow.XWindow = theWindow->NativeHandle();
+ MyCView.DefWindow.XParentWindow = theWindow->NativeParentHandle();
Standard_Integer Width, Height;
theWindow->Size (Width, Height);
uses
Handle from Aspect,
+ Drawable from Aspect,
TypeOfResize from Aspect,
NameOfColor from Quantity,
Color from Quantity,
---Purpose: Returns the Windows NT handle parent of the created window <me>.
---C++: inline
+ NativeHandle ( me ) returns Drawable from Aspect is virtual;
+ ---Purpose: Returns native Window handle (HWND)
+ ---C++: inline
+
+ NativeParentHandle ( me ) returns Drawable from Aspect is virtual;
+ ---Purpose: Returns parent of native Window handle (HWND on Windows, Window with Xlib, and so on)
+ ---C++: inline
+
fields
aXLeft : Integer from Standard is protected; -- Window coordinates
{
return myHParentWindow;
}
+
+inline Aspect_Drawable WNT_Window::NativeHandle() const
+{
+ return (Aspect_Drawable )myHWindow;
+}
+
+inline Aspect_Drawable WNT_Window::NativeParentHandle() const
+{
+ return (Aspect_Drawable )myHParentWindow;
+}
//! @return connection to X Display
Standard_EXPORT const Handle(Aspect_DisplayConnection)& DisplayConnection() const;
+ //! @return native Window handle
+ virtual Aspect_Drawable NativeHandle() const
+ {
+ return (Aspect_Drawable )XWindow();
+ }
+
+ //! @return parent of native Window handle
+ virtual Aspect_Drawable NativeParentHandle() const
+ {
+ return 0;
+ }
+
protected:
Handle(Aspect_DisplayConnection) myDisplay; //!< X Display connection