dynamic display size

edited October 2010 in Help request
hi everyone.
I'm pretty new to orx, I hope my question is not too trivial.


I would like to achieve the following:
instead of hardcoding the display width and height I would like to use the current width and height of the user in the fullscreen mode.
is this possible using an ini file?

Another thing:
in the tutorial I set fullscreen attribute to true in the orx.ini file. the examples will start full screen. however after a moment game window will be minimized and the console window will come to the front. is this normal? is it not possible to have an full screen game when using the console window?

thx in advance :D

Comments

  • edited October 2010
    tdomhan wrote:
    hi everyone.
    I'm pretty new to orx, I hope my question is not too trivial.

    Hi and welcome here! =)
    I would like to achieve the following:
    instead of hardcoding the display width and height I would like to use the current width and height of the user in the fullscreen mode.
    is this possible using an ini file?

    Not directly through config, I'm afraid. You can use orx's display function to query the available modes but the display has to be initialized first. Also you can't query the desktop mode right now but I can easily add this feature if you need it. When that's done, then orx could support the current desktop mode through the ini. Shouldn't be too hard to do, instead of using hardcoded default values the current desktop mode would be used.
    Unfortunately my computer is with my furnitures, "somewhere" between Canada and USA and I have no idea when they'll be delivered to us. :(
    Another thing:
    in the tutorial I set fullscreen attribute to true in the orx.ini file. the examples will start full screen. however after a moment game window will be minimized and the console window will come to the front. is this normal? is it not possible to have an full screen game when using the console window?

    thx in advance :D

    Ah, it's the first time I hear about this issue, I generally have no trouble with console popping through fullscreen. Is it when debugging or when running from anywhere?
    Which OS/version are you on? I'll see on my side if I can reproduce this issue.

    The easy fix would be to use a console-less version, but it then gets more annoying for debut output (even if those are save in an output file which name can be changed if needed).

    Hope this helps! =)
  • edited October 2010
    iarwain wrote:
    tdomhan wrote:
    hi everyone.
    I'm pretty new to orx, I hope my question is not too trivial.

    Hi and welcome here! =)
    I would like to achieve the following:
    instead of hardcoding the display width and height I would like to use the current width and height of the user in the fullscreen mode.
    is this possible using an ini file?

    Not directly through config, I'm afraid. You can use orx's display function to query the available modes but the display has to be initialized first. Also you can't query the desktop mode right now but I can easily add this feature if you need it. When that's done, then orx could support the current desktop mode through the ini. Shouldn't be too hard to do, instead of using hardcoded default values the current desktop mode would be used.
    Unfortunately my computer is with my furnitures, "somewhere" between Canada and USA and I have no idea when they'll be delivered to us. :(
    ok, it's not really urgent, if you would add this feature at some point in time, I would really appreciate it.
    Another thing:
    in the tutorial I set fullscreen attribute to true in the orx.ini file. the examples will start full screen. however after a moment game window will be minimized and the console window will come to the front. is this normal? is it not possible to have an full screen game when using the console window?

    thx in advance :D

    Ah, it's the first time I hear about this issue, I generally have no trouble with console popping through fullscreen. Is it when debugging or when running from anywhere?
    Which OS/version are you on? I'll see on my side if I can reproduce this issue.

    The easy fix would be to use a console-less version, but it then gets more annoying for debut output (even if those are save in an output file which name can be changed if needed).

    Hope this helps! =)
    I was not debugging, but much rather just executing using the bat file. I got a windows 7 64bit machine.

    Currently I'm justing reading myself through your tutorials and examples without doing actual coding...just messing around with the ini files.
  • edited October 2010
    tdomhan wrote:
    ok, it's not really urgent, if you would add this feature at some point in time, I would really appreciate it.

    No problem for that. Within an hour or two of work, orx should have this feature for all the available plugins/platforms (on iPhone it's the only available mode anyway). Just a matter of getting a computer back to do it. Hopefully around end of next week.
    I was not debugging, but much rather just executing using the bat file. I got a windows 7 64bit machine.

    Currently I'm justing reading myself through your tutorials and examples without doing actual coding...just messing around with the ini files.

    Good as it's also the system I have here at work so I'll try it later today or tomorrow. I'm sure you know about it but the tutorials are all described in details on the wiki.
    The most interesting one being the last two ones actually, I was not very inspired when I wrote most of them.
    Grey's tutorials (also on the wiki) are probably far more interesting. =)
  • edited October 2010
    iarwain wrote:
    No problem for that. Within an hour or two of work, orx should have this feature for all the available plugins/platforms (on iPhone it's the only available mode anyway). Just a matter of getting a computer back to do it. Hopefully around end of next week.
    ok, thanks in advance ;)
    Good as it's also the system I have here at work so I'll try it later today or tomorrow. I'm sure you know about it but the tutorials are all described in details on the wiki.
    The most interesting one being the last two ones actually, I was not very inspired when I wrote most of them.
    Grey's tutorials (also on the wiki) are probably far more interesting. =)
    yeah, I've seen the tutorials in the wiki. they are really good for you not beeing inspired^^

    anyway I just tried the fullscreen thing one more time with the standalone version ... and it worked as promised. then I tried with others to check... and I can't reproduce the problem anymore.
    I have no clue why it's working at once...it's a bit misterious.
  • edited October 2010
    tdomhan wrote:
    ok, thanks in advance ;)

    No problem! =)
    yeah, I've seen the tutorials in the wiki. they are really good for you not beeing inspired^^

    Ahah, thanks but they really could have been more game-oriented. I wish Grey would continue his series though. Grey, if you read this, you know what to do! ;)
    anyway I just tried the fullscreen thing one more time with the standalone version ... and it worked as promised. then I tried with others to check... and I can't reproduce the problem anymore.
    I have no clue why it's working at once...it's a bit misterious.

    Ok weird. I couldn't repro it either. Let me know if it happens again and you get consistent repro steps.
  • edited October 2010
    As of tonight, the svn version of orx will use the desktop resolution (aka video mode) if nothing is specified in the Display config section for ScreenWidth, ScreenHeight and ScreenDepth.
    That should work with all the available display plugins (GLFW, SDL & SFML) but I could only test with GLFW and SFML on mac OSX.
    You can't query the desktop resolution manually though as I couldn't find how to do it with SDL (SFML & GLFW provides such info but I had no luck finding it with SDL).
    A work around would be to let the default resolution at init and then ask orx about the screen size, and then go to whichever resolution you need. I'm not sure why one would want to do that thoug. :)
  • edited October 2010
    ok, sounds great, thx!

    is it save to use the svn version or is the download version more stable?
  • edited October 2010
    It is generally safe(r) to use the svn version.

    The only drawback is that you have to compile orx yourself (and that the tutorials/tools binaries are generally out of date as I only rebuild them prior to a release :)).
  • edited October 2010
    I encounter the similar problem.
    if I want to resize the screen after all init completed, what can I do?
  • edited October 2010
    You can use orxDisplay_GetVideoMode(), orxDisplay_GetVideoModeCounter(), orxDisplay_SetVideoMode(), orxDisplay_IsVideoModeAvailable(), orxDisplay_SetFullScreen() and orxDisplay_IsFullScreen() for handling different resolutions at runtime.

    These won't work on iPhone/iPod Touch/iPad though, as only fullscreen native modes are currently supported there.
  • edited November 2010
    In Iphone how could I put the screen down to landscape?
  • edited November 2010
    Simply rotate your camera 90°. :)

    You can find more info about the whole camera/viewport and coordinates systems in this thread, if you need it: https://forum.orx-project.org/discussion/670&limit=6&start=12#806

    By watching the accelerometer values (through the joystick inputs) it's easy to change from portrait to landscape on the fly. You can even attach your camera on an object if you want to add smooth transitions using an orxFX on it.
Sign In or Register to comment.