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

Side by Side Diff: samples/android_sample/jni/main.cc

Issue 11416343: Refactored Android samples / embedder. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix type error on playBackground Created 8 years 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
« no previous file with comments | « samples/android_sample/jni/log.h ('k') | samples/android_sample/jni/resource.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "jni/context.h" 1 #include "jni/context.h"
2 #include "jni/dart_host.h" 2 #include "jni/dart_host.h"
3 #include "jni/eventloop.h" 3 #include "jni/eventloop.h"
4 #include "jni/graphics.h" 4 #include "jni/graphics.h"
5 #include "jni/input_service.h" 5 #include "jni/input_service.h"
6 #include "jni/vm_glue.h" 6 #include "jni/vm_glue.h"
7 7
8 SoundService* psound_service; 8 SoundService* psound_service;
9 9
10 void android_main(android_app* application) { 10 void android_main(android_app* application) {
11 Timer timer; 11 Timer timer;
12 Graphics graphics(application, &timer); 12 Graphics graphics(application, &timer);
13 VMGlue vmGlue(&graphics); 13 VMGlue vmGlue(&graphics);
14 InputService inputService(application, &vmGlue, 14 InputService inputService(application, &vmGlue,
15 graphics.width(), graphics.height()); 15 graphics.width(), graphics.height());
16 SoundService sound_service(application); 16 SoundService sound_service(application);
17 psound_service = &sound_service; 17 psound_service = &sound_service;
18 Context context; 18 Context context;
19 context = { &graphics, &inputService, psound_service, &timer, &vmGlue }; 19 context = { &graphics, &inputService, psound_service, &timer, &vmGlue };
20 EventLoop eventLoop(application); 20 EventLoop eventLoop(application);
21 DartHost host(&context); 21 DartHost host(&context);
22 eventLoop.Run(&host, &context); 22 eventLoop.Run(&host, &context);
23 } 23 }
24 24
25 int32_t PlayBackground(const char* path) { 25 void PlayBackground(const char* path) {
26 psound_service->PlayBackground(path); 26 psound_service->PlayBackground(path);
27 } 27 }
28 28
29 void StopBackground() { 29 void StopBackground() {
30 psound_service->StopBackground(); 30 psound_service->StopBackground();
31 } 31 }
32
33
OLDNEW
« no previous file with comments | « samples/android_sample/jni/log.h ('k') | samples/android_sample/jni/resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698