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 : 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 |
OLD | NEW |