Friday, June 4, 2010

[android-developers] Re: glGenTextures going crazy on actual device

Lance,

That sounds pretty plausible. I did notice that api4 suddently
started showing the true screen dimensions of my Droid (and
unfortunately that also lowered my frame rate as there are more pixels
to fill now :-)

On Jun 4, 8:27 am, Lance Nanek <lna...@gmail.com> wrote:
> If I take a default API level 3 app, load the icon using
> BitmapFactory.decodeResource, and check Bitmap#getWidth and
> Bitmap#getHeight, then I get the values of 48 on the Droid. Now if I
> set android:minSdkVersion to 4 or higher in the manifest, then I get
> the values of 72. This is because changing the API level changes the
> default values for the screens supported:http://developer.android.com/guide/topics/manifest/supports-screens-e...
>
> It takes the app out of compatibility mode, where Android reports a
> smaller screen resolution than actually exists, and it starts scaling
> up resources from directories like the drawable directory, which is
> considered medium density when there is no density specifier, not high
> density.
>
> So anyway, depending on how you are storing and loading the images you
> are using for your textures, changing the API level may be causing
> Android to resize them. Textures have to have power of 2 size
> dimensions, so this resize can make an image that can be used as a
> texture into an image that can't be used. It's pretty easy to prevent
> the resizing, there are previous threads on that.
>
> On Jun 4, 3:35 am, Samsyn <d...@synthetic-reality.com> wrote:
>
>
>
> > and yes, if I regress to api 3, the problem goes away, but apis 4 and
> > 5 both have the problem.- Hide quoted text -
>
> - Show quoted text -

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment