diff options
author | José Fonseca <[email protected]> | 2011-07-14 17:28:52 +0100 |
---|---|---|
committer | José Fonseca <[email protected]> | 2011-07-14 17:35:05 +0100 |
commit | 9a7f84d6b28e180ef79349b36de9a5d58a1e2dc9 (patch) | |
tree | 31d2acf247f5a0738ed7656f86125fa065ce0a36 /src/glut/beos/glutInit.cpp | |
parent | ff2efdf5997d20b41f7a82b77118366e6fbd23bc (diff) |
Squashed commit of the following:
commit 1856230d9fa61710cce3e152b8d88b1269611a73
Author: José Fonseca <[email protected]>
Date: Tue Jul 12 23:41:27 2011 +0100
make: Use better var names on packaging.
commit d1ae72d0bd14e820ecfe9f8f27b316f9566ceb0c
Author: José Fonseca <[email protected]>
Date: Tue Jul 12 23:38:21 2011 +0100
make: Apply several of Dan Nicholson's suggestions.
commit f27cf8743ac9cbf4c0ad66aff0cd3f97efde97e4
Author: José Fonseca <[email protected]>
Date: Sat Jul 9 14:18:20 2011 +0100
make: Put back the tar.bz2 creation rule.
Removed by accident.
commit 34983337f9d7db984e9f0117808274106d262110
Author: José Fonseca <[email protected]>
Date: Sat Jul 9 11:59:29 2011 +0100
make: Determine tarballs contents via git ls-files.
The wildcards were a mess:
- lots of files for non Linux platforms missing
- several files listed and archived twice
Using git-ls-files ensures things are not loss when making the tarballs.
commit 34a28ccbf459ed5710aafba5e7149e8291cb808c
Author: José Fonseca <[email protected]>
Date: Sat Jul 9 11:07:14 2011 +0100
glut: Remove GLUT source.
Most distros ship freeglut, and most people don't care one vs the other,
and it hasn't been really maintained.
So it is better to have Mesa GLUT be revisioned and built separately
from Mesa.
commit 5c26a2c3c0c7e95ef853e19d12d75c4f80137e7d
Author: José Fonseca <[email protected]>
Date: Sat Jul 9 10:31:02 2011 +0100
Ignore the tarballs.
commit 26edecac589819f0d0efe2165ab748dbc4e53394
Author: José Fonseca <[email protected]>
Date: Sat Jul 9 10:30:24 2011 +0100
make: Create the Mesa-xxx-devel symlink automatically.
Also actually remote the intermediate uncompressed tarballs.
Diffstat (limited to 'src/glut/beos/glutInit.cpp')
-rw-r--r-- | src/glut/beos/glutInit.cpp | 263 |
1 files changed, 0 insertions, 263 deletions
diff --git a/src/glut/beos/glutInit.cpp b/src/glut/beos/glutInit.cpp deleted file mode 100644 index 401081328f8..00000000000 --- a/src/glut/beos/glutInit.cpp +++ /dev/null @@ -1,263 +0,0 @@ -/*********************************************************** - * 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: glutInit.cpp - * - * DESCRIPTION: initialize GLUT state - ***********************************************************/ - -/*********************************************************** - * Headers - ***********************************************************/ -#include <GL/glut.h> -#include <string.h> -#include <stdlib.h> -#include <signal.h> -#include "glutint.h" -#include "glutState.h" -#include "glutBlocker.h" -#include "beos_x11.h" - -/*********************************************************** - * Global variables - ***********************************************************/ -GlutState gState; -char *__glutProgramName = NULL; - -/*********************************************************** - * Private variables - ***********************************************************/ -static int __glutArgc; -static char **__glutArgv; - -/*********************************************************** - * FUNCTION: __glutInitTime - * - * DESCRIPTION: set up start time variable - ***********************************************************/ -void __glutInitTime(bigtime_t *beginning) -{ - static int beenhere = 0; - static bigtime_t genesis; - - if (!beenhere) { - genesis = system_time(); - beenhere = 1; - } - *beginning = genesis; -} - -/*********************************************************** - * FUNCTION: removeArgs - * - * DESCRIPTION: helper function for glutInit to remove args - * from argv variable passed in - ***********************************************************/ -static void -removeArgs(int *argcp, char **argv, int numToRemove) -{ - int i, j; - - for (i = 0, j = numToRemove; argv[j]; i++, j++) { - argv[i] = argv[j]; - } - argv[i] = NULL; - *argcp -= numToRemove; -} - -/*********************************************************** - * FUNCTION: bAppThread - * - * DESCRIPTION: starts the BApplication message loop running - ***********************************************************/ -static int32 bAppThread(void *arg) { - be_app->Lock(); - return be_app->Run(); -} - -/*********************************************************** - * FUNCTION: sigHandler - * - * DESCRIPTION: shuts down the app on CTRL-C - ***********************************************************/ -static void sigHandler(int) { - gState.quitAll = true; - gBlock.NewEvent(); -} - -/*********************************************************** - * FUNCTION: glutInit (2.1) - * - * DESCRIPTION: create BApplication, parse cmd-line arguments, - * and set up gState structure. - ***********************************************************/ -void glutInit(int *argcp, char **argv) { - char *str, *geometry = NULL; - int i; - - if (gState.display) { - __glutWarning("glutInit being called a second time."); - return; - } - /* Determine temporary program name. */ - str = strrchr(argv[0], '/'); - if (str == NULL) { - __glutProgramName = argv[0]; - } else { - __glutProgramName = str + 1; - } - - /* Make private copy of command line arguments. */ - __glutArgc = *argcp; - __glutArgv = (char **) malloc(__glutArgc * sizeof(char *)); - if (!__glutArgv) - __glutFatalError("out of memory."); - for (i = 0; i < __glutArgc; i++) { - __glutArgv[i] = strdup(argv[i]); - if (!__glutArgv[i]) - __glutFatalError("out of memory."); - } - - /* determine permanent program name */ - str = strrchr(__glutArgv[0], '/'); - if (str == NULL) { - __glutProgramName = __glutArgv[0]; - } else { - __glutProgramName = str + 1; - } - - /* parse arguments for standard options */ - for (i = 1; i < __glutArgc; i++) { - if (!strcmp(__glutArgv[i], "-display")) { - __glutWarning("-display option only valid for X glut."); - if (++i >= __glutArgc) { - __glutFatalError( - "follow -display option with X display name."); - } - removeArgs(argcp, &argv[1], 2); - } else if (!strcmp(__glutArgv[i], "-geometry")) { - if (++i >= __glutArgc) { - __glutFatalError( - "follow -geometry option with geometry parameter."); - } - geometry = __glutArgv[i]; - removeArgs(argcp, &argv[1], 2); - } else if (!strcmp(__glutArgv[i], "-direct")) { - __glutWarning("-direct option only valid for X glut."); - removeArgs(argcp, &argv[1], 1); - } else if (!strcmp(__glutArgv[i], "-indirect")) { - __glutWarning("-indirect option only valid for X glut."); - removeArgs(argcp, &argv[1], 1); - } else if (!strcmp(__glutArgv[i], "-iconic")) { - __glutWarning("-iconic option doesn't make sense in BeOS."); - removeArgs(argcp, &argv[1], 1); - } else if (!strcmp(__glutArgv[i], "-gldebug")) { - gState.debug = true; - removeArgs(argcp, &argv[1], 1); - } else if (!strcmp(__glutArgv[i], "-sync")) { - __glutWarning("-sync option only valid for X glut."); - removeArgs(argcp, &argv[1], 1); - } else { - /* Once unknown option encountered, stop command line - processing. */ - break; - } - } - - __glutInit(); /* Create BApplication first so DisplayWidth() works */ - if (geometry) { - int flags, x, y, width, height; - - /* Fix bogus "{width|height} may be used before set" - warning */ - width = 0; - height = 0; - - flags = XParseGeometry(geometry, &x, &y, - (unsigned int *) &width, (unsigned int *) &height); - if (WidthValue & flags) { - /* Careful because X does not allow zero or negative - width windows */ - if (width > 0) - gState.initWidth = width; - } - if (HeightValue & flags) { - /* Careful because X does not allow zero or negative - height windows */ - if (height > 0) - gState.initHeight = height; - } - if (XValue & flags) { - if (XNegative & flags) - x = DisplayWidth() + x - gState.initWidth; - /* Play safe: reject negative X locations */ - if (x >= 0) - gState.initX = x; - } - if (YValue & flags) { - if (YNegative & flags) - y = DisplayHeight() + y - gState.initHeight; - /* Play safe: reject negative Y locations */ - if (y >= 0) - gState.initY = y; - } - } -} - -/*********************************************************** - * FUNCTION: __glutInit - * - * DESCRIPTION: create BApplication, parse cmd-line arguments, - * and set up gState structure. - ***********************************************************/ -void __glutInit() { - // open BApplication - gState.display = new BApplication("application/x-glut-demo"); - be_app->Unlock(); - gState.appthread = spawn_thread(bAppThread, "BApplication", B_NORMAL_PRIORITY, 0); - resume_thread(gState.appthread); - - bigtime_t unused; - __glutInitTime(&unused); - - /* set atexit() function to destroy all windows before exiting */ - if(atexit(__glutDestroyAllWindows)) - __glutFatalError("can't set exit handler"); - - /* similarly, destroy all windows on CTRL-C */ - signal(SIGINT, sigHandler); -} - -/*********************************************************** - * FUNCTION: glutInitWindowPosition (2.2) - * - * DESCRIPTION: set initial window position - ***********************************************************/ -void glutInitWindowPosition(int x, int y) { - gState.initX = x; - gState.initY = y; -} - -/*********************************************************** - * FUNCTION: glutInitWindowSize (2.2) - * - * DESCRIPTION: set initial window size - ***********************************************************/ -void glutInitWindowSize(int width, int height) { - gState.initWidth = width; - gState.initHeight = height; -} - -/*********************************************************** - * FUNCTION: glutInitDisplayMode (2.3) - * - * DESCRIPTION: set initial display mode - ***********************************************************/ -void glutInitDisplayMode(unsigned int mode) { - gState.displayMode = mode; -} |