Bladeren bron

android: slightly update Android project for newer SDK versions.

legacy
Sam Hocevar sam 12 jaren geleden
bovenliggende
commit
15c4e8016a
4 gewijzigde bestanden met toevoegingen van 80 en 4 verwijderingen
  1. +7
    -3
      src/Makefile.am
  2. +4
    -0
      src/application/application.cpp
  3. +27
    -1
      src/platform/android/androidapp.cpp
  4. +42
    -0
      src/platform/android/androidapp.h

+ 7
- 3
src/Makefile.am Bestand weergeven

@@ -22,6 +22,7 @@ liblol_a_SOURCES = \
$(xbox_sources) \
$(nacl_sources) \
$(sdl_sources) \
$(android_sources) \
\
thread/threadbase.h thread/thread.h \
\
@@ -31,11 +32,8 @@ liblol_a_SOURCES = \
gpu/vbo.cpp gpu/vbo.h \
\
image/image.cpp image/image.h image/image-private.h \
image/codec/android-image.cpp \
image/codec/gdiplus-image.cpp \
image/codec/ios-image.cpp \
image/codec/sdl-image.cpp \
image/codec/ps3-image.cpp \
image/codec/dummy-image.cpp \
\
loldebug.h \
@@ -45,6 +43,7 @@ liblol_a_SOURCES = \
liblol_a_CPPFLAGS = @LOL_CFLAGS@

sdl_sources = \
image/codec/sdl-image.cpp \
platform/sdl/sdlapp.cpp platform/sdl/sdlapp.h \
platform/sdl/sdlinput.cpp platform/sdl/sdlinput.h

@@ -59,6 +58,7 @@ endif

if HAVE_PS3
ps3_sources = \
image/codec/ps3-image.cpp \
platform/ps3/threadbase.h \
platform/ps3/ps3app.cpp platform/ps3/ps3app.h \
platform/ps3/ps3input.cpp platform/ps3/ps3input.h
@@ -69,3 +69,7 @@ xbox_sources = \
platform/xbox/xboxapp.cpp platform/xbox/xboxapp.h
endif

android_sources = \
image/codec/android-image.cpp \
platform/android/androidapp.cpp platform/android/androidapp.h


+ 4
- 0
src/application/application.cpp Bestand weergeven

@@ -21,6 +21,8 @@
# include "platform/xbox/xboxapp.h"
#elif defined __native_client__
# include "platform/nacl/naclapp.h"
#elif defined __ANDROID__
# include "platform/android/androidapp.h"
#elif defined HAVE_GLES_2X
# include "eglapp.h"
#else
@@ -47,6 +49,8 @@ class ApplicationData
XboxApp app;
#elif defined __native_client__
NaClApp app;
#elif defined __ANDROID__
AndroidApp app;
#elif defined HAVE_GLES_2X
/* FIXME: this macro is only deactivated if we include "lolgl.h" */
EglApp app;


+ 27
- 1
src/platform/android/androidapp.cpp Bestand weergeven

@@ -16,15 +16,41 @@
#include <android/log.h>

#include "core.h"
#include "lolgl.h"
#include "loldebug.h"
#include "androidapp.h"

using namespace lol;

/* Monsterz-specific */
#include "interface.h"

namespace lol
{
JavaVM *g_vm;
jobject g_activity;

AndroidApp::AndroidApp(char const *title, ivec2 res, float fps) :
data(0)
{
}

void AndroidApp::ShowPointer(bool show)
{
}

void AndroidApp::Run()
{
while (!Ticker::Finished())
{
/* Tick the renderer, show the frame and clamp to desired framerate. */
Ticker::TickDraw();
}
}

AndroidApp::~AndroidApp()
{
}

};

extern "C" jint


+ 42
- 0
src/platform/android/androidapp.h Bestand weergeven

@@ -0,0 +1,42 @@
//
// Lol Engine
//
// Copyright: (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the Do What The Fuck You Want To
// Public License, Version 2, as published by Sam Hocevar. See
// http://sam.zoy.org/projects/COPYING.WTFPL for more details.
//

//
// The AndroidApp class
// --------------------
//

#if !defined __LOL_ANDROIDAPP_H__
#define __LOL_ANDROIDAPP_H__

#include "lol/math/vector.h"

namespace lol
{

class AndroidAppData;

class AndroidApp
{
public:
AndroidApp(char const *title, ivec2 res, float fps);
virtual ~AndroidApp();

void ShowPointer(bool show);
void Run();

private:
AndroidAppData *data;
};

} /* namespace lol */

#endif // __LOL_ANDROIDAPP_H__


Laden…
Annuleren
Opslaan