Skip to main content
GameDev.net gamedev.net
🔒 Locked

DirectDraw Surface problem

Started by danong Feb 25, 2009 at 7:40 AM 1 replies 550+ views
Original Post
danong
danong
Hi, i'm having a problem in surface blitting function, i created a primary surface, backbuffer surface ( ignore about this first ), and an offscreen surface, and i attached a bitmap and blit into the offscreen surface, but when i use the Blt() function provided by the IDirectDrawSurface7, the primary surface is not showing anything. And so later i tried to retrieve the DC using offscreen->GetDC(&dcOffscreen) and using the GDI function BitBlt(dcPrimary, 0, 0, 640, 480, dcOffscreen, 0, 0, SRCCOPY); amazingly, it worked!! What is going on here? is the function Blt() provided by the DDS7 is causing me trouble or anything? I am sure the surfaces created successfully and is following what the book told me ( i did even double check with the code provided on web ). so what's actually happening here? any clue about this? Thanks in advance. Regards, Daniel.
Technical ..? then Master Non-Technical first ...
Evil Steve
Evil Steve
What does IDirectDrawSurface7::Blt() return? Is it an error code?

DirectDraw is extremely dated now, and of very little use. I'd strongly recommend throwing the book away and getting on on D3D. Even 2D games are written in D3D these days, DDraw is really only for legacy apps. On Vista even, DDraw is emulated through D3D.
danong
danong
Thanks for the help,
i got it solved finally,
it's due to the Clipper thingy,
as i did actually set the clipper for the windowed version but i turn it to the fullscreen surface,
so it's not working, but i got it solved once i removed the clipper.

I am actually trying to experiment something on DDraw and not actually concerning about whether it's a legacy system, as the software & hardware things are getting updated way too fast in these days,
i'd just decided to step into ddraw for some personal reasons,
no worries, soon i will be migrating to d3d =)

Thanks once again.

Regards,
Daniel.
Technical ..? then Master Non-Technical first ...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.