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

Function main

examples/SimpleOpenGL3/main_imgui.cpp:280–523  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

278}
279
280int main(int argc, char* argv[])
281{
282 {
283 b3CommandLineArgs myArgs(argc, argv);
284
285 app = new SimpleOpenGLApp("SimpleOpenGLApp", gWidth, gHeight);
286
287 {
288 GLint err = glGetError();
289 assert(err == GL_NO_ERROR);
290 }
291
292 ImGui::CreateContext();
293
294 {
295 GLint err = glGetError();
296 assert(err == GL_NO_ERROR);
297 }
298
299 app->m_renderer->getActiveCamera()->setCameraDistance(13);
300 app->m_renderer->getActiveCamera()->setCameraPitch(0);
301 app->m_renderer->getActiveCamera()->setCameraTargetPosition(0, 0, 0);
302
303 {
304 GLint err = glGetError();
305 assert(err == GL_NO_ERROR);
306 }
307
308 sOldKeyboardCB = app->m_window->getKeyboardCallback();
309 app->m_window->setKeyboardCallback(MyKeyboardCallback);
310 sOldMouseMoveCB = app->m_window->getMouseMoveCallback();
311 app->m_window->setMouseMoveCallback(MyMouseMoveCallback);
312 sOldMouseButtonCB = app->m_window->getMouseButtonCallback();
313 app->m_window->setMouseButtonCallback(MyMouseButtonCallback);
314 sOldWheelCB = app->m_window->getWheelCallback();
315 app->m_window->setWheelCallback(MyWheelCallback);
316 sOldResizeCB = app->m_window->getResizeCallback();
317 app->m_window->setResizeCallback(MyResizeCallback);
318
319 myArgs.GetCmdLineArgument("mp4_file", gVideoFileName);
320 if (gVideoFileName)
321 app->dumpFramesToVideo(gVideoFileName);
322
323 myArgs.GetCmdLineArgument("png_file", gPngFileName);
324 char fileName[1024];
325
326 int textureWidth = 128;
327 int textureHeight = 128;
328
329 unsigned char* image = new unsigned char[textureWidth * textureHeight * 4];
330
331 int textureHandle = app->m_renderer->registerTexture(image, textureWidth, textureHeight);
332
333 int cubeIndex = app->registerCubeShape(1, 1, 1);
334
335 b3Vector3 pos = b3MakeVector3(0, 0, 0);
336 b3Quaternion orn(0, 0, 0, 1);
337 b3Vector3 color = b3MakeVector3(1, 0, 0);

Callers

nothing calls this directly

Calls 15

b3MakeVector3Function · 0.85
ImColorClass · 0.85
ImVec2Class · 0.85
ButtonClass · 0.85
setCameraPitchMethod · 0.80
CheckboxFunction · 0.50
RenderFunction · 0.50
setCameraDistanceMethod · 0.45
getActiveCameraMethod · 0.45
getKeyboardCallbackMethod · 0.45

Tested by

no test coverage detected