diff --git a/Demos3/SimpleOpenGL3/main.cpp b/Demos3/SimpleOpenGL3/main.cpp new file mode 100644 index 000000000..31cce1a7f --- /dev/null +++ b/Demos3/SimpleOpenGL3/main.cpp @@ -0,0 +1,38 @@ +#include "../../btgui/OpenGLWindow/SimpleOpenGL3App.h" +#include "Bullet3Common/b3Vector3.h" +#include "assert.h" + +int main(int argc, char* argv[]) +{ + + float dt = 1./120.f; + + SimpleOpenGL3App* app = new SimpleOpenGL3App("SimpleOpenGL3App",1024,768); + app->m_instancingRenderer->setCameraDistance(13); + app->m_instancingRenderer->setCameraPitch(0); + app->m_instancingRenderer->setCameraTargetPosition(b3MakeVector3(0,0,0)); + + GLint err = glGetError(); + assert(err==GL_NO_ERROR); + + do + { + GLint err = glGetError(); + assert(err==GL_NO_ERROR); + app->m_instancingRenderer->init(); + app->m_instancingRenderer->updateCamera(); + + app->drawGrid(); + char bla[1024]; + static int frameCount = 0; + frameCount++; + sprintf(bla,"Simple test frame %d\n", frameCount); + + app->drawText(bla,10,10); + app->swapBuffer(); + } while (!app->m_window->requestedExit()); + + + delete app; + return 0; +} diff --git a/Demos3/SimpleOpenGL3/premake4.lua b/Demos3/SimpleOpenGL3/premake4.lua new file mode 100644 index 000000000..4cc5a69d5 --- /dev/null +++ b/Demos3/SimpleOpenGL3/premake4.lua @@ -0,0 +1,70 @@ + + project "App_SimpleOpenGL3" + + language "C++" + + kind "ConsoleApp" + targetdir "../../bin" + + includedirs { + ".", + "../../btgui" + } + + initOpenGL() + initGlew() + + --links{"gwen"} + + files { + "**.cpp", + "**.h", + "../../btgui/OpenGLWindow/SimpleOpenGL3App.cpp", + "../../btgui/OpenGLWindow/SimpleOpenGL3App.h", + "../../btgui/OpenGLWindow/TwFonts.cpp", + "../../btgui/OpenGLWindow/TwFonts.h", + "../../btgui/OpenGLWindow/LoadShader.cpp", + "../../btgui/OpenGLWindow/LoadShader.h", + "../../btgui/OpenGLWindow/GLPrimitiveRenderer.cpp", + "../../btgui/OpenGLWindow/GLPrimitiveRenderer.h", + "../../btgui/OpenGLWindow/GwenOpenGL3CoreRenderer.h", + "../../btgui/OpenGLWindow/GLInstancingRenderer.cpp", + "../../btgui/OpenGLWindow/GLInstancingRenderer.h", + "../../btgui/OpenGLWindow/GLRenderToTexture.cpp", + "../../btgui/OpenGLWindow/GLRenderToTexture.h", + "../../btgui/OpenGLWindow/TwFonts.cpp", + "../../btgui/OpenGLWindow/TwFonts.h", + "../../btgui/FontFiles/OpenSans.cpp", + "../../btgui/OpenGLTrueTypeFont/fontstash.cpp", + "../../btgui/OpenGLTrueTypeFont/fontstash.h", + "../../btgui/OpenGLTrueTypeFont/opengl_fontstashcallbacks.cpp", + "../../btgui/OpenGLTrueTypeFont/opengl_fontstashcallbacks.h", + "../../btgui/Bullet3Common/**.cpp", + "../../btgui/Bullet3Common/**.h", + "../../btgui/Timing/b3Clock.cpp", + "../../btgui/Timing/b3Clock.h" + + } + +if os.is("Windows") then + files { + "../../btgui/OpenGLWindow/Win32OpenGLWindow.cpp", + "../../btgui/OpenGLWindow/Win32OpenGLWindow.h", + "../../btgui/OpenGLWindow/Win32Window.cpp", + "../../btgui/OpenGLWindow/Win32Window.h", + } + end + if os.is("Linux") then + links ("X11") + files{ + "../../btgui/OpenGLWindow/X11OpenGLWindow.h", + "../../btgui/OpenGLWindow/X11OpenGLWindow.cpp" + } + end + if os.is("MacOSX") then + links{"Cocoa.framework"} + files{ + "../../btgui/OpenGLWindow/MacOpenGLWindow.mm", + "../../btgui/OpenGLWindow/MacOpenGLWindow.h", + } + end diff --git a/build3/premake4.lua b/build3/premake4.lua index 1c803ec0d..9cf51b0ad 100644 --- a/build3/premake4.lua +++ b/build3/premake4.lua @@ -108,6 +108,8 @@ if not _OPTIONS["ios"] then include "../Demos3/Wavefront" include "../btgui/MultiThreading" include "../Demos3/ImplicitCloth" +include "../Demos3/SimpleOpenGL3" + -- include "../demo/gpudemo" -- include "../btgui/MidiTest"