//----------------------------------------------------------------// void GlutRefreshContext () { AKUContextID context = AKUGetContext (); if ( context ) { AKUDeleteContext ( context ); } AKUCreateContext (); #ifdef GLUTHOST_USE_FMOD_DESIGNER AKUFmodDesignerInit (); #endif #ifdef GLUTHOST_USE_FMOD_EX AKUFmodExInit (); #endif #ifdef GLUTHOST_USE_LUAEXT AKUExtLoadLuacrypto (); AKUExtLoadLuacurl (); AKUExtLoadLuafilesystem (); AKUExtLoadLuasocket (); AKUExtLoadLuasql (); AKUExtLoadLuamsgpack (); #endif #ifdef GLUTHOST_USE_UNTZ AKUUntzInit (); #endif #ifdef GLUTHOST_USE_AUDIOSAMPLER AKUAudioSamplerInit(); #endif #ifdef GLUTHOST_USE_PARTICLE_PRESETS ParticlePresets (); #endif AKUSetInputConfigurationName ( "AKUGlut" ); AKUReserveInputDevices ( GlutInputDeviceID::TOTAL ); AKUSetInputDevice ( GlutInputDeviceID::DEVICE, "device" ); AKUReserveInputDeviceSensors ( GlutInputDeviceID::DEVICE, GlutInputDeviceSensorID::TOTAL ); AKUSetInputDeviceKeyboard ( GlutInputDeviceID::DEVICE, GlutInputDeviceSensorID::KEYBOARD, "keyboard" ); AKUSetInputDevicePointer ( GlutInputDeviceID::DEVICE, GlutInputDeviceSensorID::POINTER, "pointer" ); AKUSetInputDeviceButton ( GlutInputDeviceID::DEVICE, GlutInputDeviceSensorID::MOUSE_LEFT, "mouseLeft" ); AKUSetInputDeviceButton ( GlutInputDeviceID::DEVICE, GlutInputDeviceSensorID::MOUSE_MIDDLE, "mouseMiddle" ); AKUSetInputDeviceButton ( GlutInputDeviceID::DEVICE, GlutInputDeviceSensorID::MOUSE_RIGHT, "mouseRight" ); AKUSetFunc_EnterFullscreenMode ( _AKUEnterFullscreenModeFunc ); AKUSetFunc_ExitFullscreenMode ( _AKUExitFullscreenModeFunc ); AKUSetFunc_OpenWindow ( _AKUOpenWindowFunc ); #ifdef GLUTHOST_USE_DEBUGGER AKUSetFunc_ErrorTraceback ( _AKUErrorTracebackFunc ); AKUDebugHarnessInit (); #endif AKURunBytecode ( moai_lua, moai_lua_SIZE ); }
int main ( int argc, char *argv []) { QApplication a ( argc, argv ); MoaiQtHost::QtHostWindow* window = MoaiQtHost::QtHostWindow::getHostInstance (); MoaiQtHost::QtHostScriptLdr scriptLoader; AKUContextID context = AKUGetContext (); // Delete old context if ( context != 0 ) { AKUDeleteContext ( context ); } AKUCreateContext (); #ifdef QT_HOST_USE_LUAEXT AKUExtLoadLuacrypto (); AKUExtLoadLuacurl (); AKUExtLoadLuafilesystem (); AKUExtLoadLuasocket (); AKUExtLoadLuasql (); #endif #ifdef QT_HOST_USE_UNTZ AKUUntzInit (); #endif #ifdef QT_HOST_USE_FMOD_EX AKUFmodExInit (); #endif #ifdef QT_HOST_USE_FMOD_DESIGNER AKUFmodDesignerInit (); #endif #ifdef QT_HOST_USE_AUDIOSAMPLER AKUAudioSamplerInit (); #endif #ifdef QT_HOST_USE_PARTICLE_PRESETS ParticlePresets (); #endif window->setDevices (); window->setCallbacks (); scriptLoader.loadScripts ( argc, argv ); window->startAkuTimers (); int execReturn = a.exec (); delete window; return execReturn; }
//----------------------------------------------------------------// extern "C" void Java_com_ziplinegames_moai_Moai_AKUFMODExInit ( JNIEnv* env, jclass obj ) { #ifdef USE_FMOD AKUFmodExInit (); #endif }