How to get TV current Ratio?

Hi OUYA Devs,

I have a problem here, my game will get clipped on the edges if I changed the ratio of the screen. Yes, I aware that OUYA already stated that OUYA will only support 720p and 1080p. Which means only support 16:9 ratio.

How can I detect my current screen Ratio?
Did anyone already have workaround about this?

Thanks

many thanks
-sb

Answers

  • PoppinPenguinPoppinPenguin Posts: 12Member
    I had a quick search for you sb, and does this resolve your problem? Hope I've helped!


    Offering my assistance in marketing/PR for OUYA Developers to help games get the attention they deserve. Will happily work on social media accounts, contacting journalists/websites and arranging interviews to help any OUYA Developer who needs it. Contact me.
  • newmessagenewmessage Posts: 42Member
    I had a quick search for you sb, and does this resolve your problem? Hope I've helped!


    Nope, 
    Well, the easiest way is to put all the HUD inside the safe zone..
    Need to re-arrange my HUD again :(
    many thanks
    -sb

  • AzamosAzamos Posts: 52Member
    My understanding is that there is no 4x3 ratio anymore and that all HD TV's are 16x9. So that should make things easy.

    You can always check the full resolution /aspect of the device you are running on as well when you are making calls to EGL to set up your drawing surface. 

    If you are using the NDK you can do:
    ANativeWindow_setBuffersGeometry(window, 0, 0, format); // passing in 0's uses the entire width/height
    .. bunch of other EGL calls inbetween, then finally get the width/height of the device back from EGL...
    EGLint width, height;
    eglQuerySurface(EGLdisplay, EGLsurface, EGL_WIDTH, &width);
    eglQuerySurface(EGLdisplay, EGLsurface, EGL_HEIGHT, &height);

    and getting the aspect is simply a matter of width/height. For example:
    16/9 =  1.778
    1920/1080 = 1.778

    As a side note, if you are not using the NDK, there are equivalent calls in Java, but I'm too lazy to look those up for you.
Sign In or Register to comment.