PDA

View Full Version : Console in full screen


neverever
2004.10.05, 09:14 PM
Ok, I got this GL app that goes fullscreen using coregraphics. I want to pull down a console when a key is pressed. Of course when the console comes up you can enter in commands to get the app to perform tasks/change variables.

Is there a way I can use NSTextView or do I have to implement my own text processing system? If I could subclass NSText or NSTextView what would I hook it up with? I tried a making a window but I cant bring it above the shielding window.

Since my app already can process events my own implementation would consist of drawing polys/bitmaps/textures as letters everytime the user hit a key, and when the user hits enter execute the command.

So should I bother subclassing or just make my own?

arekkusu
2004.10.05, 09:37 PM
You might look at NSOpenGLContext's -createTexture:fromView:internalFormat:, if all you want to do is draw the content of an NSView (i.e. no mouse clicks, drags...)

OneSadCookie
2004.10.05, 09:51 PM
Er, -createTexture:FromView:internalFormat: only creates it from the OpenGL content of a view...

That said, it's pretty easy to get an NSView to draw to an NSBitmapImageRep, which you can then upload as a texture.

I've always thought it should be possible to pass events directly to the view, and keep updating the texture from it as it redraws itself, but I've not actually tried this.

arekkusu
2004.10.05, 11:16 PM
Arrrgh, you're right. Apple has this technote (http://developer.apple.com/qa/qa2001/qa1325.html) showing how to make any NSView into a texture, but it's not going to be very fast with NSBitmapImageRep's current RGBA pixel format limitations.

neverever
2004.10.06, 02:49 PM
Hmmm. Im using coregraphics so instead of NSOpenGLContext I have CGLContextObj. From what you say, Looks like its possible to make an offscreen NSView, make it draw to a bitmap, then keep reloading the texture? Sounds easier----ill try to do it.