MCPcopy Create free account
hub / github.com/cginternals/glbinding / compare

Function compare

source/examples/comparison/main.cpp:24–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22
23
24void compare()
25{
26 const int ITERATIONS = 8192;
27 const int ITERATIONS_WARMUP = ITERATIONS / 32;
28
29
30 Timer timer;
31
32 std::cout << std::endl << "test: initialize bindings ..." << std::endl;
33
34 timer.start(" glbinding ");
35 glbinding_init();
36
37 timer.restart(" glew ");
38 glew_init();
39
40 timer.stop();
41
42
43 std::cout << std::endl
44 << "OpenGL Version: " << glbinding::aux::ContextInfo::version() << std::endl
45 << "OpenGL Vendor: " << glbinding::aux::ContextInfo::vendor() << std::endl
46 << "OpenGL Renderer: " << glbinding::aux::ContextInfo::renderer() << std::endl;
47
48
49 std::cout << std::endl << "prep: warm-up ..." << std::endl;
50 std::this_thread::sleep_for(std::chrono::seconds(1));
51
52 std::cout << " glew " << std::endl;
53 for (int i = 0; i < ITERATIONS_WARMUP; ++i)
54 glew_test();
55
56 std::cout << " glbinding " << std::endl;
57 for (int i = 0; i < ITERATIONS_WARMUP; ++i)
58 glbinding_test();
59
60 timer.setSteps(24 * ITERATIONS);
61
62
63 std::cout << std::endl << "test: average call times for " << ITERATIONS << " x 24 calls ..." << std::endl;
64
65 timer.start(" glew ");
66 for (int i = 0; i < ITERATIONS; ++i)
67 glew_test();
68
69 long double glew_avg = timer.restart(" glbinding ");
70
71 for (int i = 0; i < ITERATIONS; ++i)
72 glbinding_test();
73
74 long double glbinding_avg = timer.stop();
75
76
77 std::cout << std::endl << "test: again, now with error checking ..." << std::endl;
78
79 glew_error(true);
80 glbinding_error(true);
81

Callers 1

mainFunction · 0.85

Calls 12

glbinding_initFunction · 0.85
glew_initFunction · 0.85
glew_testFunction · 0.85
glbinding_testFunction · 0.85
glew_errorFunction · 0.85
glbinding_errorFunction · 0.85
startFunction · 0.85
stopFunction · 0.85
startMethod · 0.80
restartMethod · 0.80
stopMethod · 0.80
setStepsMethod · 0.80

Tested by

no test coverage detected