| 837 | #include "EmptyExample.h" |
| 838 | |
| 839 | bool OpenGLExampleBrowser::init(int argc, char* argv[]) |
| 840 | { |
| 841 | b3CommandLineArgs args(argc, argv); |
| 842 | |
| 843 | loadCurrentSettings(startFileName, args); |
| 844 | if (args.CheckCmdLineFlag("nogui")) |
| 845 | { |
| 846 | renderGrid = false; |
| 847 | renderGui = false; |
| 848 | } |
| 849 | if (args.CheckCmdLineFlag("tracing")) |
| 850 | { |
| 851 | b3ChromeUtilsStartTimings(); |
| 852 | } |
| 853 | args.GetCmdLineArgument("fixed_timestep", gFixedTimeStep); |
| 854 | args.GetCmdLineArgument("png_skip_frames", gPngSkipFrames); |
| 855 | ///The OpenCL rigid body pipeline is experimental and |
| 856 | ///most OpenCL drivers and OpenCL compilers have issues with our kernels. |
| 857 | ///If you have a high-end desktop GPU such as AMD 7970 or better, or NVIDIA GTX 680 with up-to-date drivers |
| 858 | ///you could give it a try |
| 859 | ///Note that several old OpenCL physics examples still have to be ported over to this new Example Browser |
| 860 | if (args.CheckCmdLineFlag("enable_experimental_opencl")) |
| 861 | { |
| 862 | enable_experimental_opencl = true; |
| 863 | gAllExamples->initOpenCLExampleEntries(); |
| 864 | } |
| 865 | |
| 866 | if (args.CheckCmdLineFlag("disable_retina")) |
| 867 | { |
| 868 | gAllowRetina = false; |
| 869 | } |
| 870 | |
| 871 | int width = 1024; |
| 872 | int height = 768; |
| 873 | |
| 874 | if (args.CheckCmdLineFlag("width")) |
| 875 | { |
| 876 | args.GetCmdLineArgument("width", width); |
| 877 | } |
| 878 | if (args.CheckCmdLineFlag("height")) |
| 879 | { |
| 880 | args.GetCmdLineArgument("height", height); |
| 881 | } |
| 882 | |
| 883 | #ifndef NO_OPENGL3 |
| 884 | SimpleOpenGL3App* simpleApp = 0; |
| 885 | sUseOpenGL2 = args.CheckCmdLineFlag("opengl2"); |
| 886 | args.GetCmdLineArgument("render_device", gRenderDevice); |
| 887 | args.GetCmdLineArgument("window_backend", gWindowBackend); |
| 888 | #else |
| 889 | sUseOpenGL2 = true; |
| 890 | #endif |
| 891 | const char* appTitle = "Bullet Physics ExampleBrowser"; |
| 892 | #if defined(_DEBUG) || defined(DEBUG) |
| 893 | const char* optMode = "Debug build (slow)"; |
| 894 | #else |
| 895 | const char* optMode = "Release build"; |
| 896 | #endif |
no test coverage detected