Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: win32 & OpenGL

  1. #1
    Intern Newbie
    Join Date
    Jan 2003
    Location
    Lerwick,Shetland,Scotland,UK
    Posts
    31

    win32 & OpenGL

    ok..first off this is a win32 problem..
    not really an opengl problem - but i am
    constructing a new windowing wrapper lib for
    use with opengl.

    EnumerateDisplaySettings()
    requires that you
    set the dmDriverExtra member to indicate the size, in bytes, of the additional space available to receive private driver data.

    what i want to know is simply..how can you
    determine this value - or is this for use
    with the cbWndExtra field of WindowClass???

    Any help would be great...ive looked on
    the microsoft dev site..but im still non
    too sure about this...

    thanks,
    Matt.

  2. #2
    Junior Member Regular Contributor
    Join Date
    Feb 2002
    Posts
    247

    Re: win32 & OpenGL

    EnumerateDisplaySettings()
    requires that you
    set the dmDriverExtra member to indicate the size, in bytes, of the additional space available to receive private driver data.
    I don't believe you have to set any of the fields of the DEVMODE structure before calling EnumDisplaySettings(). This field is not even set by the function. It sets the following fields.
    dmBitsPerPel
    dmPelsWidth
    dmPelsHeight
    dmDisplayFlags
    dmDisplayFrequency

  3. #3
    Intern Newbie
    Join Date
    Jan 2003
    Location
    Lerwick,Shetland,Scotland,UK
    Posts
    31

    Re: win32 & OpenGL

    Ok thanks man..
    - its hard to know what exactly is & is not
    - supposed to happen..according to MSDN you
    have to set this field..hehe..guess not.

    + sorry if posting this topic is annoying..
    & not really an opengl issue..jst i really
    needed some feedback.

    thanks again, now back to coding

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    2,704

    Re: win32 & OpenGL

    Note that some drivers will write beyond the DEVMODE structure even if you don't have extra space there. What I do is allocate a struct which adds another 1024 bytes after the DEVMODE and cast that to DEVMODE*, which works around these driver bugs.
    "If you can't afford to do something right,
    you'd better make sure you can afford to do it wrong!"

  5. #5
    Intern Newbie
    Join Date
    Jan 2003
    Location
    Lerwick,Shetland,Scotland,UK
    Posts
    31

    Re: win32 & OpenGL

    cheers m8..
    - i was sure there was a problem..i had
    allocated xtra memory in my old cold..i think
    about 6k.. & this fixed the problem..

    shame microsoft didnt document this very
    well.

    hehe..i will go back & modify my new code +
    add 1k to 2k to the struct...lol this is
    all kinda messed up

    many thanks,
    matt.

  6. #6
    Senior Member OpenGL Pro
    Join Date
    Feb 2002
    Location
    Bonn, Germany
    Posts
    1,652

    Re: win32 & OpenGL

    Originally posted by jwatte:
    Note that some drivers will write beyond the DEVMODE structure even if you don't have extra space there. What I do is allocate a struct which adds another 1024 bytes after the DEVMODE and cast that to DEVMODE*, which works around these driver bugs.
    Whose drivers do that? Just curious ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •