• Full screen

    From James Van Buskirk@21:1/5 to Jean-Christophe on Mon Aug 17 17:12:48 2015
    "Jean-Christophe" wrote in message news:mqtm4q$eq7$1@speranza.aioe.org...

    I'm writing an OpenGL app under Windows and I'd like
    to have the viewport to full screen, how do I do that ?

    That's pretty much the content of NeHe Lesson1. My
    recollection is that NeHe uses 16 bits per pixel which my
    current video card and monitor (GTX 650 and 50HU6950)
    don't support so you would have to change to 32 bpp.

    Also Lesson1 changes resolution to 640 X 480 which is
    suboptimal on the above video subsystem. You can use
    GetSystemMetrics to get the current dimensions of the
    screen which one would normally assume are the optimal
    dimensions unless the user like to do things suboptimally.

    But since Windows Vista or so, Windows lies to you about the
    dimensions of the screen, so you have to use SetProcessDPIAware
    to tell Windows not to lie, but since older versions of Windows
    don't have this API, you have to attempt to load it dynamically
    via LoadLibrary/GetProcAddress and only if that worked you
    can invoke SetProcessDPIAware. Annoying that you have to
    invoke those extra 3 functions before GetSystemMetrics works,
    but that's Windows.

    I think I have an example in Fortran at http://home.comcast.net/~kmbtib/Fortran_stuff/testpattern.zip

    Newer versions of Windows use SetProcessDpiAwareness
    which complicates matters further and is used also in the
    above example.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jean-Christophe@21:1/5 to All on Tue Aug 18 00:15:20 2015
    Hi all,

    I'm writing an OpenGL app under Windows and I'd like
    to have the viewport to full screen, how do I do that ?

    TIA

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jean-Christophe@21:1/5 to All on Wed Aug 19 17:59:21 2015
    "Jean-Christophe" :
    I'm writing an OpenGL app under Windows and I'd like to have the viewport
    to full screen, how do I do that ?

    Thanks for answering, James.

    I'm a bit surprised it sounds so heavy to implement such a simple thing.
    I thought I just had to set the OpenGL viewport to the maximal screen resolution to put the window of my software into full screen display (?) However it seems that Windows will interfer, there's something missing,
    and I'm pretty shure that it's just a few lines of code, not a bunch.

    I understand that my question is not OpenGL-only related,
    but I really didn' t find how to do that and I badly need this.

    ( BTW, I never experienced a mismatch between the actual screen
    resolution and the values returned by a call to GetSystemMetrics )



    "James Van Buskirk"
    That's pretty much the content of NeHe Lesson1. My
    recollection is that NeHe uses 16 bits per pixel which my
    current video card and monitor (GTX 650 and 50HU6950)
    don't support so you would have to change to 32 bpp.
    Also Lesson1 changes resolution to 640 X 480 which is
    suboptimal on the above video subsystem. You can use
    GetSystemMetrics to get the current dimensions of the
    screen which one would normally assume are the optimal
    dimensions unless the user like to do things suboptimally.
    But since Windows Vista or so, Windows lies to you about the
    dimensions of the screen, so you have to use SetProcessDPIAware
    to tell Windows not to lie, but since older versions of Windows
    don't have this API, you have to attempt to load it dynamically
    via LoadLibrary/GetProcAddress and only if that worked you
    can invoke SetProcessDPIAware. Annoying that you have to
    invoke those extra 3 functions before GetSystemMetrics works,
    but that's Windows.
    I think I have an example in Fortran at http://home.comcast.net/~kmbtib/Fortran_stuff/testpattern.zip
    Newer versions of Windows use SetProcessDpiAwareness
    which complicates matters further and is used also in the
    above example.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Van Buskirk@21:1/5 to Jean-Christophe on Wed Aug 19 10:11:54 2015
    "Jean-Christophe" wrote in message news:mr28rm$dtl$1@speranza.aioe.org...

    I'm a bit surprised it sounds so heavy to implement such a simple thing.
    I thought I just had to set the OpenGL viewport to the maximal screen resolution to put the window of my software into full screen display (?) However it seems that Windows will interfer, there's something missing,
    and I'm pretty shure that it's just a few lines of code, not a bunch.

    As I said, the code you need is available in several programming
    languages in the NeHe website.

    I understand that my question is not OpenGL-only related,
    but I really didn' t find how to do that and I badly need this.

    ( BTW, I never experienced a mismatch between the actual screen
    resolution and the values returned by a call to GetSystemMetrics )

    In Windows 8, go to Start -> Control Panel -> Display, and there is
    a slider under Change the size of all items. If you slide it over
    towards Larger, Windows will start to lie. If you're running at
    3840 X 2160 (like you get on essentially any but the cheapest TVs
    you see at the TV store today) the default is for Windows to do some
    kind of scaling without warning you about it. Life has gotten more
    complicated with this new standard in UHD monitors, not to
    mention the possibility for dragging windows between their
    smartphone and laptop and TV.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alberto Luaces@21:1/5 to Jean-Christophe on Wed Aug 19 23:46:48 2015
    "Jean-Christophe" writes:

    I'm a bit surprised it sounds so heavy to implement such a simple thing.
    I thought I just had to set the OpenGL viewport to the maximal screen resolution to put the window of my software into full screen display (?) However it seems that Windows will interfer, there's something missing,
    and I'm pretty shure that it's just a few lines of code, not a bunch.

    At this point I'd recommend you to use a library like SDL2 to handle the
    window and GL context for you.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jean-Christophe@21:1/5 to All on Thu Aug 20 17:44:25 2015
    "Alberto Luaces"
    At this point I'd recommend you to use a library like
    SDL2 to handle the window and GL context for you.

    Thanks Alberto, I checked quickly and it looks convenient.
    But I try to avoid using 'external' code as much as I can
    because I like to keep a hand on what's going on inside my code,
    and also distribute without the need to provide yet another libs/dlls.

    I'll keep on searching and will post here if I find something worth.
    ( & I can still use another pointer to potential solutions ... :-)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jean-Christophe@21:1/5 to All on Thu Aug 20 17:54:14 2015
    "James Van Buskirk" :
    As I said, the code you need is available in several
    programming languages in the NeHe website.

    Yes, and I thank you again, James.
    The code I saw at this website is of quite good
    quality and I'll come back to it if I get stuck.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)