1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0027811: Configuration - allow building TKOpenGl with OpenGL ES on Windows

OpenGl_ShaderManager::prepareStdProgramFboBlit() now tries using extension
GL_EXT_frag_depth within OpenGL ES 2.0 when OpenGL ES 3.0 is not available.
OpenGl_View::blitBuffers() now disables Depth test
when copying depth values is not supported by OpenGL ES 2.0 hardware.

Fixed building for UWP with SDK 10.0.10240.0
Fixed building TKService, TKV3d and TKOpenGl for UWP.

OSD_Environment now defines global environment map
for emulating desktop behavior on UWP.
This commit is contained in:
kgv
2016-08-31 19:34:32 +03:00
committed by bugmaster
parent 21a2b7ccf4
commit 1ce0716bb1
37 changed files with 602 additions and 86 deletions

View File

@@ -240,13 +240,22 @@ Standard_Integer OSD_Environment::Error() const
#include <windows.h>
#include <NCollection_DataMap.hxx>
#include <NCollection_UtfString.hxx>
#include <Standard_Mutex.hxx>
#if defined(_MSC_VER)
#pragma warning( disable : 4700 )
#endif
#ifndef OCCT_UWP
#ifdef OCCT_UWP
namespace
{
// emulate global map of environment variables
static Standard_Mutex THE_ENV_LOCK;
static NCollection_DataMap<TCollection_AsciiString, TCollection_AsciiString> THE_ENV_MAP;
}
#else
static void __fastcall _set_error ( OSD_Error&, DWORD );
#endif
@@ -278,9 +287,11 @@ void OSD_Environment :: SetValue ( const TCollection_AsciiString& Value ) {
TCollection_AsciiString OSD_Environment::Value()
{
#ifndef OCCT_UWP
myValue.Clear();
#ifdef OCCT_UWP
Standard_Mutex::Sentry aLock (THE_ENV_LOCK);
THE_ENV_MAP.Find (myName, myValue);
#else
SetLastError (ERROR_SUCCESS);
wchar_t* anEnvVal = NULL;
NCollection_UtfWideString aNameWide (myName.ToCString());
@@ -308,11 +319,8 @@ TCollection_AsciiString OSD_Environment::Value()
Reset();
}
myValue = aValue.ToCString();
return myValue;
#else
myValue = "";
return myValue;
#endif
return myValue;
}
void OSD_Environment :: SetName ( const TCollection_AsciiString& name ) {
@@ -329,7 +337,10 @@ TCollection_AsciiString OSD_Environment :: Name () const {
void OSD_Environment::Build()
{
#ifndef OCCT_UWP
#ifdef OCCT_UWP
Standard_Mutex::Sentry aLock(THE_ENV_LOCK);
THE_ENV_MAP.Bind (myName, myValue);
#else
NCollection_Utf8String aSetVariable = NCollection_Utf8String(myName.ToCString()) + "=" + myValue.ToCString();
_wputenv (aSetVariable.ToUtfWide().ToCString());
#endif
@@ -337,7 +348,10 @@ void OSD_Environment::Build()
void OSD_Environment::Remove()
{
#ifndef OCCT_UWP
#ifdef OCCT_UWP
Standard_Mutex::Sentry aLock(THE_ENV_LOCK);
THE_ENV_MAP.UnBind (myName);
#else
NCollection_Utf8String aSetVariable = NCollection_Utf8String(myName.ToCString()) + "=";
_wputenv (aSetVariable.ToUtfWide().ToCString());
#endif

View File

@@ -363,6 +363,7 @@ void OSD::SetSignal (const Standard_Boolean theFloatingSignal)
{
#if !defined(__CYGWIN32__) && !defined(__MINGW32__)
Standard_Mutex::Sentry aSentry (THE_SIGNAL_MUTEX); // lock the mutex to prevent simultaneous handling
#if !defined(OCCT_UWP) || defined(NTDDI_WIN10_TH2)
LPTOP_LEVEL_EXCEPTION_FILTER aPreviousFilter;
OSD_Environment env ("CSF_DEBUG_MODE");
@@ -382,6 +383,7 @@ void OSD::SetSignal (const Standard_Boolean theFloatingSignal)
// Replaces the existing top-level exception filter for all existing and all future threads
// in the calling process
aPreviousFilter = ::SetUnhandledExceptionFilter (/*(LPTOP_LEVEL_EXCEPTION_FILTER)*/ WntHandler);
#endif // NTDDI_WIN10_TH2
// Signal handlers will only be used when the method ::raise() will be used
// Handlers must be set for every thread