Files
sdk/runtime/embedders/openglui/android/main.cc
T
gram@google.com 9703d7bfdd Refactored OpenGL embedder that works on Android, Mac or Linux.
To build on/for linux: tools/build.py -a x64 samples
To build on/for Mac: tools/build.py -a ia32 samples
To build on Linux for Android: tools/bui8ld.py --os=android samples

Note that to run on a Mac, you need to delete the first line of the
fragment shader in raytrace.dart, that says:

  precision mediump float;
Review URL: https://codereview.chromium.org//11883013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17161 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-16 21:17:52 +00:00

31 lines
1.3 KiB
C++

// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include "embedders/openglui/android/android_graphics_handler.h"
#include "embedders/openglui/android/android_input_handler.h"
#include "embedders/openglui/android/android_sound_handler.h"
#include "embedders/openglui/android/eventloop.h"
#include "embedders/openglui/common/context.h"
#include "embedders/openglui/common/dart_host.h"
#include "embedders/openglui/common/vm_glue.h"
void android_main(android_app* application) {
app_dummy(); // Link in native_app_glue.
AndroidGraphicsHandler graphics_handler(application);
VMGlue vm_glue(&graphics_handler, "/data/data/com.google.dartndk/app_dart");
AndroidInputHandler input_handler(&vm_glue, &graphics_handler);
AndroidSoundHandler sound_handler(application);
Timer timer;
Context app_context;
app_context.graphics_handler = &graphics_handler;
app_context.input_handler = &input_handler;
app_context.sound_handler = &sound_handler;
app_context.timer = &timer;
app_context.vm_glue = &vm_glue;
EventLoop eventLoop(application);
DartHost host(&app_context);
eventLoop.Run(&host, &input_handler);
}