Opengl es 2.x - Some problems :)

Hi, it’s for an android app, but I think it’s a general question about shaders.
I wanna use 2.0,

  1. therefore I can’t use methods like glbegin?
    2.In addition there’s no drawPolygon function anymore?
  2. Should I use a list of triangles or the triangle_fan?
  3. How do I attach the api (http://www.khronos.org/opengles/sdk/docs/man/) to my project?
  4. Should I use libgdx or the “android version”?
    thx for help :slight_smile:
    best regards and Merry Christmas :slight_smile:
  1. Nope.
  2. There never was a drawPolygon method. You can still draw convex polygons with GL_TRIANGLES, as per usual, for concave polygons you can either use GLU tessellation or triangulate it in software (the preferred technique).
  3. Depends on the situation. For example, making a 2D circle would be better with GL_TRIANGLE_FAN. For a rectangular sprite you may use GL_TRIANGLE_STRIP, or GL_TRIANGLES for a generic sprite renderer.
  4. You access OpenGL through the Android APIs: see here
  5. LibGDX includes a lot of features (like texture packing, frame buffer, shader program, matrices, etc) which you will inevitably need to work in the programmable pipeline. It makes more sense, especially for a beginner, to use LibGDX instead of reinventing the wheel.

I have more info on shaders, frame buffers, sprite batchers, etc in this series:

Each shader lesson includes a port to LibGDX code, which should be useful for Android programmers.

thx :slight_smile:
I won’t call myself an android programmer, I am just a try and error commander on his way to success ;D
best regards

You can use com.jogamp.opengl.util.ImmModeSink with JOGL 2.0 under Android but it should be a temporary solution, rather switch to vertex arrays and VBO.

Using vertex-arrays etc isn’t that hard, it’s just a little bit anoying, that there are so much outdated tuts on the web and as a beginner u always notice it on the end ::slight_smile:
I am setting up Libgdx and have got a little problem:
http://code.google.com/p/libgdx/wiki/ProjectSetupNew : step 3.4, there’s no “Finish” button there’s only “configure buildpath” and “rename”
best regards