MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / SimpleOpenGL3App

Method SimpleOpenGL3App

examples/OpenGLWindow/SimpleOpenGL3App.cpp:311–460  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309bool sOpenGLVerbose = true;
310
311SimpleOpenGL3App::SimpleOpenGL3App(const char* title, int width, int height, bool allowRetina, int windowType, int renderDevice, int maxNumObjectCapacity, int maxShapeCapacityInBytes)
312{
313 gApp = this;
314
315 m_data = new SimpleInternalData;
316
317 if (windowType == 0)
318 {
319 m_window = new b3gDefaultOpenGLWindow();
320 }
321 else if (windowType == 1)
322 {
323#ifdef BT_USE_X11
324 m_window = new X11OpenGLWindow();
325#else
326 b3Warning("X11 requires Linux. Loading default window instead. \n");
327 m_window = new b3gDefaultOpenGLWindow();
328#endif
329 }
330 else if (windowType == 2)
331 {
332#ifdef BT_USE_EGL
333 m_window = new EGLOpenGLWindow();
334#else
335 b3Warning("EGL window requires compilation with BT_USE_EGL.\n");
336 b3Warning("Loading default window instead. \n");
337 m_window = new b3gDefaultOpenGLWindow();
338#endif
339 }
340 else
341 {
342 b3Warning("Unknown window type %d must be (0=default, 1=X11, 2=EGL).\n", windowType);
343 b3Warning("Loading default window instead. \n");
344 m_window = new b3gDefaultOpenGLWindow();
345 }
346
347 m_window->setAllowRetina(allowRetina);
348
349 b3gWindowConstructionInfo ci;
350 ci.m_title = title;
351 ci.m_width = width;
352 ci.m_height = height;
353 ci.m_renderDevice = renderDevice;
354 m_window->createWindow(ci);
355
356 m_window->setWindowTitle(title);
357
358 b3Assert(glGetError() == GL_NO_ERROR);
359
360 {
361 printGLString("Version", GL_VERSION);
362 printGLString("Vendor", GL_VENDOR);
363 printGLString("Renderer", GL_RENDERER);
364 }
365
366 glClearColor(m_backgroundColorRGB[0],
367 m_backgroundColorRGB[1],
368 m_backgroundColorRGB[2],

Callers

nothing calls this directly

Calls 15

exitFunction · 0.85
TwGenerateDefaultFontsFunction · 0.85
sth_createFunction · 0.85
sth_add_font_from_memoryFunction · 0.85
setScreenSizeMethod · 0.80
InitShadersMethod · 0.80
printGLStringFunction · 0.70
BindFontFunction · 0.70
setAllowRetinaMethod · 0.45
createWindowMethod · 0.45
setWindowTitleMethod · 0.45
startRenderingMethod · 0.45

Tested by

no test coverage detected