Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (515)
Games in Android Showcase (122)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  [Libgdx] how to use GLES20  (Read 490 times)
0 Members and 1 Guest are viewing this topic.
Online trollwarrior1
« Posted 2014-04-29 19:45:56 »

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:
1  
 <uses-feature android:glEsVersion="0x00020000" android:required="true" />


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

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
<?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.)
Offline seismic
« Reply #1 - Posted 2014-04-29 20:38:47 »

IIRC in order to use GLES20 in the emulator you have to check the option "use host GPU" or something like that.
Online trollwarrior1
« Reply #2 - Posted 2014-04-30 04:38:25 »

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 Tongue
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online trollwarrior1
« Reply #3 - Posted 2014-04-30 07:17:08 »

Okey I'm starting to get annoyed by this..

1  
2  
3  
4  
      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?
Offline Endos
« Reply #4 - Posted 2014-04-30 09:09:48 »

Okey I'm starting to get annoyed by this..

1  
2  
3  
4  
      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.

Bored Birds - End with your boredom for Android
Retroships - Space Shooter for Android
Ultimate - 2D Side-Scrolling Platformer project
Online trollwarrior1
« Reply #5 - Posted 2014-04-30 10:22:28 »

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.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (31 views)
2014-10-27 03:28:38

TehJavaDev (26 views)
2014-10-27 03:27:51

DarkCart (40 views)
2014-10-26 19:37:11

Luminem (21 views)
2014-10-26 10:17:50

Luminem (25 views)
2014-10-26 10:14:04

theagentd (31 views)
2014-10-25 15:46:29

Longarmx (61 views)
2014-10-17 03:59:02

Norakomi (57 views)
2014-10-16 15:22:06

Norakomi (46 views)
2014-10-16 15:20:20

lcass (43 views)
2014-10-15 16:18:58
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!