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 5 of 5

Thread: wglCreateContext and directdraw

  1. #1
    Intern Newbie
    Join Date
    Mar 2001
    Location
    Discworld
    Posts
    40

    wglCreateContext and directdraw

    Hello,

    is it valid to obtain a device context handle from a window handle if the window already initialized direct draw and switched to fullscreen mode?
    The reason why i ask is because
    wglCreateContext always returns an invalid handle error code.
    First i thougt it's because i already initialized directdraw and i obtained the device context handle by GetDC(HandleOfDirecDrawWindow); so i tried to initialize opengl before direct draw. (without success - still invalid handle returned). Next thing i thought was maybe i can not obtain a device context from that window so i tried to use CreateDC to obtain a handle to a divice context. But wglCreateContext still complains that the handle is invalid....
    The strange thing is, ChoosePixelFormat() and SetPixelFormat() accepted the divce context handle. (regardless how it was obtained)

    An other question is, i've read that opengl can not render directly onto a direct draw surface - at least not on every system. Is this still the case? And on what does it depend if it works or not? I just wonder why there's a funktion called GetDC in the DirectDrawSurface class.
    Whats the usual way to get direct draw and opengl working in the same program? And how do i get the rendered image onto a direct draw surface - FAST?

    Argh...
    i'd better RTFM alot - Let me know where if you know any good sources of whisdom.
    Thank's in advance for any hints,
    XFire
    Hail to
    ...the fine folks at SGI.

  2. #2
    Member Regular Contributor
    Join Date
    Oct 2001
    Location
    Princeton, NJ
    Posts
    391

    Re: wglCreateContext and directdraw

    OpenGL and DirectDraw don't work together, the only way to use them in the same program is to destroy one and reintialize the other

  3. #3
    Intern Newbie
    Join Date
    Mar 2001
    Location
    Discworld
    Posts
    40

    Re: wglCreateContext and directdraw

    Argh....
    ****! Is there realy no way to do it?
    Hail to
    ...the fine folks at SGI.

  4. #4
    Member Regular Contributor
    Join Date
    Oct 2001
    Location
    Princeton, NJ
    Posts
    391

    Re: wglCreateContext and directdraw

    why do you need to?

  5. #5
    Intern Newbie
    Join Date
    Mar 2001
    Location
    Discworld
    Posts
    40

    Re: wglCreateContext and directdraw

    The game (2d only yet) is as good as finish and i thought to enhance it with some opengl effects. I can't use d3d because of the linux version (and i realy dont like to wirte the code two times)
    The main part of the game are some highly for speed optimized assembly funktions, that draw directly onto one of the backpuffer! I don't even know if i can port this funktions to opengl. Because i need the following capabilities:
    Direct access to one of the backpuffers.
    The backpuffer must be equal to the size of the screen resolution - meaning opengl is not allowed to stratch/scale a scene.

    C'mon there has to be a way to use opengl and directdraw (not direct3d) on the same programm! Else i can throu away eighter the linux version toghether with my opengl books or the windows version...
    Hail to
    ...the fine folks at SGI.

Posting Permissions

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