simple displaying of texture in low-level opengl ? How?
in
Android Processing
•
5 months ago
hello.
I'm try to visualise a simple texture in android using PGL.
i'm stuck at the line 17, the texture binding operation. it can't find the symbol- I don't understand what I'm doing wrong.
any help would be really appreciated, I'm really new to this kind of thing but pretty impressed by all discoveries I make about processing !
I'm try to visualise a simple texture in android using PGL.
i'm stuck at the line 17, the texture binding operation. it can't find the symbol- I don't understand what I'm doing wrong.
any help would be really appreciated, I'm really new to this kind of thing but pretty impressed by all discoveries I make about processing !
- import android.graphics.Bitmap;
- import android.graphics.BitmapFactory;
- import android.opengl.GLUtils;
- Bitmap bitmap;
- PGL pgl;
- int texture[] = new int[1];
- void setup() {
- size(1280, 800, P3D);
- orientation(LANDSCAPE);
- }
- void draw() {
- background(0);
- pgl = beginPGL();
- if (bitmap != null) {
- pgl.glBindTexture(pgl.TEXTURE_2D, 0);
- GLUtils.texImage2D(pgl.TEXTURE_2D, 0, bitmap, 0);
- }
- // pg.glTexParameterf(pgl.TEXTURE_2D, pgl.TEXTURE_MIN_FILTER, pgl.LINEAR);
- // pg.glTexParameterf(pgl.TEXTURE_2D, pgl.TEXTURE_MAG_FILTER, pgl.LINEAR);
- endPGL();
- }
- void mousePressed()
- {
- BitmapFactory.Options options = new BitmapFactory.Options();
- options.inScaled = false;
- try {
- Bitmap bitmap = BitmapFactory.decodeStream(getApplicationContext().getAssets().open("0.jpg"));
- }
- catch (IOException e) {
- System.err.println(" File '0.jpg' not found /Put them in regular data processing folder/");
- }
- }
1