add example to use BasicDemo with an OpenGL Window, without example browser
This commit is contained in:
@@ -20,7 +20,40 @@ subject to the following restrictions:
|
||||
#include "../CommonInterfaces/CommonGUIHelperInterface.h"
|
||||
|
||||
|
||||
#ifdef USE_GUI
|
||||
#include "../OpenGLWindow/SimpleOpenGL3App.h"
|
||||
#include <stdio.h>
|
||||
#include "../ExampleBrowser/OpenGLGuiHelper.h"
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
||||
SimpleOpenGL3App* app = new SimpleOpenGL3App("BasicDemoGui",1024,768,true);
|
||||
OpenGLGuiHelper gui(app,false);
|
||||
CommonExampleOptions options(&gui);
|
||||
CommonExampleInterface* example = BasicExampleCreateFunc(options);
|
||||
|
||||
example->initPhysics();
|
||||
|
||||
int frameCount = 0;
|
||||
do
|
||||
{
|
||||
app->m_instancingRenderer->init();
|
||||
app->m_instancingRenderer->updateCamera();
|
||||
example->stepSimulation(1./60.);
|
||||
example->renderScene();
|
||||
app->drawGrid();
|
||||
app->swapBuffer();
|
||||
} while (!app->m_window->requestedExit());
|
||||
|
||||
example->exitPhysics();
|
||||
delete example;
|
||||
delete app;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
@@ -38,4 +71,5 @@ int main(int argc, char* argv[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -20,3 +20,38 @@ files {
|
||||
"**.h",
|
||||
}
|
||||
|
||||
|
||||
project "App_BasicExampleGui"
|
||||
|
||||
if _OPTIONS["ios"] then
|
||||
kind "WindowedApp"
|
||||
else
|
||||
kind "ConsoleApp"
|
||||
end
|
||||
defines {"USE_GUI"}
|
||||
|
||||
includedirs {"../../src"}
|
||||
|
||||
links {
|
||||
"BulletDynamics","BulletCollision", "LinearMath", "OpenGL_Window","Bullet3Common"
|
||||
}
|
||||
|
||||
initOpenGL()
|
||||
initGlew()
|
||||
|
||||
|
||||
language "C++"
|
||||
|
||||
files {
|
||||
"**.cpp",
|
||||
"**.h",
|
||||
"../ExampleBrowser/OpenGLGuiHelper.cpp",
|
||||
"../ExampleBrowser/GL_ShapeDrawer.cpp"
|
||||
}
|
||||
|
||||
if os.is("Linux") then initX11() end
|
||||
|
||||
if os.is("MacOSX") then
|
||||
links{"Cocoa.framework"}
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user