drawing

Sage
Posts: 1,234
Joined: 2002.10
Post: #16
Quartz provides much higher quality rendering than OpenGL, in a hardware-agnostic way. It isn't exactly a fair comparison.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #17
in the context of sprite games, there's no comparison Rasp
Quote this message in a reply
Lord Vader
Unregistered
 
Post: #18
Thanks every one for all your replies! You given me a lot of useful information. Smile
Quote this message in a reply
Moderator
Posts: 508
Joined: 2002.09
Post: #19
I found an interesting article about Texture Mapping in OpenGL: http://www.gamedev.net/reference/article...cle947.asp

Now, obviously you need to load an image yourself, but I was wondering, does SDL provide a way to load any image and use it as texture right away? Or do you still need to write some code to load a file and turn it into a texture?

"When you dream, there are no rules..."
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #20
SDL_image can load many kinds of images, but using them as textures isn't easy, and all the 'code on the 'net to do it is broken.

I personally like to recommend QuickTime for the purpose, which is much safer, but of course not cross-platform.

If you do want cross-platform, you can do worse than writing libpng and libjpeg code yourself.
Quote this message in a reply
Member
Posts: 260
Joined: 2005.05
Post: #21
OneSadCookie Wrote:I personally like to recommend QuickTime for the purpose, which is much safer, but of course not cross-platform.

If you do want cross-platform, you can do worse than writing libpng and libjpeg code yourself.
(On texture loading.) I use these two in combination. If libjpeg doesn't work (which is the case in combination with GLUT under MacOS9, for example) then I can fall back to QuickTime as long as I work on the Mac, and it will probably do the trick under Win32 too.

With one common call to load JPEG files, mapped to either solution, I always have a solution that I can switch to, instantly.

Concerning the initial question, what API to use, I definitely go the OpenGL route for future games. There's nothing wrong with QuickDraw as long as it solves your problem, but it has some serious limitations, like lacking rotation.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #22
QuickDraw is deprecated, that's wrong enough Smile
Quote this message in a reply
Member
Posts: 260
Joined: 2005.05
Post: #23
OneSadCookie Wrote:QuickDraw is deprecated, that's wrong enough Smile
It works and will work in the forseeable future, so I don't care about "depreciation" as long as it doesn't affect stability and security. Portability and lack of features, however, are worse problems.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #24
You'll get screeds of warnings if your deployment target is set to 10.4, such as it might be (for example) if you were compiling for Intel.

It's just plain not a good idea to write new code against QuickDraw now.
Quote this message in a reply
Member
Posts: 567
Joined: 2004.07
Post: #25
it's incredibly easy to turn an SDL_Surface into a texture. Lock the surface, extract the pixels, and generate the texture. Simple.

It's not magic, it's Ruby.
Quote this message in a reply
Member
Posts: 260
Joined: 2005.05
Post: #26
OneSadCookie Wrote:You'll get screeds of warnings if your deployment target is set to 10.4, such as it might be (for example) if you were compiling for Intel.

It's just plain not a good idea to write new code against QuickDraw now.
I have said nothing else. New code is something completely different. There, I go for OpenGL.

But if Apple makes it unbearable to port old code by tormenting developers with "screeds of warnings", then they are making a BIG mistake! They have lost lots of old applications in the move to OSX. Now they might lose even more. That is a bad thing since it means losing lots and lots of loyal customers, who are often old and rich, and in high positions in the not very numerous companies who use Macs. They don't want to relearn all their applications, they want as many of the old ones as possible, preferrably developed and modernized, integrated in the workflow that they (or even the company) has used for years.

For us, using QuickDraw means I can compile for Mac and Win32 with the same code, but that isn't true for most people. I have an in-house Mac-to-Win library that works nicely. Our major application compiles from the same code, with tons of QuickDraw and Mac Toolbox calls. Works great under MacOS9 and XP, but due to Apple (some unsupported features in Carbon), the OSX version is delayed. If we can't use QuickDraw under MacIntel, we will probably have to drop the Mac version, something we definitely do not want to do.

So if Apple is too hard on us, we may have to maintain our QuickDraw-based code for Win32 alone. Wacko
Quote this message in a reply
Lord Vader
Unregistered
 
Post: #27
I have looked all over the place and just dont see much on using openGL for 2d games. I am going to read what i have and try to figure it all out. Thanks for all the help. If any one finds something please let me know. Thanks again.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #28
I'm sure you can get rid of the warnings with -Wno-deprecated or something... or just set the deployment target to something lower.

Apple's right to warn about deprecated functions, though, and code using them should be migrated at the earliest possible convenience. In QuickDraw's case, once the resolution-independent UI stuff comes through, things drawn with it will look horrible. You don't want that for your flagship product.
Quote this message in a reply
Sage
Posts: 1,066
Joined: 2004.07
Post: #29
I know you've stated your preference of Carbon for programming but if you decide that you're only making Mac games, I'd suggest you have a look at this site which has fantastic tutorials for using OpenGL with Cocoa.

I can help you if you choose to use Cocoa or SDL. Feel free to ask any questions on AIM or email. They're both in my profile here. I should be able to answer most beginning questions (I still haven't learned a lot of advanced stuff yet).
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #30
The tutorials on that site are horribly broken. I recommend anyone who wants to program OpenGL in Cocoa on the Mac avoids it like the plague.

And Nick, Ingemar has more programming experience than you and you and you and I combined. He doesn't need that kind of help Rasp
Quote this message in a reply
Post Reply