Ilya Gazman
Ilya Gazman

Reputation: 32271

Convert canvas to OpenGl

Can you show me how to implement this canvas function using opneGL es1:

public void drawBitmap(Bitmap bitmap, float left, float top, Paint paint)

I need full example with activity and a view.

@broschb I simply want to set up the screen size and draw a 2d image within a given (x,y) coordination according to my set.

Upvotes: 4

Views: 2161

Answers (1)

broschb
broschb

Reputation: 5006

You will need to use a GLSurfaceView to draw on. You will then need to convert your bitmap to a texture and then you can draw the texture, or texture a quad. Look at the tutorial, it's a simple start.

Also, if you give more details on what you are trying to achieve, you will probably receive more specific answers to help.

http://www.anddev.org/android-2d-3d-graphics-opengl-problems-f55/draw-a-bitmap-using-opengl-t14920.html

Upvotes: 1

Related Questions