[Libgdx] how to use GLES20

Trying to do a little demo game, which would be ran on desktop and android. The problem is that when I try to run the game on android emulator, I get OpenGL ES 2.0 is not supported on your device error in logcat. I’m using eclipse. I did some googling and found that I need to put this code into my manifest file:


 <uses-feature android:glEsVersion="0x00020000" android:required="true" />

Now my manifest file looks like this, but I still get the same error.


<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.cig.dreams.android"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="19" />
	<uses-feature android:glEsVersion="0x00020000" android:required="true" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/GdxTheme" >
        <activity
            android:name="com.cig.dreams.android.AndroidLauncher"
            android:label="@string/app_name" 
            android:screenOrientation="landscape"
            android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>


Any suggestions? (I’m going to sleep in a few minutes, so don’t expect me to reply for 8 hours.)

IIRC in order to use GLES20 in the emulator you have to check the option “use host GPU” or something like that.

Thanks it seems it fixed the problem. However now I’m getting probably file doesn’t exist exception when doing ImageIO.read(Gdx.files.internal(“file”).read());

Probably my fault somewhere :stuck_out_tongue:

Okey I’m starting to get annoyed by this…


		Gdx2DPixmap pixmap;
		System.out.println(pixmap.getPixel(0, 0));
		pixmap.setPixel(0, 0, 0);
		System.out.println(pixmap.getPixel(0, 0));

I finally come to write this code. The problem is that here is what it prints out.

1915447807
1915447807

I basically load the pixmap somewhere in the code and value at 0,0 happens to be 1915447807. The problem is that it doesn’t change after I do setPixel(0, 0, 0). In second print statement, it should be 0, but it didn’t change. Do I need to call some kind of method like pixmap.flush or pixmap.update for it to change?

I’m not sure but try if with setPixel(0, 0, Color.rgba8888(0,0,0,1)); works.

I think the problem lies with the formats. When loading .png, I think you get like a format where alpha can be 1 or 0, meaning alpha is full or there is no alpha.

I think I need to first of all convert the pixmap from RGB888 to RGBA8888 format somehow.