summaryrefslogtreecommitdiffstats
path: root/gpu/demos/framework/main_exe.cc
blob: 296d164e1015db9b35059540923650b821c30248 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "gpu/demos/framework/window.h"
#include "ui/gfx/gl/gl_surface.h"

#if defined(TOOLKIT_USES_GTK)
#include <gtk/gtk.h>
#endif  // TOOLKIT_USES_GTK

namespace {
static const int kWindowWidth = 512;
static const int kWindowHeight = 512;
}  // namespace.

int main(int argc, char** argv) {
#if defined(TOOLKIT_USES_GTK)
  gtk_init(&argc, &argv);
#endif  // TOOLKIT_USES_GTK

  // AtExitManager is used by singleton classes to delete themselves when
  // the program terminates.
  base::AtExitManager at_exit_manager_;

  CommandLine::Init(argc, argv);

  gfx::GLSurface::InitializeOneOff();

  gpu::demos::Window window;
  CHECK(window.Init(kWindowWidth, kWindowHeight));

  window.MainLoop();
  return EXIT_SUCCESS;
}