Texture size issue & opengl-es 2.0
Monkey Targets Forums/Android/Texture size issue & opengl-es 2.0
| ||
Thought I'd post this cus it had me scratching my head for the last hour, testing my game using the god awful AVD emulator and noticed my apps crashing on all 2.x.x setups - after a tantrum I discovered it did not like my 2048x2048 texture, busted it down to 1024x1024 and it solved the issue. Had no issue with 2048x2048 on 4.x.x |
| ||
opengl-es 1.0 texture size is max 1024x1024 per standard and i think max 2 of them... but you can change to 2.0 |
| ||
ah lovely I plan to support 2.2 onward so I shall swap to 2.0 thanks for the info. [EDIT] Hum still crashes on 2.2.x even when I set min and target SDK in manifest to 8 and set the opengl 2.0. <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8" /> <uses-feature android:glEsVersion="0x00020000" /> Event this crashes a 2.3.3 emulated device (kindle fire); Import mojo Import monkey Function Main(); New project; End Class project Extends App Field texture:Image Method OnCreate() texture = LoadImage("texture_2048x2048.png") End Method Method OnUpdate() End Method Method OnRender() Cls 55, 55, 55 DrawImage texture, 0, 0 End Method End Class Maybe this is an emulator thing? Sadly I no longer has a real 2.3.3 device , am I missing something obvious? |
| ||
Should this work? cus is crashes on emulator and real device (jellybean) Monkey ------ #OPENGL_GLES20_ENABLED=True #ANDROID_NATIVE_GL_ENABLED=True Import mojo Import monkey Import opengl.gles20 Function Main(); New project; End Class project Extends App Method OnCreate() End Method Method OnUpdate() End Method Method OnRender() Cls 55, 55, 55 DrawText "hello", 0, 0 End Method End Class Manifest (template) ------------------- <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="${ANDROID_APP_PACKAGE}" android:versionCode="${ANDROID_VERSION_CODE}" android:versionName="${ANDROID_VERSION_NAME}" android:installLocation="auto"> <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8" /> <uses-feature android:glEsVersion="0x00020000" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> ${ANDROID_MANIFEST_MAIN} <application android:label="${ANDROID_APP_LABEL}" android:icon="@drawable/icon"> <activity android:name="MonkeyGame" android:label="${ANDROID_APP_LABEL}" android:screenOrientation="${ANDROID_SCREEN_ORIENTATION}" android:configChanges="keyboardHidden|orientation|screenSize" android:theme=\"@...; <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> ${ANDROID_MANIFEST_APPLICATION} </application> </manifest> |