Simple Direct Draw window.

I am a beginner game programmer and I want to draw just a simple full screen mode window using Direct Draw (not Direct 3D. I can find lots of code but I can't find anything with just the simplest Direct Draw window possible. I would appreciate it if someone could show me the code to do that. Thanks.


  • I have questions too.
    What compiler do you use. It may be diferent solutions
    for diferent compilers.
    Can you create window (application main window)
    If you can, it is very simple to draw something.
    You draw on surfaces that can be created by calling
    CreateSurface() function.
    First you need to create DirectDraw object
    calling DirectDrawCreate()
    with parameter LPDIRECTDRAW as second
    eg: DirectDrawCreate(NULL, lpdd, NULL);
    DD->SetCooperativeLevel(WindowHandle, DDSCL_EXLUSIVE | DDSCL_FULLSCREEN);
    DD->SetDisplayMode(640, 480, 16); // set full screen
    then create surface using LPDIRECTDRAWSURFACE
    and LPDDSURFACEDESC to specify surface parameters;
    memset(&lpddsd, 0,sizeof(lpddsd));
    lpddsd->dwSize = sizeof(lpddsd) // surfacedesc
    some parameters specify what kind of surface do you want to create.
    Primary surface is the surface that is visible on screen.
    It`s allocated in video card memory.
    I don`t remember what`s first and whay`s second but it goes like this
    CreateSurface(&lpddsd, &surf, ...)

    I`ll send you some source code of my games, its very simple but it`s
    too much to tell you (Clipper, BitBlt, Restore (surface) ...)

    let me know if you want some.
    take care!!!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion