zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
main.cpp File Reference
#include <zenilib.h>
#include <jni.h>
#include <errno.h>
#include <GLES/gl.h>
#include <android/sensor.h>
#include <android_native_app_glue.h>
#include <android/window.h>
#include <cmath>
#include <utility>

Go to the source code of this file.

Functions

void android_main (struct android_app *state)
 
static void engine_draw_frame (struct engine *)
 
static void engine_handle_cmd (struct android_app *app, int32_t cmd)
 
static int32_t engine_handle_input (struct android_app *app, AInputEvent *event)
 
static int engine_init_display (struct engine *engine)
 
static void engine_term_display (struct engine *engine)
 

Variables

class Bootstrap g_bootstrap
 
bool g_ndk = false
 

Function Documentation

void android_main ( struct android_app state)

This is the main entry point of a native application that is using android_native_app_glue. It runs in its own thread, with its own event loop for receiving input events and doing other things.

set g_ndk=1

Definition at line 352 of file main.cpp.

References app_dummy(), android_app::destroyRequested, engine_draw_frame(), engine_handle_cmd(), engine_handle_input(), engine_term_display(), g_ndk, Zeni::get_Core(), Zeni::Window::get_height(), Zeni::Window::get_width(), Zeni::get_Window(), android_app::looper, LOOPER_ID_USER, max, memset, min, NULL, android_app::onAppCmd, android_app::onInputEvent, android_poll_source::process, android_app::savedState, Zeni::Core::set_screen_saver(), and android_app::userData.

static void engine_draw_frame ( struct engine *  )
static
static int32_t engine_handle_input ( struct android_app app,
AInputEvent *  event 
)
static
static int engine_init_display ( struct engine *  engine)
static

Initialize an EGL context for the current display.

Definition at line 180 of file main.cpp.

References Zeni::get_Window(), GL_CULL_FACE, GL_DEPTH_TEST, GL_FASTEST, GL_PERSPECTIVE_CORRECTION_HINT, GL_SMOOTH, glDisable, glEnable, glHint, and glShadeModel.

Referenced by engine_handle_cmd().

Variable Documentation

class Bootstrap g_bootstrap
bool g_ndk = false

Definition at line 344 of file main.cpp.

Referenced by android_main().