Texture loading

Hello,

i am new to OpenGL ES for Android and
i need a bit help for loading textures.

I got my Basic Code from the android tutorial and drawing a colored quad,
now i want to load an simple texture…

the texture is in the res/drawable/tex1.png

my problem starts with the BitmapFactory to get the context

public void onSurfaceCreated(GL10 gl, EGLConfig config) {

Bitmap bmp = BitmapFactory.decodeResource(context.getResources(), R.drawable.tex1);

  1. problem: how do i get the context in the onSurfaceCreated part
    ( i am not able to make the context (ClearGLSurfaceView(Context context)) static)

  2. what is to do next to load an simple texture…i found some tutorial and snippets …but nothing was working…and i didnt find books here about opengl ES for android

much thanks for help :slight_smile:

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.