Apple "OpenGL Game Template"

Member
Posts: 204
Joined: 2002.09
Post: #16
aarku Wrote:This was just a skim.. what'd I miss?

Right, basically it is not an "OpenGL based game template" as the title suggests. It is simply a hodge-podge of previous OpenGL and OpenAL samples thrown together.

If it were advertised as a "Window/Fullscreen OpenGL with OpenAL" sample, I think we'd be fine with it (except for Frank C., for which it doesn't work Rasp)
Quote this message in a reply
Moderator
Posts: 522
Joined: 2002.04
Post: #17
TomorrowPlusX Wrote:Any particular parts which are rubbishy? "The whole thing" is not the answer I'm looking for Rasp

Feel free to add onto my list...

  • No screen/resolution selection. This is one of the main things you want a template like this to do as it's not trivial.
  • It's organized poorly. Input being handled in Renderer.c ??? (The Readme.txt says "Renderer.h and Renderer.c define the interface that the developer can choose to implement to suit their own needs." Yeah, I got a zero line template called "main.c" that does this just as well.
  • Game does not pause when in the background
  • The key handling should be abstracted, not a switch statement with magic numbers. See next point.
  • There is a half assed attempt to make this more portable. On one hand there is #define PATH_SEPARATOR "/" , but on the other hand there are direct calls to CoreGraphics in the same source file. Pick one!
  • "#define MAX_STR_LENGTH 1024" What the heck happened to PATH_MAX?
  • Poor OpenAL code. It doesn't handle errors very well at all.
  • Lame comments: alSourcePlay(gSource); // play the sound
  • Very few Mac OS X conventions followed. Come on, how hard is this in 2006 with Cocoa? If it was 1996 I'd have pity.
  • The sound loading function is hardwired to play one specific sound at load time. That's insanely unuseful! What's a template for, again?
  • I just find this funny from an Apple example: // OpenAL lessons: <http://www.devmaster.net/articles.php?catID=6>
  • usleep(1000000/getGameFPS()); Their FPS model assumes your game loop doesn't take any processor time. This is not useful. Why show a really wrong way to do something?
  • What's the point of programmically creating everything? If there is one, it's no excuse to skip little things like "menu bar" and "command-q quits."

This was just a skim.. what'd I miss?

-Jon

edit: Hehe, tweaked my post after a reply accidently, sorry Smile
Quote this message in a reply
Moderator
Posts: 522
Joined: 2002.04
Post: #18
KittyMac Wrote:Right, basically it is not an "OpenGL based game template" as the title suggests. It is simply a hodge-podge of previous OpenGL and OpenAL samples thrown together.

If it were advertised as a "Window/Fullscreen OpenGL with OpenAL" sample, I think we'd be fine with it (except for Frank C., for which it doesn't work Rasp)
The timing of the example suggests they will be endorsing it at WWDC in one of their games sessions or something. Too bad they're under NDA so I can't post a "roast" video when it comes to an audience Q&A.

-Jon
Quote this message in a reply
Member
Posts: 204
Joined: 2002.09
Post: #19
aarku Wrote:Too bad they're under NDA so I can't post a "roast" video when it comes to an audience Q&A.

I'll be at WWDC too, we can roast them together Smile
Quote this message in a reply
⌘-R in Chief
Posts: 1,261
Joined: 2002.05
Post: #20
aarku Wrote:Feel free to add onto my list...

So are you going to stand up at WWDC and shove the list in their faces? Grin

Edit: bah -- I'll take those posts as a yes. I should have read ahead.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #21
I'm looking forward to a vivid description of the particular shade of red on their cheeks Grin
Quote this message in a reply
Member
Posts: 353
Joined: 2002.04
Post: #22
Heh, they've taken the sample down, the link goes to a page not found error.
Quote this message in a reply
⌘-R in Chief
Posts: 1,261
Joined: 2002.05
Post: #23
Heh. You're right. It's still listed in the "New and Updated" block in the sidebar but they removed it. Obviously someone at Apple reads the forums. Smile
Quote this message in a reply
Moderator
Posts: 522
Joined: 2002.04
Post: #24
FreakSoftware Wrote:Heh. You're right. It's still listed in the "New and Updated" block in the sidebar but they removed it. Obviously someone at Apple reads the forums. Smile
Lucky I grabbed it before they took it down so I can use it for my upcoming MMORPG. Wink

-Jon
Quote this message in a reply
Member
Posts: 204
Joined: 2002.09
Post: #25
monteboyd Wrote:Heh, they've taken the sample down, the link goes to a page not found error.

It is possible that they mean to use it during a WWDC session, and that it was not supposed to be posted until after WWDC.

Or, as someone noted, they are reading these forums.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #26
aarku Wrote:Lucky I grabbed it before they took it down so I can use it for my upcoming MMORPG. Wink

-Jon

LOL LOL LOL
Quote this message in a reply
Apprentice
Posts: 13
Joined: 2006.09
Post: #27
OneSadCookie Wrote:<cough>http://onesadcookie.com/svn/repos/GameShell</cough> Rasp

OneSadCookie,

I was looking through the GameShell source code you linked above. I was wondering why you defined your GSOpenGLView class as and NSView as opposed to an NSOpenGLView?

Also is there anything wrong with using NSAnimation to handle the timing of your animations instead of NSTimer?

Please bear with me, I am very new to OpenGL and fairly new to Cocoa so there may be some obvious reasons for doing this that my lack of knowledge is not allowing me to see. Thanks.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #28
Xenos Wrote:I was looking through the GameShell source code you linked above. I was wondering why you defined your GSOpenGLView class as and NSView as opposed to an NSOpenGLView?

Good question Smile I seem to recall that I had problems in full-screen mode with NSOpenGLView setting the context back to its own context, rather than my full-screen context. It's been a long time though, so I'm not 100% certain any more...

Quote:Also is there anything wrong with using NSAnimation to handle the timing of your animations instead of NSTimer?

I have never used NSAnimation, but I suspect NSTimer is better -- you always want to run as fast as you can and block in -[NSOpenGLContext flushBuffer] rather than running at some random frame rate, for example.
Quote this message in a reply
⌘-R in Chief
Posts: 1,261
Joined: 2002.05
Post: #29
NSAnimation isn't at all useful for the core timing of a game.
Quote this message in a reply
Moderator
Posts: 522
Joined: 2002.04
Post: #30
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Trouble With Template Classes in C++ Nick 4 3,267 Nov 21, 2006 10:25 AM
Last Post: DoG
  Trouble with template classes ermitgilsukaru 2 2,725 Aug 11, 2006 02:00 PM
Last Post: ermitgilsukaru
  Template specialization of a method Fenris 4 3,174 Jul 11, 2005 02:45 PM
Last Post: OneSadCookie