# DRAWEXE excluded when library build is static
if (NOT BUILD_SHARED_LIBS)
list (REMOVE_ITEM BUILD_TOOLKITS DRAWEXE)
- #list (REMOVE_ITEM BUILD_TOOLKITS DRAWBUNDLE)
+ #if (EMSCRIPTEN)
+ # list (REMOVE_ITEM BUILD_TOOLKITS DRAWBUNDLE)
+ #endif()
message (STATUS "Info: DRAWEXE is not included due to ${BUILD_LIBRARY_TYPE} build library type")
endif()
message (STATUS "Info: TCL is used by OCCT")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tcl")
- message (STATUS "Info: TK is used by OCCT")
- OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tk")
+ if (NOT EMSCRIPTEN)
+ message (STATUS "Info: TK is used by OCCT")
+ OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tk")
+ endif()
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TCL")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TK")
OCCT_CHECK_AND_UNSET (OpenGlLibs_LIB)
endif()
+ elseif (EMSCRIPTEN)
+ set (CSF_ThreadLibs "pthread rt stdc++")
+ set (CSF_OpenGlesLibs "EGL GLESv2")
+ set (CSF_dl "dl")
elseif (ANDROID)
set (CSF_ThreadLibs "c")
set (CSF_OpenGlesLibs "EGL GLESv2")
install (TARGETS ${PROJECT_NAME}
DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
+
+ if (EMSCRIPTEN)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.wasm DESTINATION "${INSTALL_DIR_BIN}/${OCCT_INSTALL_BIN_LETTER}")
+ endif()
else()
add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RESOURCE_FILES} ${${PROJECT_NAME}_MOC_FILES})
set "aCmakeBin="
set "aFreeType="
set "aRapidJson="
+set "aTcl="
rem Build stages to perform
set "toCMake=1"
set "BUILD_Visualization=ON"
set "BUILD_ApplicationFramework=ON"
set "BUILD_DataExchange=ON"
+set "BUILD_Draw=OFF"
rem Optional 3rd-party libraries to enable
set "USE_RAPIDJSON=OFF"
-D BUILD_MODULE_Visualization:BOOL="%BUILD_Visualization%" ^
-D BUILD_MODULE_ApplicationFramework:BOOL="%BUILD_ApplicationFramework%" ^
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
- -D BUILD_MODULE_Draw:BOOL="OFF" ^
+ -D BUILD_MODULE_Draw:BOOL="%BUILD_Draw%" ^
-D BUILD_DOC_Overview:BOOL="OFF" ^
-D USE_RAPIDJSON:BOOL="%USE_RAPIDJSON%" ^
-D 3RDPARTY_RAPIDJSON_DIR:PATH="%aRapidJson%" ^
-D 3RDPARTY_RAPIDJSON_INCLUDE_DIR:PATH="%aRapidJson%/include" ^
+ -D 3RDPARTY_TCL_DIR:PATH="%aTcl%" ^
+ -D 3RDPARTY_TCL_INCLUDE_DIR:PATH="%aTcl%/include" ^
+ -D 3RDPARTY_TCL_LIBRARY_DIR:PATH="%aTcl%/lib" ^
+ -D 3RDPARTY_TCL_LIBRARY:FILEPATH="%aTcl%/lib/libtcl.a" ^
"%aCasSrc%"
if errorlevel 1 (
set (EXECUTABLE_PROJECT ON)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
+
+if (EMSCRIPTEN)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s WASM=1")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s MAX_WEBGL_VERSION=2")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s ALLOW_MEMORY_GROWTH=1")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --bind")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s TOTAL_MEMORY=512MB")
+
+ #set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s MODULARIZE=1")
+ #set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s EXPORT_NAME='createDRAWEXE'")
+ #set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s EXTRA_EXPORTED_RUNTIME_METHODS=['ccall','cwrap']")
+endif()
+
unset (EXECUTABLE_PROJECT)
#include <Draw.hxx>
#include <DBRep.hxx>
#include <DrawTrSurf.hxx>
+#include <Message.hxx>
+#include <Message_PrinterSystemLog.hxx>
#include <BOPTest.hxx>
#include <DPrsStd.hxx>
#include <XSDRAWSTLVRML.hxx>
#include <XDEDRAW.hxx>
+#if defined(__EMSCRIPTEN__)
+#include <emscripten/bind.h>
+
+class DRAWEXE
+{
+public:
+ static int eval (const std::string& theCode)
+ {
+Message::SendInfo() << "DRAWEXE::eval(" << theCode.c_str() << ")"; ///
+ return Draw::GetInterpretor().Eval (theCode.c_str());
+ }
+};
+
+EMSCRIPTEN_BINDINGS(DRAWEXE) {
+ emscripten::function("eval", &DRAWEXE::eval);
+}
+#endif
+
//=======================================================================
//function : Draw_InitAppli
//purpose :
void Draw_InitAppli (Draw_Interpretor& di)
{
+#if defined(__EMSCRIPTEN__)
+ Message_Gravity aGravity = Message_Trace;
+ Message::DefaultMessenger()->Printers().First()->SetTraceLevel (aGravity);
+ Handle(Message_PrinterSystemLog) aJSConsolePrinter = new Message_PrinterSystemLog ("DRAWEXE", aGravity);
+ Message::DefaultMessenger()->AddPrinter (aJSConsolePrinter); // open JavaScript console within the Browser to see this output
+Message::SendInfo ("Hello #1"); ///
+#endif
+
Draw::Commands (di);
DBRep::BasicCommands (di);
DrawTrSurf::BasicCommands (di);
//OpenGlesTest::Factory (di);
//D3DHostTest::Factory (di);
//IVtkDraw::Factory (di);
+Message::SendInfo ("Hello #2"); ///
}
#include <Draw_Main.hxx>
CSF_Appkit
CSF_IOKit
CSF_winmm
+CSF_ThreadLibs
return;
}
Flush();
-#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
+#ifdef _WIN32
+ HANDLE hWnd;
+
+ id = MAXVIEW; //:abv 29.05.02: cycle for working in console mode
+ while (id >= MAXVIEW)
+ {
+ if (wait)
+ {
+ Draw_Window::SelectWait (hWnd, X, Y, Button);
+ }
+ else
+ {
+ Draw_Window::SelectNoWait (hWnd, X, Y, Button);
+ }
+
+ // Recherche du numero de la vue grace au HANDLE
+ for (int i = 0; i < MAXVIEW; ++i)
+ {
+ if (myViews[i] && myViews[i]->win == hWnd ) { id = i; }
+ }
+ }
+ X = X - myViews[id]->GetDx();
+ Y = -Y - myViews[id]->GetDy();
+#elif defined(__EMSCRIPTEN__) || defined(__ANDROID__)
+ /// TODO
+ (void )wait;
+#elif !defined(__APPLE__) || defined(MACOSX_USE_GLX)
+ id = MAXVIEW;
+ while (id >= MAXVIEW)
+ {
+ Standard_Integer aWindowNumber = 0;
+ GetNextEvent (wait, aWindowNumber, X, Y, Button);
+ if (Y < 0)
+ {
+ continue; // mouse clicked on window title
+ }
+
+ for (Standard_Integer anIter = 0; anIter < MAXVIEW; anIter++)
+ {
+ if (myViews[anIter] && myViews[anIter]->IsEqualWindows (aWindowNumber))
+ {
+ id = anIter;
+ }
+ }
+ }
+
+ X = X - myViews[id]->GetDx();
+ Y = -Y - myViews[id]->GetDy();
+#else
if (!wait) {
if (id >=0 && id < MAXVIEW) {
if (myViews[id]) myViews[id]->Wait(wait);
Y = -Y - myViews[id]->GetDy();
}
if (!wait) myViews[id]->Wait(!wait);
-#elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
- Standard_Integer aWindowNumber;
-
- id = MAXVIEW;
- while (id >= MAXVIEW)
- {
- GetNextEvent(wait, aWindowNumber, X, Y, Button);
-
- if (Y < 0)
- {
- continue; // mouse clicked on window title
- }
-
- for (Standard_Integer anIter = 0; anIter < MAXVIEW; anIter++)
- {
- if (myViews[anIter] && myViews[anIter]->IsEqualWindows (aWindowNumber))
- {
- id = anIter;
- }
- }
- }
-
- X = X - myViews[id]->GetDx();
- Y = -Y - myViews[id]->GetDy();
-
-#else
- HANDLE hWnd;
-
- id = MAXVIEW; //:abv 29.05.02: cycle for working in console mode
- while ( id >= MAXVIEW ) {
- if (wait)
- Draw_Window::SelectWait(hWnd, X, Y, Button);
- else
- Draw_Window::SelectNoWait(hWnd, X, Y, Button);
-
- // Recherche du numero de la vue grace au HANDLE
- for(int i=0 ; i<MAXVIEW ; i++)
- if (myViews[i] && myViews[i]->win == hWnd ) id = i;
- }
- X = X - myViews[id]->GetDx();
- Y = -Y - myViews[id]->GetDy();
#endif
}
//======================================================
Draw_Window* Draw_Window::firstWindow = NULL;
+#if defined(__EMSCRIPTEN__) || defined(__ANDROID__)
+ /// TODO
+Draw_Window::Draw_Window()
+: myWindow (NULL),
+ myView (NULL),
+ myImageBuffer (NULL),
+ myUseBuffer (false),
+ nextWindow (firstWindow),
+ previousWindow (NULL)
+{
+ if (firstWindow != NULL) firstWindow->previousWindow = this;
+ firstWindow = this;
+ (void )myWindow; (void )myView; (void )myImageBuffer; (void )myUseBuffer;
+}
+
+Draw_Window::Draw_Window (Standard_CString theTitle,
+ const Standard_Integer& theXLeft, const Standard_Integer& theYTop,
+ const Standard_Integer& theWidth, const Standard_Integer& theHeight)
+: myWindow (NULL),
+ myView (NULL),
+ myImageBuffer (NULL),
+ myUseBuffer (false),
+ nextWindow (firstWindow),
+ previousWindow (NULL)
+{
+ if (firstWindow != NULL) firstWindow->previousWindow = this;
+ firstWindow = this;
+ Init (theXLeft, theYTop, theWidth, theHeight);
+ SetTitle (theTitle);
+}
+
+Draw_Window::Draw_Window (NSWindow* , Standard_CString theTitle,
+ const Standard_Integer& theXLeft, const Standard_Integer& theYTop,
+ const Standard_Integer& theWidth, const Standard_Integer& theHeight)
+: myWindow (NULL),
+ myView (NULL),
+ myImageBuffer (NULL),
+ myUseBuffer (false),
+ nextWindow (firstWindow),
+ previousWindow (NULL)
+{
+ if (firstWindow != NULL) firstWindow->previousWindow = this;
+ firstWindow = this;
+ Init (theXLeft, theYTop, theWidth, theHeight);
+ SetTitle (theTitle);
+}
+
+Draw_Window::~Draw_Window()
+{
+ if (previousWindow != NULL)
+ {
+ previousWindow->nextWindow = nextWindow;
+ }
+ else
+ {
+ firstWindow = nextWindow;
+ }
+
+ if (nextWindow != NULL)
+ {
+ nextWindow->previousWindow = previousWindow;
+ }
+}
+void Draw_Window::Init (const Standard_Integer& , const Standard_Integer& , const Standard_Integer& , const Standard_Integer& ) {}
+void Draw_Window::InitBuffer() {}
+void Draw_Window::SetPosition (const Standard_Integer& , const Standard_Integer& ) {}
+void Draw_Window::SetDimension (const Standard_Integer& , const Standard_Integer& ) {}
+void Draw_Window::GetPosition (Standard_Integer& thePosX, Standard_Integer& thePosY) { thePosX = 0; thePosY = 0; }
+Standard_Integer Draw_Window::HeightWin() const { return 1; }
+Standard_Integer Draw_Window::WidthWin() const { return 1; }
+void Draw_Window::SetTitle (const TCollection_AsciiString& ) {}
+TCollection_AsciiString Draw_Window::GetTitle() const { return ""; }
+Standard_Boolean Draw_Window::DefineColor (const Standard_Integer& , Standard_CString ) { return Standard_True; }
+bool Draw_Window::IsMapped() const { return false; }
+void Draw_Window::DisplayWindow() {}
+void Draw_Window::Hide() {}
+void Draw_Window::Destroy() {}
+void Draw_Window::Clear() {}
+void Draw_Window::Flush() {}
+void Draw_Window::DrawString (const Standard_Integer& , const Standard_Integer& , char* ) {}
+void Draw_Window::DrawSegments (Segment* , const Standard_Integer& ) {}
+void Draw_Window::Redraw() {}
+void Draw_Window::SetColor (const Standard_Integer& theColor) { myCurrentColor = theColor; }
+void Draw_Window::SetMode (const Standard_Integer& ) {}
+Standard_Boolean Draw_Window::Save (Standard_CString ) const { return false; }
+Standard_Boolean Draw_Window::IsEqualWindows (const Standard_Integer& ) { return false; }
+
+#elif !defined(__APPLE__) || defined(MACOSX_USE_GLX)
// X11 specific part
-#if !defined(__APPLE__) || defined(MACOSX_USE_GLX)
#include <X11/Xutil.h>
#include <Aspect_DisplayConnection.hxx>
}
// Create a handler for the draw display
-#if !defined(__APPLE__) || defined(MACOSX_USE_GLX)
+#if (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__EMSCRIPTEN__) && !defined(__ANDROID__)
Tcl_CreateFileHandler (ConnectionNumber(Draw_WindowDisplay), TCL_READABLE, ProcessEvents, (ClientData) 0);
#endif // __APPLE__
Tk_GeometryRequest (aMainWindow, 200, 200);
#endif
-#if !defined(__APPLE__) || defined(MACOSX_USE_GLX)
+#if (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__EMSCRIPTEN__) && !defined(__ANDROID__)
if (Draw_DisplayConnection.IsNull())
{
try
#include <Standard_Integer.hxx>
#include <TCollection_AsciiString.hxx>
-#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
+#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__EMSCRIPTEN__) && !defined(__ANDROID__)
const Standard_Integer MAXCOLOR = 15;
//======================================================
void GetNextEvent(Event&);
-#elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
+#elif (defined(__APPLE__) && !defined(MACOSX_USE_GLX)) || defined(__EMSCRIPTEN__) || defined(__ANDROID__)
const Standard_Integer MAXCOLOR = 15;
#include <WNT_HIDSpaceMouse.hxx>
#elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
#include <Cocoa_Window.hxx>
+#elif defined(__EMSCRIPTEN__) || defined(__ANDROID__)
+ /// TODO
+ #include <Aspect_NeutralWindow.hxx>
#else
#include <Xw_Window.hxx>
#include <X11/Xlib.h> /* contains some dangerous #defines such as Status, True etc. */
#include <X11/Xutil.h>
- #ifdef HAVE_TK
- #include <tk.h>
- #endif
#endif
//==============================================================================
extern ViewerTest_DoubleMapOfInteractiveAndName& GetMapOfAIS();
#if defined(_WIN32)
-static Handle(WNT_Window)& VT_GetWindow() {
- static Handle(WNT_Window) WNTWin;
- return WNTWin;
-}
+typedef WNT_Window ViewerTest_Window;
#elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
-static Handle(Cocoa_Window)& VT_GetWindow()
-{
- static Handle(Cocoa_Window) aWindow;
- return aWindow;
-}
+typedef Cocoa_Window ViewerTest_Window;
+
extern void ViewerTest_SetCocoaEventManagerView (const Handle(Cocoa_Window)& theWindow);
extern void GetCocoaScreenResolution (Standard_Integer& theWidth, Standard_Integer& theHeight);
-
+#elif defined(__EMSCRIPTEN__) || defined(__ANDROID__)
+typedef Aspect_NeutralWindow ViewerTest_Window;
#else
-static Handle(Xw_Window)& VT_GetWindow(){
- static Handle(Xw_Window) XWWin;
- return XWWin;
-}
+typedef Xw_Window ViewerTest_Window;
static void VProcessEvents(ClientData,int);
#endif
+static Handle(ViewerTest_Window)& VT_GetWindow()
+{
+ static Handle(ViewerTest_Window) aWindow;
+ return aWindow;
+}
+
static Handle(Aspect_DisplayConnection)& GetDisplayConnection()
{
static Handle(Aspect_DisplayConnection) aDisplayConnection;
if (isNewDriver)
{
// Get connection string
- #if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
+ #if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__EMSCRIPTEN__) && !defined(__ANDROID__)
if (!theDisplayName.IsEmpty())
{
SetDisplayConnection (new Aspect_DisplayConnection (theDisplayName));
{
::Display* aDispX = NULL;
// create dedicated display connection instead of reusing Tk connection
- // so that to procede events independently through VProcessEvents()/ViewerMainLoop() callbacks
+ // so that to proceed events independently through VProcessEvents()/ViewerMainLoop() callbacks
/*Draw_Interpretor& aCommands = Draw::GetInterpretor();
Tcl_Interp* aTclInterp = aCommands.Interp();
Tk_Window aMainWindow = Tk_MainWindow (aTclInterp);
aScreenWidth = aWindowSize.right;
#elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
GetCocoaScreenResolution (aScreenWidth, aScreenHeight);
+#elif defined(__EMSCRIPTEN__) || defined(__ANDROID__)
+ /// TODO
#else
Screen *aScreen = DefaultScreenOfDisplay(GetDisplayConnection()->GetDisplay());
aScreenWidth = WidthOfScreen(aScreen);
aPxLeft, aPxTop,
aPxWidth, aPxHeight);
ViewerTest_SetCocoaEventManagerView (VT_GetWindow());
+#elif defined(__EMSCRIPTEN__) || defined(__ANDROID__)
+ /// TODO
+ VT_GetWindow() = new Aspect_NeutralWindow();
+ VT_GetWindow()->SetSize (aPxWidth, aPxHeight);
#else
VT_GetWindow() = new Xw_Window (aGraphicDriver->GetDisplayConnection(),
aTitle.ToCString(),
a3DViewer->SetLightOn();
}
-#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
+#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__EMSCRIPTEN__) && !defined(__ANDROID__)
if (isNewDriver)
{
::Display* aDispX = GetDisplayConnection()->GetDisplay();
}
}
-#if defined(_WIN32) || (defined(__APPLE__) && !defined(MACOSX_USE_GLX))
+#if defined(_WIN32) || (defined(__APPLE__) && !defined(MACOSX_USE_GLX)) || defined(__EMSCRIPTEN__) || defined(__ANDROID__)
if (!aDisplayName.IsEmpty())
{
aDisplayName.Clear();
VT_GetWindow() = Handle(WNT_Window)::DownCast(ViewerTest::CurrentView()->Window());
#elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
VT_GetWindow() = Handle(Cocoa_Window)::DownCast(ViewerTest::CurrentView()->Window());
+#elif defined(__EMSCRIPTEN__) || defined(__ANDROID__)
+ VT_GetWindow() = Handle(Aspect_NeutralWindow)::DownCast(ViewerTest::CurrentView()->Window());
#else
VT_GetWindow() = Handle(Xw_Window)::DownCast(ViewerTest::CurrentView()->Window());
#endif
aView->Window()->Unmap();
aView->Remove();
-#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
+#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__EMSCRIPTEN__) && !defined(__ANDROID__)
XFlush (GetDisplayConnection()->GetDisplay());
#endif
if(isRemoveDriver)
{
ViewerTest_myDrivers.UnBind2 (aCurrentContext->CurrentViewer()->Driver());
- #if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
+ #if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__EMSCRIPTEN__) && !defined(__ANDROID__)
Tcl_DeleteFileHandler (XConnectionNumber (aCurrentContext->CurrentViewer()->Driver()->GetDisplayConnection()->GetDisplay()));
#endif
}
return 0;
}
-#elif !defined(__APPLE__) || defined(MACOSX_USE_GLX)
+#elif defined(__EMSCRIPTEN__) || defined(__ANDROID__)
-int min( int a, int b )
+ /// TODO
+// =======================================================================
+// function : ViewerMainLoop
+// purpose :
+// =======================================================================
+int ViewerMainLoop (Standard_Integer , const char** )
{
- if( a<b )
- return a;
- else
- return b;
+ // unused
+ return 0;
}
-int max( int a, int b )
-{
- if( a>b )
- return a;
- else
- return b;
-}
+#elif !defined(__APPLE__) || defined(MACOSX_USE_GLX)
int ViewerMainLoop (Standard_Integer theNbArgs, const char** theArgVec)
{
//==============================================================================
//function : OSWindowSetup
-//purpose : Setup for the X11 window to be able to cath the event
+//purpose : Setup for the X11 window to be able to catch the event
//==============================================================================
-
-
static void OSWindowSetup()
{
-#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
+#ifdef _WIN32
+ //
+#elif defined(__EMSCRIPTEN__) || defined(__ANDROID__)
+ //
+#elif (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
// X11
-
- Window window = VT_GetWindow()->XWindow();
+ Window anXWin = VT_GetWindow()->XWindow();
SetDisplayConnection (ViewerTest::CurrentView()->Viewer()->Driver()->GetDisplayConnection());
- Display *aDisplay = GetDisplayConnection()->GetDisplay();
- XSynchronize(aDisplay, 1);
+ Display* aDisplay = GetDisplayConnection()->GetDisplay();
+ XSynchronize (aDisplay, 1);
// X11 : For keyboard on SUN
- XWMHints wmhints;
- wmhints.flags = InputHint;
- wmhints.input = 1;
-
- XSetWMHints( aDisplay, window, &wmhints);
-
- XSelectInput( aDisplay, window, ExposureMask | KeyPressMask | KeyReleaseMask |
- ButtonPressMask | ButtonReleaseMask |
- StructureNotifyMask |
- PointerMotionMask |
- Button1MotionMask | Button2MotionMask |
- Button3MotionMask | FocusChangeMask
- );
- Atom aDeleteWindowAtom = GetDisplayConnection()->GetAtom(Aspect_XA_DELETE_WINDOW);
- XSetWMProtocols(aDisplay, window, &aDeleteWindowAtom, 1);
-
- XSynchronize(aDisplay, 0);
-
-#else
- // _WIN32
+ XWMHints aWmHints = {};
+ aWmHints.flags = InputHint;
+ aWmHints.input = 1;
+ XSetWMHints (aDisplay, anXWin, &aWmHints);
+
+ XSelectInput (aDisplay, anXWin,
+ ExposureMask | KeyPressMask | KeyReleaseMask
+ | ButtonPressMask | ButtonReleaseMask
+ | StructureNotifyMask
+ | PointerMotionMask
+ | Button1MotionMask | Button2MotionMask
+ | Button3MotionMask | FocusChangeMask);
+ Atom aDeleteWindowAtom = GetDisplayConnection()->GetAtom (Aspect_XA_DELETE_WINDOW);
+ XSetWMProtocols (aDisplay, anXWin, &aDeleteWindowAtom, 1);
+
+ XSynchronize (aDisplay, 0);
#endif
-
}
//==============================================================================