source: trunk/src/androidapp.cpp @ 706

Last change on this file since 706 was 706, checked in by sam, 10 years ago

Add AndroidAdd to the VCS. Far from being usable for now.

  • Property svn:keywords set to Id
File size: 1.5 KB
Line 
1//
2// Lol Engine
3//
4// Copyright: (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
5//   This program is free software; you can redistribute it and/or
6//   modify it under the terms of the Do What The Fuck You Want To
7//   Public License, Version 2, as published by Sam Hocevar. See
8//   http://sam.zoy.org/projects/COPYING.WTFPL for more details.
9//
10
11#if defined HAVE_CONFIG_H
12#   include "config.h"
13#endif
14
15#include <jni.h>
16#include <android/log.h>
17
18#include "core.h"
19#include "lolgl.h"
20#include "loldebug.h"
21
22using namespace lol;
23
24#include "interface.h"
25
26extern "C" void
27Java_org_zoy_LolEngine_LolRenderer_nativeInit(JNIEnv* env)
28{
29    __android_log_print(ANDROID_LOG_INFO, "LOL", "init");
30    Ticker::Setup(10.0f);
31    Video::Setup(320, 200);
32
33    new DebugQuad();
34    new DebugQuad();
35    //new Interface();
36    new DebugFps(20, 20);
37}
38
39extern "C" void
40Java_org_zoy_LolEngine_LolRenderer_nativeResize(JNIEnv* env, jobject that,
41                                                jint w, jint h)
42{
43    __android_log_print(ANDROID_LOG_INFO, "LOL", "resize w=%d h=%d", w, h);
44    Video::Setup(w, h);
45}
46
47extern "C" void
48Java_org_zoy_LolEngine_LolRenderer_nativeDone(JNIEnv* env)
49{
50    /* FIXME: clean up */
51}
52
53extern "C" void
54Java_org_zoy_LolEngine_LolGLSurfaceView_nativePause(JNIEnv* env)
55{
56    /* TODO: unimplemented */
57}
58
59/* Call to render the next GL frame */
60extern "C" void
61Java_org_zoy_LolEngine_LolRenderer_nativeRender(JNIEnv* env)
62{
63    Ticker::ClampFps();
64    Ticker::TickGame();
65    Ticker::TickDraw();
66}
67
Note: See TracBrowser for help on using the repository browser.