Apple "OpenGL Game Template"
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
)
Virus Out
Big Bang Board Games
Adventures on Pirate Isle
Solace - Strategy, War, and Glory!
The Belt
TomorrowPlusX Wrote:Any particular parts which are rubbishy? "The whole thing" is not the answer I'm looking for
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
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.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.
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)
-Jon
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
Virus Out
Big Bang Board Games
Adventures on Pirate Isle
Solace - Strategy, War, and Glory!
The Belt
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?

Edit: bah -- I'll take those posts as a yes. I should have read ahead.
I'm looking forward to a vivid description of the particular shade of red on their cheeks
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.
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.Lucky I grabbed it before they took it down so I can use it for my upcoming MMORPG.

-Jon
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.
Virus Out
Big Bang Board Games
Adventures on Pirate Isle
Solace - Strategy, War, and Glory!
The Belt
aarku Wrote:Lucky I grabbed it before they took it down so I can use it for my upcoming MMORPG.
-Jon
LOL
OneSadCookie Wrote:<cough>http://onesadcookie.com/svn/repos/GameShell</cough>
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.
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
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.
NSAnimation isn't at all useful for the core timing of a game.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Trouble With Template Classes in C++ | Nick | 4 | 2,873 |
Nov 21, 2006 10:25 AM Last Post: DoG |
|
| Trouble with template classes | ermitgilsukaru | 2 | 2,361 |
Aug 11, 2006 02:00 PM Last Post: ermitgilsukaru |
|
| Template specialization of a method | Fenris | 4 | 2,794 |
Jul 11, 2005 02:45 PM Last Post: OneSadCookie |
|

