Wiki source for ioSetDisplayMode


Show raw source

======**sqInt ioSetDisplayMode( sqInt width, sqInt height, sqInt depth, sqInt fullscreenFlag) **======

**Parms**:
width pixels wide
height pixels high
dept depth of pixel 1,2,4,8,16,32

**return**: 1 or 0, to return true or false object

**From**: Interpreter
**Why**:
Set the pixel depth, and extent for the display

**Responsibility**:
Sometimes a game developer wants to set a particular screen size (640x480) and color depth 8 bit.
This optional api attempts to ask the operating system to modify the display mode.

**MacIntosh**
//os-9/OSXCarbon//
If headless or browser drawing context isn't ok then fail
Get the dominate screen for the squeak window, then attempt to set the display mode following Apples rules for CGDisplayBestModeForParameters:
This function tries to find an optimal display mode for the specified display. The function first tries to find a mode with the specified pixel depth and dimensions equal to or greater than the specified width and height. If no depth match is found, it tries to find a mode with greater depth and the same or greater dimensions. If a suitable display mode is not found, this function simply returns the current display mode.

After this we attempt to set the display to the best mode, if failure return 0

Then call ioSetFullScreen and return 1

We note that os-x will restore the display back to the setting in the display control panel when Squeak terminates

//Cocoa://
Got funding?

**iPhone**
not supported, return 0 (false)

**Unix**
Not supported, fprintf to syserr and return 0 (false)

**Windows**
Not supported for _WIN32_WCE.
Attempt to set the DirectXSetDisplayMode watch out for being in a browser window
if headless or it fails then return 0
then call ioSetFullScreen
then return 1

**BUGS**
macintosh on failure to find the exact match for mode is not an error, but it is on windows.
On macintosh if QDGetCGDirectDisplayID does not exist the function causes a recursive call

Valid XHTML :: Valid CSS: :: Powered by WikkaWiki