Copy bits ? what is it? how 2 use it?

hello
I want to save opengl displays as image files.
how can i do it?
what is copy bits?
can anyone tell me more about that or @least guide me to a suitable resource, preferably on the web.
thanks

Have you tried Apple’s devloper website?

There you can look through many online books, including Inside Macintosh.

–Kainsin

I have worked with copybits myself a couple of years ago. It is probably already ten years old so you shouldn’t be using it, since drawsprocket is better. It is just a function that copies data from one pixmap/bitmap to another using hardware Acceleration. It was handy for the first animation (games).Its prototype is (As i remember it):

c++
void copybits(const rect *source,const rect dest,bitmap sourcebmap,bitmap *desBitmap,RgnHandle clipregion,Copymode mode);

I have think reference from an old think c programm. if you like i can send it to you. It has a complete description of this function.
mailto isgoed @hotmail.com

Steven Verstoep

I have worked with copybits myself a couple of years ago. It is probably already ten years old so you shouldn’t be using it, since drawsprocket is better. It is just a function that copies data from one pixmap/bitmap to another using hardware Acceleration.

Ugh - so wrong. I’m sorry, but ignore this guy.

It is as old as the Macintosh itself (i.e. about 20 years old), and should be used anywhere you want to copy one part of a BitMap to another part of another BitMap. Unless you are especially experienced in writing a blitter, use CopyBits - it is robust and very fast. It uses hardware acceleration when available, but not always as glnewbee suggests. If hw is not available, it does it in sw.

Do not use DrawSprocket for this. It is not ‘better’ for simple blitting operations.

For saving image files from agl contexts, the Quake source has .tga file saving code in it somewhere. You probably won’t need CopyBits if you use glReadPixels instead.

I have worked with copybits myself a couple of years ago. It is probably already ten years old so you shouldn’t be using it, since drawsprocket is better. It is just a function that copies data from one pixmap/bitmap to another using hardware Acceleration.

Ugh - so wrong. I’m sorry, but ignore this guy.

It is as old as the Macintosh itself (i.e. about 20 years old), and should be used anywhere you want to copy one part of a BitMap to another part of another BitMap. Unless you are especially experienced in writing a blitter, use CopyBits - it is robust and very fast. It uses hardware acceleration when available, but not always as glnewbee suggests. If hw is not available, it does it in sw.

Do not use DrawSprocket for this. It is not ‘better’ for simple blitting operations.

For saving image files from agl contexts, the Quake source has .tga file saving code in it somewhere. You probably won’t need CopyBits if you use glReadPixels instead.

Back to the origional message, you asked how to save OpenGL images as files, I attempted to do this a while ago and had great difficulty, but I did come up with a hacked together way of doing it:

void DrawRoutine (ohh its loads of parameters!!!)
{
// I think you can guess what this does
drawOpenGLToWindow ();
// This starts quickdraw taking in data for a PICT image
OpenPicture (&BobThePicture);
// Now copy the image back to the same place, so that quickdraw registers that the image is there! I can’t rememebre the exact structure of copy bits bt it’s something like this.
CopyBits (OrigionalWindow, TheEntireWindowRect, OrigionalWindow, TheEntireWindowRect);
// Stop recording the picture and allow other areas access to the memory.
ClosePicture ();
// A routine for this may be found on developer.apple.com
SavePictFile (BobThePicture);
}

hi !
Thanks for the reply.
Is there any chance for me to know the exact details?
If possible, can you send me the source snippet to ssvv33@yahoo.com.
If that’s not possible, can you elaborate a li’l more as I am relatively new to mac and opengl both.

Thanks again

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.