~glmark2-dev/glmark2/trunk

« back to all changes in this revision

Viewing changes to src/main.cpp

  • Committer: Jesse Barker
  • Date: 2012-01-27 22:11:59 UTC
  • mfrom: (192.1.9 libmatrix-util)
  • Revision ID: jesse.barker@linaro.org-20120127221159-vimmeszc0g2b1t76
Merge of lp:~glmark2-dev/glmark2/libmatrix-util.

This brings glmark2 up to date with the current libmatrix, including a couple of
new features that resulted from the actual integration.  The primary result is
that previously duplicated code is now consolidated in one common place
(lp:libmatrix).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * Copyright © 2008 Ben Smith
3
 
 * Copyright © 2010-2011 Linaro Limited
 
3
 * Copyright © 2010-2012 Linaro Limited
4
4
 *
5
5
 * This file is part of the glmark2 OpenGL (ES) 2.0 benchmark.
6
6
 *
20
20
 * Authors:
21
21
 *  Ben Smith (original glmark benchmark)
22
22
 *  Alexandros Frantzis (glmark2)
 
23
 *  Jesse Barker (glmark2)
23
24
 */
24
25
#include "gl-headers.h"
25
26
#include "scene.h"
177
178
    unsigned score = 0;
178
179
    unsigned int last_fps = 0;
179
180
    unsigned int benchmarks_run = 0;
 
181
    static const string format(Log::continuation_prefix + " FPS: %u\n");
180
182
 
181
183
    for (vector<Benchmark *>::iterator bench_iter = benchmarks.begin();
182
184
         bench_iter != benchmarks.end();
219
221
                canvas.update();
220
222
            }
221
223
 
222
 
            Log::info(LOG_CONTINUE" FPS: %u\n", scene.average_fps());
 
224
            Log::info(format.c_str(), scene.average_fps());
223
225
            score += scene.average_fps();
224
226
            benchmarks_run++;
225
227
        }
242
244
void
243
245
do_validation(Canvas &canvas, vector<Benchmark *> &benchmarks)
244
246
{
 
247
    static const string format(Log::continuation_prefix + " Validation: %s\n");
245
248
    for (vector<Benchmark *>::iterator bench_iter = benchmarks.begin();
246
249
         bench_iter != benchmarks.end();
247
250
         bench_iter++)
275
278
                    break;
276
279
            }
277
280
 
278
 
            Log::info(LOG_CONTINUE" Validation: %s\n", result.c_str());
 
281
            Log::info(format.c_str(), result.c_str());
279
282
        }
280
283
 
281
284
        bench->teardown_scene();
289
292
    if (!Options::parse_args(argc, argv))
290
293
        return 1;
291
294
 
 
295
    /* Initialize Log class */
 
296
    Log::init(Util::appname_from_path(argv[0]), Options::show_debug);
 
297
 
292
298
    if (Options::show_help) {
293
299
        Options::print_help();
294
300
        return 0;