From 4811b7c7e02c0612975a8526f8ebba49ece0e72b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 16 Sep 1999 22:45:24 +0000 Subject: initial check-in --- src/glut/beos/glutDstr.cpp | 79 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 src/glut/beos/glutDstr.cpp (limited to 'src/glut/beos/glutDstr.cpp') diff --git a/src/glut/beos/glutDstr.cpp b/src/glut/beos/glutDstr.cpp new file mode 100644 index 0000000000..c594cfdafd --- /dev/null +++ b/src/glut/beos/glutDstr.cpp @@ -0,0 +1,79 @@ +/*********************************************************** + * Copyright (C) 1997, Be Inc. All rights reserved. + * + * 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 = BGL_DOUBLE; + gState.swapHack = true; // assume single buffered + + char *word = strtok(gState.displayString, " \t"); + do { + char *cstr = strpbrk(word, "=>