source: trunk/src/androidapp.cpp @ 709

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

No longer use DebugQuad() in the AndroidApp, we now know it works.

  • Property svn:keywords set to Id
File size: 1.4 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 Interface();
34    new DebugFps(20, 20);
35}
36
37extern "C" void
38Java_org_zoy_LolEngine_LolRenderer_nativeResize(JNIEnv* env, jobject that,
39                                                jint w, jint h)
40{
41    __android_log_print(ANDROID_LOG_INFO, "LOL", "resize w=%d h=%d", w, h);
42    Video::Setup(w, h);
43}
44
45extern "C" void
46Java_org_zoy_LolEngine_LolRenderer_nativeDone(JNIEnv* env)
47{
48    /* FIXME: clean up */
49}
50
51extern "C" void
52Java_org_zoy_LolEngine_LolGLSurfaceView_nativePause(JNIEnv* env)
53{
54    /* TODO: unimplemented */
55}
56
57/* Call to render the next GL frame */
58extern "C" void
59Java_org_zoy_LolEngine_LolRenderer_nativeRender(JNIEnv* env)
60{
61    Ticker::ClampFps();
62    Ticker::TickGame();
63    Ticker::TickDraw();
64}
65
Note: See TracBrowser for help on using the repository browser.