Fullscreen

This is a discussion on Fullscreen within the Game Programming forums, part of the General Programming Boards category; I read some tutorials on fullscreen in OpenGL, but I don't get it. Can someone just tell me the simplest ...

  1. #1
    Hi ay_okay's Avatar
    Join Date
    Dec 2004
    Location
    Here
    Posts
    69

    Fullscreen

    I read some tutorials on fullscreen in OpenGL, but I don't get it. Can someone just tell me the simplest way to get into fullscreen mode in windows(OpenGL)?

  2. #2
    C Programmer Stack Overflow's Avatar
    Join Date
    Apr 2004
    Posts
    477
    Hello,

    If I'm correct, isn't it simply called using the ChangeDisplaySettings() function? For instance:
    Code:
    DEVMODE dmScreenSettings;
    /* initialize variable */
    memset(&dmScreenSettings, 0, sizeof(dmScreenSettings));
    /* Specify the size, in bytes, of the DEVMODE structure */
    dmScreenSettings.dmSize = sizeof(dmScreenSettings);
    /* Specify the width, in pixels, of the visible device surface. */
    dmScreenSettings.dmPelsWidth  = width;
    /* Specify the height, in pixels, of the visible device surface. */
    dmScreenSettings.dmPelsHeight = height;
    /* Specify in bits per pixel the color resolution of the display device. */
    dmScreenSettings.dmBitsPerPel = bits;
    /* Specify which of the remaining members in the DEVMODE structure have been initialized. */
    dmScreenSettings.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
    
    /* Change Display Settings to Fullscreen */
    if (ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL) {
        /* Change was not successful */
    }
    You check MSDN for more information:


    - Stack Overflow
    Segmentation Fault: I am an error in which a running program attempts to access memory not allocated to it and core dumps with a segmentation violation error. This is often caused by improper usage of pointers, attempts to access a non-existent or read-only physical memory address, re-use of memory if freed within the same scope, de-referencing a null pointer, or (in C) inadvertently using a non-pointer variable as a pointer.

  3. #3
    Hi ay_okay's Avatar
    Join Date
    Dec 2004
    Location
    Here
    Posts
    69
    thanks so much man!! ITS WORKING!!!!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  2. This is how to get your program to run fullscreen (console)
    By Raigne in forum Windows Programming
    Replies: 11
    Last Post: 11-25-2005, 08:26 AM
  3. problem with open gl engine.
    By gell10 in forum Game Programming
    Replies: 1
    Last Post: 08-21-2003, 05:10 AM
  4. cursor remains in openGL fullscreen
    By Ken Fitlike in forum Game Programming
    Replies: 5
    Last Post: 03-14-2002, 08:52 PM
  5. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 10:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21