View Full Version : Problems with rendering using NSOpenGLView
wyrmmage
2006.08.23, 08:25 PM
I've been trying to create "pong", but I'm having trouble displaying it :\
The source code is raher long, but I'd be glad if you could perhaps help me out with it :) It's at http://www.ghettointeractions.com/mac/ if you want to download it (in zipped version) or I can post it hear if you fear a virus ;)
Thanks,
-wyrmmage
Frogblast
2006.08.24, 12:52 AM
It crashes for me immediatly on launch. At first glance, you've added a bunch of code to main().
With Cocoa, you really shouldn't do that. You should instantiate your game controller as part of the NIB.
For something as simple as Pong, I would actually suggest you forget about OpenGL, and try to follow the Cocoa examples and tutorials, and draw it all in 2D. Once that works, you can re-implement the rendering in OpenGL.
Cocoa and OpenGL are two very big subjects, and attempting to begin them both at the same time will lead to unnecessary frustration.
unknown
2006.08.24, 10:24 AM
Hahaha a virus! :lol:
you dont want to be editing main.m, ever.
All your key handling should be in Lesson02View.
wyrmmage
2006.08.24, 12:27 PM
hmmm....not quite sure how to instantiate using NIBS; I really haven't had much experience with this sort of thing. I'd prefer to use OpenGL because I one day (perhaps in three or four months) I hope to make something 3D, and I'd rather just go ahead and get the problems with using Cocoa and OpenGL over with.
How am I going to handle my key presses in Lesson02View? Just copy that part of the code from Lesson02Controller?
In the meantime I'll be reading up on NIBS ;)
Thanks for the help,
-wyrmmage
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.