~ubuntu-branches/ubuntu/precise/mesa/precise-updates

« back to all changes in this revision

Viewing changes to src/glut/beos/glutDstr.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Christopher James Halse Rogers
  • Date: 2011-08-04 16:25:08 UTC
  • mfrom: (1.2.37 upstream)
  • Revision ID: james.westby@ubuntu.com-20110804162508-kujg82moxerjg1kk
Tags: 7.11-0ubuntu1
* Fake merge from Debian experimental, updating previous changelog entries.
  New upstream release fixes infrequent X crash (LP: #800778).
  Remaining Ubuntu changes:
 - debian/control
    + Drop lesstif-dev from Build-Depends; it's in Universe.
    + Comment out GLw libs since it depends on lesstif-dev.
    + Drop i686 swx11 libgl package.
    + Add libdrm-dev to mesa-common-dev Depends.
    + Drop libwayland-dev from Build-Depends; it's in Universe.
    + Update Breaks for Ubuntu versions
    + Enable llvm on armel as well as i386 and amd64
  - debian/rules
    + Use --disable-glw for swx11 targets too.
    + Don't enable motif for swx11 targets.
    + Use lzma compression for binary debs to save CD space.
    + Drop unloved mach64 driver.
    + Use --enable-shared-dricore to claw back CD space.
    + Enable llvmpipe software rasteriser.
    + Enable llvm on armel as well as i386 and amd64
  - debian/patches
    + 100_no_abi_tag.patch
    + 101_ubuntu_hidden_glname.patch
    + 103_savage-expose_fbmodes_with_nonzero_alpha.patch
  - rules, libgl1-mesa-{glx,dev,swx11,swx11-dev}.install.in,
    libgl1-mesa-{glx,swx11}.{postinst,prerm}.in, libgl1-mesa-dev.links.in:
    Install libGL.so* in /usr/lib/mesa to allow things to work with
    alternatives.
  - debian/not-installed:
    + Drop i686 files; we don't build 686-optimised packages in the first
      place.
  - debian/gbp.conf
    + Point at Ubuntu branch to make git-buildpackage less narky.
  - 113_fix_tls.diff: Fix crashes in unrelated code due to TLS usage.
  - debian/patches/111_export_searchdirs_in_dripc.diff:
    + Add drisearchdirs variable to dri.pc so the Xserver can pick up the
      alternate DRI driver dirs.
  - debian/patches/115_llvm_dynamic_linking.diff
    + Dynamically link DRI drivers to libllvm.  Saves ~6MiB per DRI driver.
  - debian/patches/116_use_shared_galliumcore.diff:
  - debian/libgl1-mesa-dri.install.in:
    + Link gallium DRI drivers against shared gallium routines to save CD
      space.
* debian/rules:
* debian/libgl1-mesa-dri-experimental.install.{i386,amd64}.in
  - Explicitly install i915g only when it has been built, matching what is
    done with r300g.
* debian/rules:
* debian/control:
* debian/libegl1-mesa{,-dev}.install.in:
* debian/libegl1-mesa.symbols:
  - Enable the Wayland EGL backend.
* debian/rules:
* debian/libegl1-mesa.{postinst,prerm,install}.in:
* debian/libegl1-mesa-dev.{install,links}.in:
* debian/libgles{1,2}-mesa.install.in:
* debian/libgles{1,2}-mesa-dev.links.in:
* debian/libopenvg1-mesa{,-dev}.install.in:
* debian/libopenvg1-mesa-dev.links.in:
  - Use alternatives for libEGL to match the handling of libGL.
    libEGL (and associated GL|ES and OpenVG libraries) now live in
    /usr/lib/$MULTIARCH/mesa-egl.  (LP: #812639)
* debian/patches/118_fix_24bpp_software_rendering.diff:
  - Cherry pick upstream patch from master fixing graphical corruption when
    using a 24bpp framebuffer and software rendering. (LP: #810339)
* debian/rules:
* debian/clean:
  - Generate xmlpool pot file and clean up other po files for
    pkgbinarymangler's benefit (LP: #410264).
* debian/patches/119_r600g_gnome_shell_rendering_fix.diff:
  - Cherry pick upstream commit fixing rendering corruption in gnome-shell
    (and therefore likely Unity as well).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***********************************************************
2
 
 *      Copyright (C) 1997, Be Inc.  Copyright (C) 1999, Jake Hamby.
3
 
 *
4
 
 * This program is freely distributable without licensing fees
5
 
 * and is provided without guarantee or warrantee expressed or
6
 
 * implied. This program is -not- in the public domain.
7
 
 *
8
 
 *
9
 
 *  FILE:       glutDstr.cpp
10
 
 *
11
 
 *      DESCRIPTION:    convert display string into a Be options variable
12
 
 ***********************************************************/
13
 
 
14
 
/***********************************************************
15
 
 *      Headers
16
 
 ***********************************************************/
17
 
#include <GL/glut.h>
18
 
#include <string.h>
19
 
#include <stdlib.h>
20
 
#include "glutint.h"
21
 
#include "glutState.h"
22
 
 
23
 
/***********************************************************
24
 
 *      FUNCTION:       glutInitDisplayString
25
 
 *
26
 
 *      DESCRIPTION:  sets the display string variable
27
 
 ***********************************************************/
28
 
void APIENTRY 
29
 
glutInitDisplayString(const char *string)
30
 
{
31
 
  if (gState.displayString) {
32
 
    free(gState.displayString);
33
 
  }
34
 
  if (string) {
35
 
    gState.displayString = strdup(string);
36
 
    if (!gState.displayString)
37
 
      __glutFatalError("out of memory.");
38
 
  } else
39
 
    gState.displayString = NULL;
40
 
}
41
 
 
42
 
/***********************************************************
43
 
 *      FUNCTION:       __glutConvertDisplayModeFromString
44
 
 *
45
 
 *      DESCRIPTION:  converts the current display mode into a BGLView
46
 
 *              display mode, printing warnings as appropriate.
47
 
 *
48
 
 *      PARAMETERS:      if options is non-NULL, the current display mode is
49
 
 *              returned in it.
50
 
 *
51
 
 *      RETURNS:        1 if the current display mode is possible, else 0
52
 
 ***********************************************************/
53
 
int __glutConvertDisplayModeFromString(unsigned long *options) {
54
 
        ulong newoptions = 0;
55
 
        
56
 
        char *word = strtok(gState.displayString, " \t");
57
 
        do {
58
 
                char *cstr = strpbrk(word, "=><!~");
59
 
                if(cstr)
60
 
                        *cstr = '\0';
61
 
                // this is the most minimal possible parser.  scan for
62
 
                // options that we support, and add them to newoptions
63
 
                // this will certainly cause it to accept things that we
64
 
                // don't actually support, but if we don't support it, the
65
 
                // program's probably not going to work anyway.
66
 
                if(!strcmp(word, "alpha")) {
67
 
                        newoptions |= BGL_ALPHA;
68
 
                } else if((!strcmp(word, "acc")) || (!strcmp(word, "acca"))) {
69
 
                        newoptions |= BGL_ACCUM;
70
 
                } else if(!strcmp(word, "depth")) {
71
 
                        newoptions |= BGL_DEPTH;
72
 
                } else if(!strcmp(word, "double")) {
73
 
                        newoptions |= BGL_DOUBLE;
74
 
                } else if(!strcmp(word, "stencil")) {
75
 
                        newoptions |= BGL_STENCIL;
76
 
                }
77
 
        } while((word = strtok(0, " \t")) != 0);
78
 
 
79
 
        if (options)
80
 
                *options = newoptions;
81
 
 
82
 
        return 1;       // assume we support it
83
 
}