1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-05-16 10:54:53 +03:00

0026823: Configuration - use EGL on another platform without GLX

This commit is contained in:
ibs 2015-10-28 18:24:34 +03:00 committed by bugmaster
parent c85385c0e2
commit d8d01f6ed6
31 changed files with 134 additions and 78 deletions

View File

@ -1108,6 +1108,12 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } {
set aFrmsMap(CSF_OpenGlLibs) "OpenGL"
set aFrmsMap(CSF_TclLibs) "Tcl"
set aFrmsMap(CSF_TclTkLibs) "Tk"
} else {
if { "$theOS" == "qnx" } {
# CSF_ThreadLibs - pthread API is part og libc on QNX
set aLibsMap(CSF_OpenGlLibs) "EGL GLESv2"
set aLibsMap(CSF_TclLibs) "tcl8.6"
set aLibsMap(CSF_TclTkLibs) "tk8.6"
} else {
set aLibsMap(CSF_ThreadLibs) "pthread rt"
set aLibsMap(CSF_OpenGlLibs) "GL"
@ -1116,6 +1122,7 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } {
set aLibsMap(CSF_XwLibs) "X11 Xext Xmu Xi"
set aLibsMap(CSF_MotifLibs) "X11"
}
}
# optional 3rd-parties
if { "$::HAVE_TBB" == "true" } {
@ -2054,13 +2061,13 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theFrameworks t
# Release target configuration
puts $aFile "\t\t\t<Target title=\"Release\">"
if { "$theIsExe" == "true" } {
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/bin/${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />"
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/bin/${theProjName}\" prefix_auto=\"0\" extension_auto=\"0\" />"
puts $aFile "\t\t\t\t<Option type=\"1\" />"
} else {
if { "$aWokStation" == "wnt" } {
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/lib/${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />"
} else {
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/lib/lib${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />"
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/lib/lib${theProjName}.so\" prefix_auto=\"0\" extension_auto=\"0\" />"
}
puts $aFile "\t\t\t\t<Option type=\"3\" />"
}
@ -2070,8 +2077,8 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theFrameworks t
} else {
puts $aFile "\t\t\t\t<Option compiler=\"gcc\" />"
}
puts $aFile "\t\t\t\t<Option createDefFile=\"1\" />"
puts $aFile "\t\t\t\t<Option createStaticLib=\"1\" />"
puts $aFile "\t\t\t\t<Option createDefFile=\"0\" />"
puts $aFile "\t\t\t\t<Option createStaticLib=\"0\" />"
# compiler options per TARGET (including defines)
puts $aFile "\t\t\t\t<Compiler>"
@ -2085,15 +2092,20 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theFrameworks t
} else {
puts $aFile "\t\t\t\t\t<Add option=\"-O2\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-std=c++0x\" />"
if { "$aWokStation" != "qnx" } {
puts $aFile "\t\t\t\t\t<Add option=\"-mmmx\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-msse\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-msse2\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-mfpmath=sse\" />"
}
}
foreach aMacro $theDefines {
puts $aFile "\t\t\t\t\t<Add option=\"-D${aMacro}\" />"
}
puts $aFile "\t\t\t\t\t<Add option=\"-DNDEBUG\" />"
if { "$aWokStation" == "qnx" } {
puts $aFile "\t\t\t\t\t<Add option=\"-D_QNX_SOURCE\" />"
}
puts $aFile "\t\t\t\t\t<Add option=\"-DNo_Exception\" />"
puts $aFile "\t\t\t\t</Compiler>"
@ -2111,13 +2123,13 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theFrameworks t
# Debug target configuration
puts $aFile "\t\t\t<Target title=\"Debug\">"
if { "$theIsExe" == "true" } {
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/bind/${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />"
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/bind/${theProjName}\" prefix_auto=\"0\" extension_auto=\"0\" />"
puts $aFile "\t\t\t\t<Option type=\"1\" />"
} else {
if { "$aWokStation" == "wnt" } {
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/libd/${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />"
} else {
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/libd/lib${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />"
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/libd/lib${theProjName}.so\" prefix_auto=\"0\" extension_auto=\"0\" />"
}
puts $aFile "\t\t\t\t<Option type=\"3\" />"
}
@ -2127,8 +2139,8 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theFrameworks t
} else {
puts $aFile "\t\t\t\t<Option compiler=\"gcc\" />"
}
puts $aFile "\t\t\t\t<Option createDefFile=\"1\" />"
puts $aFile "\t\t\t\t<Option createStaticLib=\"1\" />"
puts $aFile "\t\t\t\t<Option createDefFile=\"0\" />"
puts $aFile "\t\t\t\t<Option createStaticLib=\"0\" />"
# compiler options per TARGET (including defines)
puts $aFile "\t\t\t\t<Compiler>"
@ -2144,15 +2156,20 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theFrameworks t
puts $aFile "\t\t\t\t\t<Add option=\"-O0\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-std=c++0x\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-g\" />"
if { "$aWokStation" != "qnx" } {
puts $aFile "\t\t\t\t\t<Add option=\"-mmmx\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-msse\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-msse2\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-mfpmath=sse\" />"
}
}
foreach aMacro $theDefines {
puts $aFile "\t\t\t\t\t<Add option=\"-D${aMacro}\" />"
}
puts $aFile "\t\t\t\t\t<Add option=\"-D_DEBUG\" />"
if { "$aWokStation" == "qnx" } {
puts $aFile "\t\t\t\t\t<Add option=\"-D_QNX_SOURCE\" />"
}
puts $aFile "\t\t\t\t\t<Add option=\"-DDEB\" />"
puts $aFile "\t\t\t\t</Compiler>"

View File

@ -11,14 +11,13 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
// AdvApp2Var_ApproxF2var.cxx
#include <math.h>
#include <AdvApp2Var_SysBase.hxx>
#include <AdvApp2Var_MathBase.hxx>
#include <AdvApp2Var_Data_f2c.hxx>
#include <AdvApp2Var_Data.hxx>
#include <AdvApp2Var_ApproxF2var.hxx>
#include <cmath>
static
int mmjacpt_(const integer *ndimen,

View File

@ -13,7 +13,7 @@
// AdvApp2Var_SysBase.cxx
#include <assert.h>
#include <math.h>
#include <cmath>
#include <stdlib.h>
#include <string.h>
#include <AdvApp2Var_Data_f2c.hxx>

View File

@ -23,7 +23,7 @@
// =======================================================================
Aspect_DisplayConnection::Aspect_DisplayConnection()
{
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__)
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__)
OSD_Environment anEnv ("DISPLAY");
myDisplayName = anEnv.Value();
Init();
@ -36,7 +36,7 @@ Aspect_DisplayConnection::Aspect_DisplayConnection()
// =======================================================================
Aspect_DisplayConnection::~Aspect_DisplayConnection()
{
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__)
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__)
if (myDisplay != NULL)
{
XCloseDisplay (myDisplay);
@ -44,7 +44,7 @@ Aspect_DisplayConnection::~Aspect_DisplayConnection()
#endif
}
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__)
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__)
// =======================================================================
// function : Aspect_DisplayConnection
// purpose :

View File

@ -20,7 +20,7 @@
#include <TCollection_AsciiString.hxx>
#include <NCollection_DataMap.hxx>
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__)
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__)
#include <InterfaceGraphic.hxx>
#endif
@ -39,7 +39,7 @@ public:
//! Destructor. Close opened connection.
Standard_EXPORT ~Aspect_DisplayConnection();
#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__)
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__)
//! Constructor. Creates connection with display specified in theDisplayName.
//! Display name should be in format "hostname:number" or "hostname:number.screen_number", where:
//! hostname - Specifies the name of the host machine on which the display is physically attached.

View File

@ -14,7 +14,7 @@
#ifndef _Aspect_FBConfig_HeaderFile
#define _Aspect_FBConfig_HeaderFile
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__)
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__)
typedef struct __GLXFBConfigRec* GLXFBConfig;
typedef GLXFBConfig Aspect_FBConfig; // GLXFBConfig* under UNIX
#else

View File

@ -14,7 +14,7 @@
#ifndef __Aspect_WNTXWD_HXX
# define __Aspect_WNTXWD_HXX
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__)
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__)
# include <X11/XWDFile.h>
# else

View File

@ -362,6 +362,10 @@ static Standard_Integer dversion(Draw_Interpretor& di, Standard_Integer, const c
#elif defined(__ANDROID__) /* must be before Linux */
#include <android/api-level.h>
di << "OS: Android (__ANDROID_API__ = " << __ANDROID_API__ << ")\n";
#elif defined(__QNXNTO__)
di << "OS: QNX Neutrino\n";
#elif defined(__QNX__)
di << "OS: QNX\n";
#elif defined(__linux__)
di << "OS: Linux\n";
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__)

View File

@ -1342,7 +1342,12 @@ Standard_Real ElCLib::HyperbolaParameter (const gp_Ax2& Pos,
Standard_Real sht =
gp_Vec(Pos.Location (), P).Dot
(gp_Vec (Pos.YDirection())) / MinorRadius;
#if __cplusplus >= 201103L
return std::asinh(sht);
#else
return asinh(sht);
#endif
}
//=======================================================================
@ -1421,7 +1426,11 @@ Standard_Real ElCLib::HyperbolaParameter (const gp_Ax22d& Pos,
{
gp_Vec2d V (Pos.YDirection().XY());
Standard_Real sht = gp_Vec2d(Pos.Location(),P).Dot(V) /MinorRadius;
#if __cplusplus >= 201103L
return std::asinh(sht);
#else
return asinh(sht);
#endif
}
//=======================================================================

View File

@ -23,7 +23,7 @@
#undef DrawText
#endif
#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
#elif !defined(__ANDROID__) && !defined(__QNX__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
#include <stdio.h>

View File

@ -22,6 +22,10 @@
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#ifndef _WIN32
#include <strings.h>
#endif
//=======================================================================
//function : Constructor
//purpose : Empty constructor, defaulting to cerr

View File

@ -16,7 +16,7 @@
#include <OSD.hxx>
#include <Standard_Stream.hxx>
#include <math.h>
#include <cmath>
#include <stdio.h>
#if defined(isfinite)
# define finite isfinite
@ -125,6 +125,10 @@ void OSD::MilliSecSleep(const Standard_Integer aDelay)
Standard_Boolean OSD::IsDivisible(const Standard_Real theDividend,const Standard_Real theDivisor)
{
#ifdef __QNX__
using std::finite;
#endif
if ( theDivisor == 0. || ! finite(theDividend) ) return Standard_False;
//
// you may divide by infinity

View File

@ -57,7 +57,7 @@
//=======================================================================
void OSD_Chronometer::GetProcessCPU (Standard_Real& UserSeconds, Standard_Real& SystemSeconds)
{
#if defined(__linux__) || defined(linux) || defined(__FreeBSD__) || defined(__ANDROID__)
#if defined(__linux__) || defined(linux) || defined(__FreeBSD__) || defined(__ANDROID__) || defined(__QNX__)
static const long aCLK_TCK = sysconf(_SC_CLK_TCK);
#else
static const long aCLK_TCK = CLK_TCK;
@ -87,7 +87,7 @@ void OSD_Chronometer::GetThreadCPU (Standard_Real& theUserSeconds,
theUserSeconds = Standard_Real(aTaskInfo.user_time.seconds) + 0.000001 * aTaskInfo.user_time.microseconds;
theSystemSeconds = Standard_Real(aTaskInfo.system_time.seconds) + 0.000001 * aTaskInfo.system_time.microseconds;
}
#elif (defined(_POSIX_TIMERS) && defined(_POSIX_THREAD_CPUTIME)) || defined(__ANDROID__)
#elif (defined(_POSIX_TIMERS) && defined(_POSIX_THREAD_CPUTIME)) || defined(__ANDROID__) || defined(__QNX__)
// on Linux, only user times are available for threads via clock_gettime()
struct timespec t;
if (!clock_gettime (CLOCK_THREAD_CPUTIME_ID, &t))

View File

@ -21,8 +21,8 @@
#include <Standard_ProgramError.hxx>
#include <TCollection_AsciiString.hxx>
static OSD_SysType whereAmI(){
#if defined(__digital__) || defined(__FreeBSD__) || defined(SUNOS) || defined(__APPLE__)
static OSD_SysType whereAmI() {
#if defined(__digital__) || defined(__FreeBSD__) || defined(SUNOS) || defined(__APPLE__) || defined(__QNX__)
return OSD_UnixBSD;
}
#elif defined(sgi) || defined(IRIX) || defined(__sun) || defined(SOLARIS) || defined(__sco__) || defined(__hpux) || defined(HPUX)

View File

@ -70,7 +70,7 @@ typedef void (* SIG_PFV) (int);
#include <signal.h>
#if !defined(__ANDROID__)
#if !defined(__ANDROID__) && !defined(__QNX__)
#include <sys/signal.h>
#endif

View File

@ -45,7 +45,7 @@
#include <OpenGL/gl.h>
#endif
#define __X_GL_H // prevent chaotic gl.h inclusions to avoid compile errors
#elif defined(HAVE_GLES2) || defined(__ANDROID__)
#elif defined(HAVE_GLES2) || defined(__ANDROID__) || defined(__QNX__)
#include <GLES2/gl2.h>
//#include <GLES3/gl3.h>
#else
@ -149,7 +149,7 @@
#define GL_TEXTURE_BUFFER_ARB 0x8C2A
#endif
#if defined(__ANDROID__)
#if defined(__ANDROID__) || defined(__QNX__)
#define HAVE_EGL
#endif

View File

@ -38,11 +38,11 @@
#include <Xw_Window.hxx>
#endif
#if !defined(_WIN32) && !defined(__ANDROID__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
#if !defined(_WIN32) && !defined(__ANDROID__) && !defined(__QNX__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
#include <X11/Xlib.h> // XOpenDisplay()
#endif
#if defined(HAVE_EGL) || defined(__ANDROID__)
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
#include <EGL/egl.h>
#endif
@ -59,7 +59,7 @@ OpenGl_GraphicDriver::OpenGl_GraphicDriver (const Handle(Aspect_DisplayConnectio
const Standard_Boolean theToInitialize)
: Graphic3d_GraphicDriver (theDisp),
myIsOwnContext (Standard_False),
#if defined(HAVE_EGL) || defined(__ANDROID__)
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
myEglDisplay ((Aspect_Display )EGL_NO_DISPLAY),
myEglContext ((Aspect_RenderingContext )EGL_NO_CONTEXT),
myEglConfig (NULL),
@ -68,7 +68,7 @@ OpenGl_GraphicDriver::OpenGl_GraphicDriver (const Handle(Aspect_DisplayConnectio
myMapOfView (1, NCollection_BaseAllocator::CommonBaseAllocator()),
myMapOfStructure (1, NCollection_BaseAllocator::CommonBaseAllocator())
{
#if !defined(_WIN32) && !defined(__ANDROID__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
#if !defined(_WIN32) && !defined(__ANDROID__) && !defined(__QNX__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
if (myDisplayConnection.IsNull())
{
//Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_GraphicDriver: cannot connect to X server!");
@ -202,7 +202,7 @@ void OpenGl_GraphicDriver::ReleaseContext()
aWindow->GetGlContext()->forcedRelease();
}
#if defined(HAVE_EGL) || defined(__ANDROID__)
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
if (myIsOwnContext)
{
if (myEglContext != (Aspect_RenderingContext )EGL_NO_CONTEXT)
@ -237,9 +237,9 @@ void OpenGl_GraphicDriver::ReleaseContext()
Standard_Boolean OpenGl_GraphicDriver::InitContext()
{
ReleaseContext();
#if defined(HAVE_EGL) || defined(__ANDROID__)
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
#if !defined(_WIN32) && !defined(__ANDROID__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
#if !defined(_WIN32) && !defined(__ANDROID__) && !defined(__QNX__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
if (myDisplayConnection.IsNull())
{
return Standard_False;
@ -328,7 +328,7 @@ Standard_Boolean OpenGl_GraphicDriver::InitContext()
return Standard_True;
}
#if defined(HAVE_EGL) || defined(__ANDROID__)
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
// =======================================================================
// function : InitEglContext
// purpose :
@ -338,7 +338,7 @@ Standard_Boolean OpenGl_GraphicDriver::InitEglContext (Aspect_Display t
void* theEglConfig)
{
ReleaseContext();
#if !defined(_WIN32) && !defined(__ANDROID__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
#if !defined(_WIN32) && !defined(__ANDROID__) && !defined(__QNX__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
if (myDisplayConnection.IsNull())
{
return Standard_False;
@ -751,7 +751,7 @@ Standard_Boolean OpenGl_GraphicDriver::ViewExists (const Handle(Aspect_Window)&
#else
NSView* TheSpecifiedWindowId = THEWindow->HView();
#endif
#elif defined(__ANDROID__)
#elif defined(__ANDROID__) || defined(__QNX__)
int TheSpecifiedWindowId = -1;
#else
const Handle(Xw_Window) THEWindow = Handle(Xw_Window)::DownCast (AWindow);
@ -776,7 +776,7 @@ Standard_Boolean OpenGl_GraphicDriver::ViewExists (const Handle(Aspect_Window)&
#else
NSView* TheWindowIdOfView = theWindow->HView();
#endif
#elif defined(__ANDROID__)
#elif defined(__ANDROID__) || defined(__QNX__)
int TheWindowIdOfView = 0;
#else
const Handle(Xw_Window) theWindow = Handle(Xw_Window)::DownCast (AspectWindow);

View File

@ -104,7 +104,7 @@ public:
//! Perform initialization of default OpenGL context.
Standard_EXPORT Standard_Boolean InitContext();
#if defined(HAVE_EGL) || defined(__ANDROID__)
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
//! Initialize default OpenGL context using existing one.
//! @param theEglDisplay EGL connection to the Display
//! @param theEglContext EGL rendering context
@ -199,7 +199,7 @@ public:
//! Could return NULL-handle if no window created by this driver.
Standard_EXPORT const Handle(OpenGl_Context)& GetSharedContext() const;
#if defined(HAVE_EGL) || defined(__ANDROID__)
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
Aspect_Display getRawGlDisplay() const { return myEglDisplay; }
Aspect_RenderingContext getRawGlContext() const { return myEglContext; }
void* getRawGlConfig() const { return myEglConfig; }
@ -212,7 +212,7 @@ public:
protected:
Standard_Boolean myIsOwnContext; //!< indicates that shared context has been created within OpenGl_GraphicDriver
#if defined(HAVE_EGL) || defined(__ANDROID__)
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
Aspect_Display myEglDisplay; //!< EGL connection to the Display : EGLDisplay
Aspect_RenderingContext myEglContext; //!< EGL rendering context : EGLContext
void* myEglConfig; //!< EGL configuration : EGLConfig

View File

@ -26,7 +26,7 @@
#include <TCollection_ExtendedString.hxx>
#include <Graphic3d_GraphicDriver.hxx>
#if defined(HAVE_EGL) || defined(__ANDROID__)
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
#include <EGL/egl.h>
#endif
@ -36,7 +36,7 @@
namespace
{
#if defined(HAVE_EGL) || defined(__ANDROID__)
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
//
#elif defined(_WIN32)
@ -172,7 +172,7 @@ OpenGl_Window::OpenGl_Window (const Handle(OpenGl_GraphicDriver)& theDriver,
Standard_Boolean isCoreProfile = Standard_False;
#if defined(HAVE_EGL) || defined(__ANDROID__)
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
EGLDisplay anEglDisplay = (EGLDisplay )theDriver->getRawGlDisplay();
EGLContext anEglContext = (EGLContext )theDriver->getRawGlContext();
EGLConfig anEglConfig = (EGLConfig )theDriver->getRawGlConfig();
@ -615,7 +615,7 @@ OpenGl_Window::~OpenGl_Window()
// 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(HAVE_EGL) || defined(__ANDROID__)
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
if ((EGLSurface )myGlContext->myWindow != EGL_NO_SURFACE)
{
eglDestroySurface ((EGLDisplay )myGlContext->myDisplay,
@ -677,7 +677,7 @@ Standard_Boolean OpenGl_Window::Activate()
// =======================================================================
void OpenGl_Window::Resize()
{
#if !defined(_WIN32) && !defined(HAVE_EGL) && !defined(__ANDROID__)
#if !defined(_WIN32) && !defined(HAVE_EGL) && !defined(__ANDROID__) && !defined(__QNX__)
Display* aDisp = (Display* )myGlContext->myDisplay;
if (aDisp == NULL)
return;
@ -694,7 +694,7 @@ void OpenGl_Window::Resize()
myWidth = aWidth;
myHeight = aHeight;
#if !defined(_WIN32) && !defined(HAVE_EGL) && !defined(__ANDROID__)
#if !defined(_WIN32) && !defined(HAVE_EGL) && !defined(__ANDROID__) && !defined(__QNX__)
XResizeWindow (aDisp, myGlContext->myWindow, (unsigned int )myWidth, (unsigned int )myHeight);
XSync (aDisp, False);
#endif
@ -711,7 +711,7 @@ void OpenGl_Window::Init()
if (!Activate())
return;
#if defined(HAVE_EGL) || defined(__ANDROID__)
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
eglQuerySurface ((EGLDisplay )myGlContext->myDisplay, (EGLSurface )myGlContext->myWindow, EGL_WIDTH, &myWidth);
eglQuerySurface ((EGLDisplay )myGlContext->myDisplay, (EGLSurface )myGlContext->myWindow, EGL_HEIGHT, &myHeight);
#elif defined(_WIN32)

View File

@ -27,7 +27,7 @@
#include <locale.h>
#endif
#if defined(_MSC_VER) || defined(__ANDROID__)
#if defined(_MSC_VER) || defined(__ANDROID__) || defined(__QNX__)
#include <malloc.h>
#elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 1)
#include <mm_malloc.h>
@ -264,7 +264,7 @@ Standard_Address Standard::AllocateAligned (const Standard_Size theSize,
{
#if defined(_MSC_VER)
return _aligned_malloc (theSize, theAlign);
#elif defined(__ANDROID__)
#elif defined(__ANDROID__) || defined(__QNX__)
return memalign (theAlign, theSize);
#elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 1)
return _mm_malloc (theSize, theAlign);
@ -287,7 +287,7 @@ void Standard::FreeAligned (Standard_Address thePtrAligned)
{
#if defined(_MSC_VER)
_aligned_free (thePtrAligned);
#elif defined(__ANDROID__)
#elif defined(__ANDROID__) || defined(__QNX__)
free (thePtrAligned);
#elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 1)
_mm_free (thePtrAligned);

View File

@ -80,7 +80,7 @@ Standard_Integer HashCodes (const Standard_CString Value,
// glibc version for android platform use locale-independent implementation of
// strtod, strtol, strtoll functions. For other system with locale-depended
// implementations problems may appear if "C" locale is not set explicitly.
#ifndef __ANDROID__
#if !defined(__ANDROID__) && !defined(__QNX__)
#error System does not support xlocale. Import/export could be broken if C locale did not specified by application.
#endif
#define strtod_l(thePtr, theNextPtr, theLocale) strtod(thePtr, theNextPtr)

View File

@ -18,6 +18,7 @@
#include <Standard_Assert.hxx>
#include <stdio.h>
#include <errno.h>
#ifdef _WIN32
# include <windows.h>

View File

@ -24,6 +24,8 @@
#include <Standard_Mutex.hxx>
#include <Standard_OStream.hxx>
#include <errno.h>
//=============================================
// Standard_Mutex::Standard_Mutex
//=============================================

View File

@ -20,11 +20,11 @@
#include <Standard_Boolean.hxx>
#include <Standard_ErrorHandlerCallback.hxx>
#if (defined(_WIN32) || defined(__WIN32__))
#if defined(_WIN32)
#include <windows.h>
#else
#include <pthread.h>
#include <sys/errno.h>
///#include <sys/errno.h>
#include <unistd.h>
#include <time.h>
#endif

View File

@ -240,7 +240,11 @@ Standard_Real ATanh(const Standard_Real Value)
cout << "Illegal agument in ATanh" << endl ;
#endif
}
#if __cplusplus >= 201103L
return std::atanh(Value);
#else
return atanh(Value);
#endif
}
//-------------------------------------------------------------------
@ -254,7 +258,11 @@ Standard_Real ACosh (const Standard_Real Value)
cout << "Illegal agument in ACosh" << endl ;
#endif
}
#if __cplusplus >= 201103L
return std::acosh(Value);
#else
return acosh(Value);
#endif
}
//-------------------------------------------------------------------

View File

@ -15,8 +15,8 @@
#ifndef _Standard_Real_HeaderFile
#define _Standard_Real_HeaderFile
#include <cmath>
#include <float.h>
#include <math.h>
#include <Standard_values.h>
#include <Standard_math.hxx>
#include <Standard_TypeDef.hxx>
@ -295,7 +295,11 @@ inline Standard_Real Sinh(const Standard_Real Value)
// ASinh : Returns the hyperbolic arc sine of a real
//-------------------------------------------------------------------
inline Standard_Real ASinh(const Standard_Real Value)
#if __cplusplus >= 201103L
{ return std::asinh(Value); }
#else
{ return asinh(Value); }
#endif
//-------------------------------------------------------------------
// Square : Returns a real to the power 2

View File

@ -15,8 +15,8 @@
#ifndef _Standard_ShortReal_HeaderFile
#define _Standard_ShortReal_HeaderFile
#include <cmath>
#include <float.h>
#include <math.h>
#include <Standard_values.h>
#include <Standard_TypeDef.hxx>

View File

@ -21,6 +21,8 @@
// - IsEqual
// ===============================================
#ifndef __QNX__ // same as Standard_Size
// ------------------------------------------------------------------
// IsEqual : Returns Standard_True if two time values are equal
// ------------------------------------------------------------------
@ -31,3 +33,5 @@ inline Standard_Boolean IsEqual (const Standard_Time theOne,
}
#endif
#endif

View File

@ -15,7 +15,7 @@
#include <Xw_Window.hxx>
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__)
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__)
#include <Aspect_Convert.hxx>
#include <Aspect_WindowDefinitionError.hxx>

View File

@ -16,7 +16,7 @@
#ifndef _Xw_Window_H__
#define _Xw_Window_H__
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__)
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__)
#include <Aspect_Window.hxx>

View File

@ -27,7 +27,7 @@
#define No_Standard_DimensionError
//#endif
#include <math.h>
#include <cmath>
#include <math_Recipes.hxx>