| OLD | NEW |
| (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 : GraphicsHandler(".") { | |
| 13 glutInit(&argc, argv); | |
| 14 width_ = 800; | |
| 15 height_ = 480; | |
| 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 SetViewport(0, 0, width_, height_); | |
| 27 glutInitWindowSize(width_, height_); | |
| 28 glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH | GLUT_STENCIL); | |
| 29 glutCreateWindow("Dart"); | |
| 30 } | |
| 31 | |
| 32 int32_t EmulatorGraphicsHandler::Start() { | |
| 33 return GraphicsHandler::Start(); | |
| 34 } | |
| 35 | |
| 36 void EmulatorGraphicsHandler::Stop() { | |
| 37 GraphicsHandler::Stop(); | |
| 38 } | |
| 39 | |
| OLD | NEW |