diff --git a/examples/ExampleBrowser/InProcessExampleBrowser.cpp b/examples/ExampleBrowser/InProcessExampleBrowser.cpp index 97b0761c4..1f03b7e92 100644 --- a/examples/ExampleBrowser/InProcessExampleBrowser.cpp +++ b/examples/ExampleBrowser/InProcessExampleBrowser.cpp @@ -13,7 +13,7 @@ #include "../Utils/b3Clock.h" #include "ExampleEntries.h" -#include "Bullet3Common/b3Logging.h" +#include "Bullet3Common/b3Scalar.h" #include "../SharedMemory/InProcessMemory.h" void ExampleBrowserThreadFunc(void* userPtr,void* lsMemory); @@ -22,9 +22,7 @@ void* ExampleBrowserMemoryFunc(); #include //#include "BulletMultiThreaded/PlatformDefinitions.h" -#ifndef _WIN32 -#include "../MultiThreading/b3PosixThreadSupport.h" - +#include "Bullet3Common/b3Logging.h" #include "ExampleEntries.h" #include "LinearMath/btAlignedObjectArray.h" #include "EmptyExample.h" @@ -32,6 +30,38 @@ void* ExampleBrowserMemoryFunc(); #include "../SharedMemory/PhysicsServerExample.h" #include "../SharedMemory/PhysicsClientExample.h" +#ifndef _WIN32 +#include "../MultiThreading/b3PosixThreadSupport.h" + + + +static b3ThreadSupportInterface* createExampleBrowserThreadSupport(int numThreads) +{ + b3PosixThreadSupport::ThreadConstructionInfo constructionInfo("testThreads", + ExampleBrowserThreadFunc, + ExampleBrowserMemoryFunc, + numThreads); + b3ThreadSupportInterface* threadSupport = new b3PosixThreadSupport(constructionInfo); + + return threadSupport; + +} + + + +#elif defined( _WIN32) +#include "../MultiThreading/b3Win32ThreadSupport.h" + +b3ThreadSupportInterface* createExampleBrowserThreadSupport(int numThreads) +{ + b3Win32ThreadSupport::Win32ThreadConstructionInfo threadConstructionInfo("testThreads",ExampleBrowserThreadFunc,ExampleBrowserMemoryFunc,numThreads); + b3Win32ThreadSupport* threadSupport = new b3Win32ThreadSupport(threadConstructionInfo); + return threadSupport; + +} +#endif + + @@ -162,30 +192,6 @@ const char* ExampleEntriesPhysicsServer::getExampleDescription(int index) return m_data->m_allExamples[index].m_description; } -static b3ThreadSupportInterface* createExampleBrowserThreadSupport(int numThreads) -{ - b3PosixThreadSupport::ThreadConstructionInfo constructionInfo("testThreads", - ExampleBrowserThreadFunc, - ExampleBrowserMemoryFunc, - numThreads); - b3ThreadSupportInterface* threadSupport = new b3PosixThreadSupport(constructionInfo); - - return threadSupport; - -} - - -#elif defined( _WIN32) -#include "../MultiThreading/b3Win32ThreadSupport.h" - -b3ThreadSupportInterface* createExampleBrowserThreadSupport(int numThreads) -{ - b3Win32ThreadSupport::Win32ThreadConstructionInfo threadConstructionInfo("testThreads",ExampleBrowserThreadFunc,ExampleBrowserMemoryFunc,numThreads); - b3Win32ThreadSupport* threadSupport = new b3Win32ThreadSupport(threadConstructionInfo); - return threadSupport; - -} -#endif @@ -284,6 +290,7 @@ struct btInProcessExampleBrowserInternalData }; + btInProcessExampleBrowserInternalData* btCreateInProcessExampleBrowser(int argc,char** argv2) { diff --git a/examples/ExampleBrowser/OpenGLExampleBrowser.cpp b/examples/ExampleBrowser/OpenGLExampleBrowser.cpp index c07e63a7c..5804c2c65 100644 --- a/examples/ExampleBrowser/OpenGLExampleBrowser.cpp +++ b/examples/ExampleBrowser/OpenGLExampleBrowser.cpp @@ -695,8 +695,8 @@ bool OpenGLExampleBrowser::init(int argc, char* argv[]) } - int width = 1920; - int height=1080; + int width = 1024; + int height=768; #ifndef NO_OPENGL3 SimpleOpenGL3App* simpleApp=0; sUseOpenGL2 =args.CheckCmdLineFlag("opengl2"); diff --git a/examples/OpenGLWindow/Win32OpenGLWindow.cpp b/examples/OpenGLWindow/Win32OpenGLWindow.cpp index d7571bf98..0e076b92c 100644 --- a/examples/OpenGLWindow/Win32OpenGLWindow.cpp +++ b/examples/OpenGLWindow/Win32OpenGLWindow.cpp @@ -180,6 +180,21 @@ int Win32OpenGLWindow::fileOpenDialog(char* fileName, int maxFileNameLength) //return 0; } +int Win32OpenGLWindow::getWidth() const +{ + if (m_data) + return m_data->m_openglViewportWidth; + return 0; +} + +int Win32OpenGLWindow::getHeight() const +{ + if (m_data) + return m_data->m_openglViewportHeight; + return 0; +} + + #endif diff --git a/examples/OpenGLWindow/Win32OpenGLWindow.h b/examples/OpenGLWindow/Win32OpenGLWindow.h index bf8a0f5eb..901ce6518 100644 --- a/examples/OpenGLWindow/Win32OpenGLWindow.h +++ b/examples/OpenGLWindow/Win32OpenGLWindow.h @@ -53,6 +53,9 @@ public: virtual float getRetinaScale() const {return 1.f;} virtual void setAllowRetina(bool /*allowRetina*/) {}; + virtual int getWidth() const; + virtual int getHeight() const; + virtual int fileOpenDialog(char* fileName, int maxFileNameLength); };