//----------------------------------------------------------------// 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 GlutHost ( int argc, char** argv ) { // TODO: integrate this nicely with host //AKUInitMemPool ( 100 * 1024 * 1024 ); atexit ( _cleanup ); glutInit ( &argc, argv ); AKUCreateContext (); #ifdef GLUTHOST_USE_FMOD AKUFmodLoad (); #endif #ifdef GLUTHOST_USE_LUAEXT AKUExtLoadLuacrypto (); AKUExtLoadLuacurl (); AKUExtLoadLuasocket (); AKUExtLoadLuasql (); #endif #ifdef GLUTHOST_USE_UNTZ AKUUntzInit (); #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 AKUDebugHarnessInit (); #endif for ( int i = 1; i < argc; ++i ) { AKURunScript ( argv [ i ]); } if ( sHasWindow ) { glutTimerFunc ( 0, _onTimer, 0 ); glutMainLoop (); } return 0; }
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; }
//----------------------------------------------------------------// int GlutHost ( int argc, char** argv ) { glutInit ( &argc, argv ); AKUCreateContext (); #ifdef GLUTHOST_USE_FMOD AKUFmodLoad (); #endif #ifdef GLUTHOST_USE_LUAEXT AKUExtLoadLuacrypto (); AKUExtLoadLuacurl (); AKUExtLoadLuasocket (); AKUExtLoadLuasql (); #endif #ifdef GLUTHOST_USE_UNTZ AKUUntzInit (); #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 ); AKUSetFunc_StartGameLoop ( _AKUStartGameLoopFunc ); for ( int i = 1; i < argc; ++i ) { AKURunScript ( argv [ i ]); } return 0; }
//----------------------------------------------------------------// extern "C" void Java_com_ziplinegames_moai_Moai_AKUUntzInit ( JNIEnv* env, jclass obj ) { #ifdef USE_UNTZ AKUUntzInit (); #endif }
//----------------------------------------------------------------// extern "C" void Java_com_ziplinegames_moai_Moai_AKUUntzInit ( JNIEnv* env, jclass obj ) { AKUUntzInit (); }