//----------------------------------------------------------------// static void _onReshape( int w, int h ) { if ( sExitFullscreen ) { w = sWinWidth; h = sWinHeight; sExitFullscreen = false; } AKUSetScreenSize ( w, h ); AKUSetViewSize ( w, h ); }
void MoaiWidget::refreshContext(){ printf("Starting load\n"); AKUContextID context = AKUGetContext (); if ( context ) { AKUDeleteContext ( context ); } AKUCreateContext (); AKUExtLoadLuacrypto (); AKUExtLoadLuacurl (); AKUExtLoadLuafilesystem (); AKUExtLoadLuasocket (); AKUExtLoadLuasql (); AKUSetInputConfigurationName ( "AKUQT" ); AKUReserveInputDevices ( QTInputDeviceID::TOTAL ); AKUSetInputDevice ( QTInputDeviceID::DEVICE, "device" ); AKUReserveInputDeviceSensors ( QTInputDeviceID::DEVICE, QTInputDeviceSensorID::TOTAL ); AKUSetInputDeviceKeyboard ( QTInputDeviceID::DEVICE, QTInputDeviceSensorID::KEYBOARD, "keyboard" ); AKUSetInputDevicePointer ( QTInputDeviceID::DEVICE, QTInputDeviceSensorID::POINTER, "pointer" ); AKUSetInputDeviceButton ( QTInputDeviceID::DEVICE, QTInputDeviceSensorID::MOUSE_LEFT, "mouseLeft" ); AKUSetInputDeviceButton ( QTInputDeviceID::DEVICE, QTInputDeviceSensorID::MOUSE_MIDDLE, "mouseMiddle" ); AKUSetInputDeviceButton ( QTInputDeviceID::DEVICE, QTInputDeviceSensorID::MOUSE_RIGHT, "mouseRight" ); AKUDetectGfxContext (); if(mWidth > 0 ) { AKUSetScreenSize ( mWidth, mHeight); AKUSetViewSize(mWidth,mHeight); } AKURunBytecode ( moai_lua, moai_lua_SIZE ); mTimer = new QTimer(this); mTimer->setInterval( 30 ); connect(mTimer, SIGNAL(timeout()), this, SLOT(onUpdate()) ); mTimer->start(); mInitialized = true; printf("Initialized\n"); }
void MoaiWidget::resizeGL(int w, int h) { if(mInitialized) { AKUSetScreenSize ( w, h); AKUSetViewSize(w,h); if(mDocuments) { setActiveDirectory(mActiveDirectory); mDocuments = false; } if(mScripts) { runScript(mActiveFile); mScripts = false; } } mWidth = w; mHeight = h; }
//----------------------------------------------------------------// extern "C" void Java_com_ziplinegames_moai_Moai_AKUSetViewSize ( JNIEnv* env, jclass obj, jint width, jint height ) { AKUSetViewSize ( width, height ); }