OpenGL & DirectDraw

Started by
4 comments, last by Varokas Panusuwan 23 years, 12 months ago
Is it possible to render OpenGL result to DirectDraw Buffer? if so, how to do it ?
Advertisement
DirectDraw is used for fullscreen in win32 - it''s also used in Q3A.

BOOL DD_SetVideoMode(HWND hwnd,int width,int height,int colors)
{

HRESULT ddrval;

ddrval=DirectDrawCreate(NULL,&dDraw,NULL);
if (ddrval!=DD_OK) return FALSE;

ddrval=dDraw->SetCooperativeLevel(hwnd,DDSCL_EXCLUSIVE/DDSCL_FULLSCREEN);
if (ddrval!=DD_OK) return FALSE;

ddrval=dDraw->SetDisplayMode(width, height, colors);
if (ddrval!=DD_OK ) return FALSE;

// Workaround for RIVA 128
ddrval=dDraw->SetCooperativeLevel(hwnd,(DDSCL_NORMAL/DDSCL_FULLSCREEN));
if (ddrval != DD_OK) return FALSE;

return TRUE;
}

colors = color depth in bits

You must create a window first and pass its HWND to DD_SetVideoMode().

Visit our homepage: www.rarebyte.de.st

GA
Visit our homepage: www.rarebyte.de.stGA
Then call GetDC(), SetPixelFormat(), wglCreateContext()... as usual.

Visit our homepage: www.rarebyte.de.st

GA
Visit our homepage: www.rarebyte.de.stGA
Damn, that''s so much easier than I figured it would be...
Looks like I''ll have to try it sometime, unless OpenGL ( or OpenML rather ) comes up with a decent set of 2D functions!


#pragma DWIM // Do What I Mean!
~ Mad Keith ~
**I use Software Mode**
It's only funny 'till someone gets hurt.And then it's just hilarious.Unless it's you.
Err... Excuse me
You mean lpSurface->GetDC(...); right?
or just GetDC(...);
Because if it is a DirectDraw Buffer
I must call lpSurface->ReleaseDC(..) before I
blit in to another surface.
As you can see I'm only the beginner


Edited by - Varokas Panusuwan on 5/6/00 2:44:23 AM
I think GetDC() Win32 API function...

This topic is closed to new replies.

Advertisement