| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012, 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/android/context.h" |
| 6 #include "embedders/android/dart_host.h" |
| 7 #include "embedders/android/eventloop.h" |
| 8 #include "embedders/android/graphics.h" |
| 9 #include "embedders/android/input_service.h" |
| 10 #include "embedders/android/vm_glue.h" |
| 11 |
| 12 SoundService* psound_service; |
| 13 |
| 14 void android_main(android_app* application) { |
| 15 Timer timer; |
| 16 Graphics graphics(application, &timer); |
| 17 VMGlue vmGlue(&graphics); |
| 18 InputService inputService(application, &vmGlue, |
| 19 graphics.width(), graphics.height()); |
| 20 SoundService sound_service(application); |
| 21 psound_service = &sound_service; |
| 22 Context context; |
| 23 context.graphics = &graphics; |
| 24 context.input_handler = &inputService; |
| 25 context.sound_service = psound_service; |
| 26 context.timer = &timer; |
| 27 context.vm_glue = &vmGlue; |
| 28 EventLoop eventLoop(application); |
| 29 DartHost host(&context); |
| 30 eventLoop.Run(&host, &context); |
| 31 } |
| 32 |
| 33 void PlayBackground(const char* path) { |
| 34 psound_service->PlayBackground(path); |
| 35 } |
| 36 |
| 37 void StopBackground() { |
| 38 psound_service->StopBackground(); |
| 39 } |
| OLD | NEW |