[Solved] TPixmap on Android
BlitzMax Forums/Brucey's Modules/[Solved] TPixmap on Android
| ||
I'm getting some hint and it seems I have problems working with TPixmap on Android. My module heavily uses this function and apparently BRL.GLMax2D only works on Desktop. |
| ||
Nothing stops you from using the SDL-GL-one like brucey suggested in another thread. TPixmap is defined in brl.mod/pixmap.mod Edit: I do not know whether there is a bug on android or not, so this is just a "theoretical" thing. bye Ron |
| ||
Ok here you go: It exposes either something I miss in the code - or a bug in the android-support of BMX-NG. Why? It cannot draw the pixmap, but is able to draw the image based on the pixmap. bye Ron |
| ||
As far as I remember (without looking at the code), DrawPixmap is not implemented by the shader-based Max2D. Given how terribly slow DrawPixmap is normally (due to the way the data gets copied over every draw), you probably shouldn't want to be using it anyway. |
| ||
Hmm, couldn't the module emulate DrawPixmap? I mean in an very inefficient manner: creating an image on each "drawPixmap()"-request and then drawing the image. This would at least create some kind of "compatibility". bye Ron |
| ||
As far as I remember (without looking at the code), DrawPixmap is not implemented by the shader-based Max2D. Given how terribly slow DrawPixmap is normally (due to the way the data gets copied over every draw), you probably shouldn't want to be using it anyway. Thanks for clearing this up guys. @Brucey, As Derron mentioned, are there any ways to emulate this or some sort of replacement? |
| ||
I've just updated GL2SDLMax2D to now render (via DrawImage) on a call to DrawPixmap. Since it's copying data every draw, it will be a resource hog on mobile, so YMMV. |
| ||
Thanks Brucey, works straight off the bat! I got 22fps on my cheap quad core phone but I'm not complaining. I'm just happy that it works :D Now.. how do I optimize it and make it at least 60fps XD @Derron, I would like to try the code you posted above. I'm always open for other techniques if that provides a solution |
| ||
Optimize: use timage instead of tpixmap. Why do you want to draw pixmaps? use the lockimage-approach I have posted and only adjust the pixmap when content has to change. @my sample Copy paste compile. I tried it on my phone and it works. Bye Ron |
| ||
how do I optimize it and make it at least 60fps Why do you want to use DrawPixmap? |
| ||
Why do you want to use DrawPixmap? Hey Brucey, just trying some pseudo3d stuff and some examples I found uses DrawPixmap.. |