Re: menu options for an non-standard openGL context based application
Re: menu options for an non-standard openGL context based application
- Subject: Re: menu options for an non-standard openGL context based application
- From: Tobias Ford <email@hidden>
- Date: Wed, 19 Sep 2007 02:42:19 -0500
That's nice for general cocoa apps and I'm aware that.
For a game, you usually want to deal with things a little closer to
the os when you're grabbing a fullscreen context since you usually
suspend/kill the windowserver in the process. Also input is handled
completely differently and when using a controller fullscreen you
have click through issues and in games, we grab raw data and then
usually map it based off of keycodes all of the time.
Again, it's been a couple of years since I've been in osx game land.
Things change that I might not be aware of yet.
On Sep 19, 2007, at 1:39 AM, Alexander Spohr wrote:
Tobias,
doing the Interface by programming, without a nib, is suicide and
useless. So don’t bother - create a nib.
Then create and instantiate a controller-class (Controller.m/h will
do) in the nib and connect the app to it. The controller is the
apps delegate.
Implement
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
in your controller.
This will be called when the app is completely up. Start your game
from that point, not earlier!
If you have menu-items, implement actions in the controller like
- (IBAction)toggleDebug:sender
of
- (IBAction)fullscreen:sender
Do what you need there to change your state.
That is all you need.
atze
Am 19.09.2007 um 06:45 schrieb Tobias Ford:
We have a game that creates an NSWindowed opengl context for
windowed use and a full screen openGL context when capturing the
screen (the default release behavior). It toggles between the two
modes with key combinations. I've not over-ridden NSApplication
and I'm grabbing the events using NSApplication
nextEventMatchingMask. Also, while the final application is
bundled, there is no IB bundle being used in the application.
It's pretty much akin to a command line app being launched from
the bundle. This approach works great for solving the base game
event application requirements and slides in really well with our
other cross platform apis for creating the game view and getting
events.
In windowed debug mode though, I need to present either an os
based menu bar menu or a context pop-up menu for turning on and
off various features such as logging and rendering options for
various systems. All of the menu oriented examples that I've
looked at either require nib based solutions or at least a
controller class which I don't have. My attempts at just creating
and populating a menu programatically all crash further down in
the Obj-C/Cocoa layers. I'm guessing that this is due to some
missing step in my instantiation of the NSApplication.
My desired result is when hitting a key, unlocking the mouse from
the gl window, and then either creating this menu as a context or
mousing up to an already existing menu in the bar. I then need to
be able to catch the selection result so I can toggle a bool.
Since, I'm not nib/controller based, I'm at a loss for how to do
this.
Has anyone done something like this? If you have, can you point
me to either an example or documentation to do something like
this? I'm fine with either Cocoa (which I have small knowledge
of) or Carbon solutions (no knowledge of).
Thanks in advance and sorry for the cross posts. I wasn't really
certain where this belonged. To the openGL list, I'm hoping that
some else has done this and figured it was a good chance.
-------------------
Tobias Ford...
tobias1482 'at' mac.com
tford 'at' spacetimestudios.com
-------------------
Sr Programmer @ space time studios for a generic space game mmo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-games-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40freeport.de
This email sent to email@hidden
Freeport & Soliversum
Alexander Spohr
email@hidden
www.freeport.de
-------------------
Tobias Ford...
tobias1482 'at' mac.com
tford 'at' spacetimestudios.com
-------------------
Sr Programmer @ space time studios for a generic space game mmo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden