Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dave.h

macrumors newbie
Original poster
Apr 30, 2005
7
0
I have my game working in windowed mode for the time being, and want to know how to

1) change the screen resolution and bit depth
2) ideally, create a custom 16-bit color array
3) apply the current subclass of NSImageView to the full-screen window.

I know options 1 and 3 must be pretty easy, so.... hopefully somebody can help...
 

dave.h

macrumors newbie
Original poster
Apr 30, 2005
7
0
okay...

hmm, well:

Using the tutorial you provided, I've figured out how to get the game into full screen mode. That is to say, put up a window covering the whole screen, thereby hiding the menu bar.

However, when I do this, my frame rate drops from a Nice even 60 down to 30 or even 20... Now, my code is in no way optimized - I'm redrawing the entire View on each frame update, mostly in anticipation of heavy background redrawing, scaling and sprite scaling.

To keep my frame rate at 60, my plan has been to use an 800x600 graphics context on computers as slow as mine (1.25 ghz), but I also have a 1280x960 sprite set from my original Adobe Illustrator exports.

Now that I'm pressed with the issue of running full screen, it seems to me that Quartz doesn't support changing of screen resolution, but I'm reluctant to use OpenGL for a sprite-based game -- and honestly, I find OpenGL somewhat confusing, and I can't get glDrawPixels to work properly. (ie, nothing is drawn) However, CGLayers aren't available until tiger, which seem to be exactly what I need for high speed 2d animation. I'll be getting tiger soon.. Should I just wait for CGLayers? If so, is it POSSIBLE to change to the 800x600 resolution WITHOUT OpenGL? That is, with Quartz??

I'd like as much input as possible, thanx :cool:
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
Quartz is not designed for what you are trying to do :( It is designed from the ground up to be resolution independant and as much as possible Vector based. You can change the screen resolution through some Core Graphics calls (I think) or Quicktime.

To acheive what you want and attain decent preformance you could try this: Do all your drawing into an 800x600 NSImage. The scale the final image to fit the screen. Whilst this is not free it is probably faster that scaling everything you draw. For faster (scaled) sprite drawing you can turn down the quality and scaling quality in Core graphics.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.