android - Can't draw with glDrawTexfOES -


i can't draw texture gldrawtextoes in android app. i've tried spritemethodtest code , can't work...

however, here's code:

code cropping when loading texture:

glutils.teximage2d(gl10.gl_texture_2d, 0, bitmap, 0);          int[] mcropworkspace = new int[4];         mcropworkspace[0] = 0;         mcropworkspace[1] = bitmap.getheight();         mcropworkspace[2] = bitmap.getwidth();         mcropworkspace[3] = -bitmap.getheight();          bitmap.recycle();          ((gl11) gl).gltexparameteriv(gl10.gl_texture_2d,                  gl11ext.gl_texture_crop_rect_oes, mcropworkspace, 0); 

code drawing:

gl.glbindtexture(gl10.gl_texture_2d, texture); ((gl11ext) gl).gldrawtexfoes(x, y, 0.0f, width, height); 

any ideas? got work vertex arrays , vertex buffer objects, not this...

thanks in advance!

you need have height , width image, e.g: 512x512 or 512x1024 fills quad/rectangle, specified gl_texture_crop_rect_oes.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -