View Full Version : Blit Routine
Stalin55
2006.07.30, 03:30 PM
I have posted here before concerning an older 2d isometric engine that I had written several years ago and that I now want to update in order to make a game.
My problem is that this engine uses CopyBits() for drawing graphics and CopyBits() is now deprecated. Are there any blit routines that anyone knows of that I can use in place of CopyBits() without implementing a whole new framework such as OpenGl OpenGL or anything like that? I suppose I could always write my own blit routine, although I would like to avoid this at all costs for obvious reasons.
OneSadCookie
2006.07.30, 06:27 PM
All of QuickDraw is deprecated, not just CopyBits. That means you *will* be using an entirely new framework, if you want to get rid of all your deprecation.
OpenGL is the way to go.
Stalin55
2006.07.30, 10:40 PM
How likely do you think it is that Apple will drop all of their deprecated QuickDraw functions either before OSXI or after it?
OneSadCookie
2006.07.30, 10:54 PM
As yet, Apple haven't signaled a change of that kind of magnitude, and as far as I'm aware, functions that were deprecated even in very early releases of Mac OS X are still available and functioning.
The issue is more that leopard is likely to bring resolution-independent UI, and QuickDraw graphics will not look attractive when scaled.
Stalin55
2006.07.30, 11:22 PM
Thanks for the previous reply it was a big help. I have another issue with my engine. I recently imported my old engine from CodeWarrior to xcode. For some reason uknown to me, the main game window was was not displaying any graphics. I then went and made a simple mock up of my graphics engine and tried to make it copy a simple picture stored in a resource into a gworld, and then copy it from the gworld into the window. This did not work and I have no idea why(it works fine in CodeWarrio. The only reason I can think of is that there might be some conflict with using PICTs stored in resources in xcode, is there?
OneSadCookie
2006.07.30, 11:33 PM
Resources are also not recommended for new development (since Mac OS X can run on file systems without support for resource forks, and most compression formats have issues with preserving them).
That said, I'm not aware of any issues with resources in Xcode... but then again, it's not something I (or many people at all) have ever dealt with.
Windows on Mac OS X are double buffered, I seem to recall having to call QDFlushPortBuffer (or something like that) to get stuff to show up in the past...
arekkusu
2006.07.31, 12:16 AM
Old ResourceManager resources are still usable, just don't put them in a resource fork. You can make a data-fork resource file, check the manpage for ResMerger.
Stalin55
2006.07.31, 03:59 AM
Ok, I'm not exactly sure what you mean but I can tell that it is helpful. I have previously included a resource file in the resource folder in my project. Now practically speaking what exactly do I need to do to the resource file to get it to work?
szymczyk
2006.07.31, 02:30 PM
Now practically speaking what exactly do I need to do to the resource file to get it to work?
I have detailed instructions on how to get resource files to work with Xcode on my Xcode Tools Tips page (http://www.meandmark.com/xcodetips.html). Scroll down to the Using Resource Files with Xcode tip.
If you decide to switch from QuickDraw to OpenGL, you should convert your PICT resources to PICT (or another format like PNG or JPEG) files. Doing so will make loading images for textures easier.
OneSadCookie
2006.08.10, 12:04 AM
http://www.idevgames.com/forum/showpost.php?p=118761&postcount=10
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.