Directdraw over a Opengl window possible?

I made a 3dWorld with opengl now i want to use directdraw to make a toolbar.
No opengl texture toolbar.
Ive managed to use directinput in my program which is great cause it has great mouse support.
When i get th device context(hdc) into my primary directdrawsurface, the program crashes.
Can anybody help me?
-Starnut coder

Use a good debugger I use olly it does 32 bit
. any way when it crashes you will see what routine it was running at the time, this shoud help you to pin point problem.

I’m fairly sure that OpenGL and DirectDraw don’t get along well at all. I believe that the DirectDraw HDC returned by GetHDC works only with the windows GDI, and is not OpenGL compatible

You can’t use DirectGraphics (direct draw, d3d) at the same time as OpenGL. Also, why did you put your question in a quote?


why don’t you use opengl to draw the tool bar? or is that just a silly suggestion?

i’m writing an opengl application with a tool bar done in opengl. its not hard.


Wow thanks for your answers and help!
But where did you find this topic. I posted it in january one year ago. I’ve decided some time then to just make opengl toolbars when using opengl and directdraw when using direct3d. But thanks for your replys and if you find a way to mix the two please post it.

  • greetings from Starnut

I think DirectDraw and OpenGL is possible. Baldur’s Gate didn’t use both of them? Opengl for the Spell Effects and DD for the rest.Maybe you should first create the window for DD and then add OGL support.
Anyway, in all 2D opperations (bliting from one memory position to another) DirectDraw is extremely fast compared with Opengl.

Well it´s possible to mix DirectDraw and OpenGL. I use DDraw to setup the DisplayMode (Change resolution and colordepth) and then go on using OpenGL.
But I don´t know if you can really use them at the same time…

I think its ok to use DirectDraw to set up screen resolution on most machines, but I have a software that locks my machine tight when I do that.

Its better not to mix them at all.

Why is the original post from 2001?