-
offscreen grafics port?
Hi,
I'm new to windows programming(used to do mac before) and I've got a drawing question. On mac one could draw into an offscreen graphicsport and then copy it into the window using various masking options. This was much faster than drawing directly into the window and it was very functional for some purposes. Is there a similar thing under win32?
thx
/Unregistered
-
your probably talking about a memory dc
CreateCompatableDC()
CreateCompatableBitmap()
SelectObject()
look into those. I hope you know what an HDC is. if not, say so
-
Are you talking about double buffering?....write to an offscreen buffer and then flip to the screen?
WINAPI has OpenGL extensions that allow you to do this....SwapBuffers() (but there's a lot more work than just calling this API :)).. and Direct X of course also has this capability
Have a peek at NEHE
-
it seems he's talking memory DCs though. he mentioned masking operations and such, SRC_AND etc... "speed" I assume means anti-flicker or something. this is a double buffer using the GDI. Although if he really is after speed, go with OpenGL like fordy says. (that is available for mac though) Then again I don't know what he wants. ignore me now.
-
uhmm..let me be a more precise:
I want to be able to use drawing operations into an offscreen DC and then copy it to the windows DC...
like:
Draw a circle into offscreen DC
copy this circle into the onscreen DC,masking it with a region in conjunktion with SRC_OR,SRC_AND etc...
using this techinque will able me to copy 'parts' of the offscreen DC, like if I have a cirkle and a rectangle in a memory DC and a region masking the rectangle, I could mask it to copy only the rectangle into the onscreen DC.
so a function something like:
CopyFunc(Source DC, Destination DC, RegionMask, MaskFlags);
is there like such a function in win32?
thanks a bunch :)
/Unregistered
-
yup! I was right.
CreateCompatibleDC()
CreateCompatableBitmap()
SelectObject()
BitBlt() <-That's the function you're talking about.
look into all of these and you'll have everything you need.