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

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
Set the pixel depth, and extent for the display

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.

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

Got funding?

not supported, return 0 (false)

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

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

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

There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki