Summary of changes:
1) Changed include paths to be relative to the current sources (affected
files: LoadMeshFromObj.cpp, Wavefront2GLInstanceGraphicsShape.h/cpp)
2) Added new tutorials in the ExtendedTutorials folder
3) Modified the main_opengl_single_example.cpp file to enable picking
support in standalone demos
This commit is contained in:
erwincoumans
2016-05-06 15:07:54 -07:00
parent 85368973a1
commit 5151519b94
18 changed files with 1206 additions and 8 deletions

View File

@@ -31,16 +31,47 @@ subject to the following restrictions:
#include <stdio.h>
#include "../ExampleBrowser/OpenGLGuiHelper.h"
CommonExampleInterface* example;
b3MouseMoveCallback prevMouseMoveCallback = 0;
static void OnMouseMove( float x, float y)
{
bool handled = false;
handled = example->mouseMoveCallback(x,y);
if (!handled)
{
if (prevMouseMoveCallback)
prevMouseMoveCallback (x,y);
}
}
b3MouseButtonCallback prevMouseButtonCallback = 0;
static void OnMouseDown(int button, int state, float x, float y) {
bool handled = false;
handled = example->mouseButtonCallback(button, state, x,y);
if (!handled)
{
if (prevMouseButtonCallback )
prevMouseButtonCallback (button,state,x,y);
}
}
int main(int argc, char* argv[])
{
SimpleOpenGL3App* app = new SimpleOpenGL3App("Bullet Standalone Example",1024,768,true);
prevMouseButtonCallback = app->m_window->getMouseButtonCallback();
prevMouseMoveCallback = app->m_window->getMouseMoveCallback();
app->m_window->setMouseButtonCallback((b3MouseButtonCallback)OnMouseDown);
app->m_window->setMouseMoveCallback((b3MouseMoveCallback)OnMouseMove);
OpenGLGuiHelper gui(app,false);
CommonExampleOptions options(&gui);
CommonExampleInterface* example = StandaloneExampleCreateFunc(options);
example = StandaloneExampleCreateFunc(options);
example->initPhysics();