Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Side by Side Diff: runtime/embedders/openglui/emulator/emulator_graphics_handler.cc

Issue 11883013: Refactored OpenGL embedder that works on Android, Mac or Linux. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 #include "embedders/openglui/emulator/emulator_graphics_handler.h"
6
7 #include <stdlib.h>
8 #include <string.h>
9
10 EmulatorGraphicsHandler::EmulatorGraphicsHandler(int argc,
11 char** argv)
12 : GLGraphicsHandler() {
13 glutInit(&argc, argv);
14 width_ = 480;
15 height_ = 800;
16 for (int i = 1; i < argc; i++) {
17 if (argv[i][0] == '-') {
18 int next_arg = i + 1;
19 if (next_arg < argc && strcmp(argv[i], "-w") == 0) {
20 width_ = static_cast<size_t>(atoi(argv[i = next_arg]));
21 } else if (next_arg < argc && strcmp(argv[i], "-h") == 0) {
22 height_ = static_cast<size_t>(atoi(argv[i = next_arg]));
23 }
24 }
25 }
26 }
27
28 int32_t EmulatorGraphicsHandler::Start() {
29 glutInitWindowSize(width_, height_);
30 glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
31 glutCreateWindow("Dart");
32 return 0;
33 }
34
35 void EmulatorGraphicsHandler::Stop() {
36 exit(0);
37 }
38
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698