Taxxodium
2005.03.17, 02:45 PM
Hey,
Quick question here. I'm working on a little experiment that consists of having an image that is then sliced in smaller images. I then use the smaller images to move them around, like in my game HeadBreaker (http://www.edot-studios.com/webgroups2/index.php?menu_item=213).
I was wondering if doing this kind of drawing would be better (read: faster) if it was done in OpenGL, instead of Quartz. However, if I do this in OpenGL, I suppose I'll have trouble with the camera position, as I want the whole image to be shown in the entire window (I don't want black spaces).
The coordinates in OpenGL are not in pixels, so I don't know how to draw all the tiles.
I'm using Cocoa and so for the textures I would just use NSImages in an array, and then draw by using a double for loop. I have sample code (http://developer.apple.com/samplecode/Custom_Cocoa_OpenGL/listing12.html) for turning NSImages to OpenGL Textures.
Obviously, doing this stuff in OpenGL has a lot of benefits, like doing stuff in 3D and getting hardware acceleration.
Quick question here. I'm working on a little experiment that consists of having an image that is then sliced in smaller images. I then use the smaller images to move them around, like in my game HeadBreaker (http://www.edot-studios.com/webgroups2/index.php?menu_item=213).
I was wondering if doing this kind of drawing would be better (read: faster) if it was done in OpenGL, instead of Quartz. However, if I do this in OpenGL, I suppose I'll have trouble with the camera position, as I want the whole image to be shown in the entire window (I don't want black spaces).
The coordinates in OpenGL are not in pixels, so I don't know how to draw all the tiles.
I'm using Cocoa and so for the textures I would just use NSImages in an array, and then draw by using a double for loop. I have sample code (http://developer.apple.com/samplecode/Custom_Cocoa_OpenGL/listing12.html) for turning NSImages to OpenGL Textures.
Obviously, doing this stuff in OpenGL has a lot of benefits, like doing stuff in 3D and getting hardware acceleration.