getting Screen resolution in Carbon

majestik666
Unregistered
 
Post: #1
Hi,

I have an openGL app that can switch from window/fullscreen,and when
switching i need to resize my openGL viewport to match the new window resolution
(which will be the screen res as i don't change mode), so I need to find
out the screen resolution, any idea ?

I checked SWAP_AREA or RECT_AREA etc but they're not returning the
correct values ...
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
1) Don't write new code in Carbon. Carbon is all but dead. Cocoa is easier and better documented. Even if you have a cross-platform codebase.

2) Is your viewport actually wrong? It seems to be set correctly when you attach the first drawable to a context...

3) The code you need is neither Carbon nor Cocoa, but CoreGraphics. CGGetActiveDisplayList and CGDisplayCurrentMode are the functions you need.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  DPI and Resolution for Graphics mickyg 9 8,997 Apr 27, 2012 03:02 PM
Last Post: Andres Calil
  switching screen resolution NelsonMandella 3 3,517 Apr 25, 2010 01:33 PM
Last Post: SethWillits
  OpenGL full screen mode leaves garbage on screen when exiting app Malarkey 5 5,357 Nov 19, 2008 12:51 PM
Last Post: Malarkey
  game image sizes and screen resolution leRiCl 5 4,370 Jul 2, 2008 03:31 AM
Last Post: leRiCl
  Changing resolution while already in full-screen mode? Malarkey 1 2,701 Jun 10, 2008 07:49 PM
Last Post: AnotherJake