/*********************************************************** * Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby. * * This program is freely distributable without licensing fees * and is provided without guarantee or warrantee expressed or * implied. This program is -not- in the public domain. * * * FILE: glutDstr.cpp * * DESCRIPTION: convert display string into a Be options variable ***********************************************************/ /*********************************************************** * Headers ***********************************************************/ #include #include #include #include "glutint.h" #include "glutState.h" /*********************************************************** * FUNCTION: glutInitDisplayString * * DESCRIPTION: sets the display string variable ***********************************************************/ void APIENTRY glutInitDisplayString(const char *string) { if (gState.displayString) { free(gState.displayString); } if (string) { gState.displayString = strdup(string); if (!gState.displayString) __glutFatalError("out of memory."); } else gState.displayString = NULL; } /*********************************************************** * FUNCTION: __glutConvertDisplayModeFromString * * DESCRIPTION: converts the current display mode into a BGLView * display mode, printing warnings as appropriate. * * PARAMETERS: if options is non-NULL, the current display mode is * returned in it. * * RETURNS: 1 if the current display mode is possible, else 0 ***********************************************************/ int __glutConvertDisplayModeFromString(unsigned long *options) { ulong newoptions = 0; char *word = strtok(gState.displayString, " \t"); do { char *cstr = strpbrk(word, "=>