~ubuntu-branches/debian/sid/coin2/sid

« back to all changes in this revision

Viewing changes to data/shaders/glsl2h.sh.in

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2008-06-28 02:38:17 UTC
  • mfrom: (1.2.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20080628023817-lgrh0u677j1gcqgf
Tags: 2.5.0-2
* debian/control: Change suggests from libopenal0 to libopenal0a.
  Closes: #488001.  Change ${Source-Version} to ${binary:Version}.
  Update to standards version 3.8.0.

* debian/rules: Do not ignore errors in clean rule.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
############################################################################
 
3
# glsl2h.sh
 
4
#
 
5
# This script generates a C header file from a GLSL file.  The header
 
6
# just contains the glsl file as a static char buffer.
 
7
#
 
8
# Authors:
 
9
#   Morten Eriksen <mortene@sim.no>
 
10
#   Lars J. Aas <larsa@sim.no>
 
11
#
 
12
 
 
13
UPCASEBASE=`basename $1 .glsl | tr '[a-z]' '[A-Z]'`
 
14
 
 
15
cat <<HERE_DOC_END
 
16
/**************************************************************************\
 
17
 *
 
18
 *  This file is part of the Coin 3D visualization library.
 
19
 *  Copyright (C) 1998-2007 by Systems in Motion.  All rights reserved.
 
20
 *
 
21
 *  This library is free software; you can redistribute it and/or
 
22
 *  modify it under the terms of the GNU General Public License
 
23
 *  ("GPL") version 2 as published by the Free Software Foundation.
 
24
 *  See the file LICENSE.GPL at the root directory of this source
 
25
 *  distribution for additional information about the GNU GPL.
 
26
 *
 
27
 *  For using Coin with software that can not be combined with the GNU
 
28
 *  GPL, and for taking advantage of the additional benefits of our
 
29
 *  support services, please contact Systems in Motion about acquiring
 
30
 *  a Coin Professional Edition License.
 
31
 *
 
32
 *  See http://www.coin3d.org/ for more information.
 
33
 *
 
34
 *  Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
 
35
 *  http://www.sim.no/  sales@sim.no  coin-support@coin3d.org
 
36
 *
 
37
\**************************************************************************/
 
38
 
 
39
#ifndef COIN_INTERNAL
 
40
#error this is a private header file
 
41
#endif /* !COIN_INTERNAL */
 
42
 
 
43
#ifndef SO_${UPCASEBASE}_GLSL_H
 
44
#define SO_${UPCASEBASE}_GLSL_H
 
45
 
 
46
static const char ${UPCASEBASE}_shadersource[] =
 
47
HERE_DOC_END
 
48
 
 
49
cat $1 | sed -e \
 
50
's/\\/\\\\/g
 
51
s/"/\\"/g
 
52
3,$ s/^[ \t]*#.*//
 
53
s/^/  "/
 
54
s/$/\\n"/
 
55
$ s/$/;/'
 
56
 
 
57
# ATTN: the file did not just get corrupted ;-)
 
58
 
 
59
cat <<HERE_DOC_END
 
60
 
 
61
#endif /* ! SO_${UPCASEBASE}_GLSL_H */
 
62
HERE_DOC_END