OpenGL Orthographic Projection problems on emulator (rendering 1/4 size)

by Robert Green » Thu, 20 Aug 2009 13:07:50 GMT


Sponsored Links
  seem to have found the bug.  The problem appears to be with how
Fixed Point numbers are used with glOrthox. The specification is such
that glOrtho creates a relative number of "pixels" that can be used -
so no matter what the actual screen resolution is, you get to draw to
whatever you defined as your coordinate system in glOrtho. This means
that instead of converting everything to FP (int << 16), you can just
put the regular int in for the width and height of the orthographic
projection and then use regular ints in your geometry. This works
correctly on the device and in every opengl example I've seen, but the
emulator doesn't like it. Here's what I found:

Testing landscape full screen 480x320

glOrthox(0, 480, 320, 0, 0, 1) and geometry using ints (320, 480)
works on device but not on emulator (1/2 length and width show up)
glOrthox(0, 480 << 16, 320 << 16, 0, 0, 1) and geometry using FP (320
<< 16, 480 << 16) works on both emulator and device
glOrthof(0, 480f, 320f, 0, 0, 1) and geometry using floats (320f x
480f) works on both emulator and device
glOrthof(0, 480f, 320f, 0, 0, 1) and geometry using FP (320 << 16, 480
<< 16) works on both emulator and device

I think it's a bug that the first method doesn't work, but I'll just
convert everything to FP and forget about it.

On Aug 19, 11:44pm, Robert Green <rbgrn....@gmail.com> wrote:
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. How to detect if 1 App is using other App's data in ANdroid?

Hi All,

I'm trying to detect if one App is using some other App's data via
overt/covert channels?
Any help is highly appreciated!
Thanks.

-- 
.

2. java.lang.NullPointerException - shaha divan

The reason you are getting a null pointer exception is possibly that
you set a String value to null. Try this:

public string ipaddr="";

-- 

3. getting device-id

4. Rarely getting ActivityNotFoundException?

5. restart device from code

6. change the google account associated to my developer account

7. How to add cryptoalgs to Android.