~ubuntu-branches/ubuntu/raring/glmark2/raring

« back to all changes in this revision

Viewing changes to src/scene-ideas/table.h

  • Committer: Package Import Robot
  • Author(s): Ricardo Salveti de Araujo
  • Date: 2012-08-21 15:38:09 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20120821153809-bwux72bat8qp2n5v
Tags: 2012.08-0ubuntu1
* New upstream release 2012.08 (LP: #1039736)
  - Avoid crashing if gl used is not >= 2.0 (LP: #842279)
* Bumping dh compatibility level to v9
* debian/control:
  - Update Standards-Version to 3.9.3.
  - Add libjpeg-dev build dependency.
  - Use libegl1-x11-dev as an build-dep alternative instead of libegl1-dev.
  - Update description of glmark2-data binary package.
* debian/copyright:
  - Refresh copyright based on the current upstrem version
* debian/rules:
  - Clean compiled python code from unpacked waflib/ directory, as
    described in http://wiki.debian.org/UnpackWaf

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * (c) Copyright 1993, Silicon Graphics, Inc.
 
3
 * Copyright � 2012 Linaro Limited
 
4
 *
 
5
 * This file is part of the glmark2 OpenGL (ES) 2.0 benchmark.
 
6
 *
 
7
 * glmark2 is free software: you can redistribute it and/or modify it under the
 
8
 * terms of the GNU General Public License as published by the Free Software
 
9
 * Foundation, either version 3 of the License, or (at your option) any later
 
10
 * version.
 
11
 *
 
12
 * glmark2 is distributed in the hope that it will be useful, but WITHOUT ANY
 
13
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
14
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 
15
 * details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License along with
 
18
 * glmark2.  If not, see <http://www.gnu.org/licenses/>.
 
19
 *
 
20
 * Authors:
 
21
 *  Jesse Barker
 
22
 */
 
23
#ifndef TABLE_H_
 
24
#define TABLE_H_
 
25
 
 
26
#include <string>
 
27
#include <vector>
 
28
#include "characters.h"
 
29
#include "program.h"
 
30
#include "stack.h"
 
31
 
 
32
class Table
 
33
{
 
34
public:
 
35
    Table();
 
36
    ~Table();
 
37
 
 
38
    void init();
 
39
    bool valid() const { return valid_; }
 
40
    void draw(LibMatrix::Stack4& modelview, LibMatrix::Stack4& projection, 
 
41
              const LibMatrix::vec3& lightPosition, const LibMatrix::vec3& logoPosition,
 
42
              const float& currentTime, float& paperAlpha_out);
 
43
    void drawUnder(LibMatrix::Stack4& modelview, LibMatrix::Stack4& projection);
 
44
 
 
45
private:
 
46
    // Text
 
47
    LetterI i_;
 
48
    LetterD d_;
 
49
    LetterE e_;
 
50
    LetterA a_;
 
51
    LetterS s_;
 
52
    LetterN n_;
 
53
    LetterM m_;
 
54
    LetterO o_;
 
55
    LetterT t_;
 
56
    Program tableProgram_;
 
57
    Program paperProgram_;
 
58
    Program textProgram_;
 
59
    Program underProgram_;
 
60
    std::string tableVertexShader_;
 
61
    std::string tableFragmentShader_;
 
62
    std::string paperVertexShader_;
 
63
    std::string paperFragmentShader_;
 
64
    std::string textVertexShader_;
 
65
    std::string textFragmentShader_;
 
66
    std::string underVertexShader_;
 
67
    std::string underFragmentShader_;
 
68
    static const std::string modelviewName_;
 
69
    static const std::string projectionName_;
 
70
    static const std::string lightPositionName_;
 
71
    static const std::string logoDirectionName_;
 
72
    static const std::string curTimeName_;
 
73
    static const std::string vertexAttribName_;
 
74
    static const unsigned int TABLERES_;
 
75
    std::vector<LibMatrix::vec3> tableVertices_;
 
76
    static const LibMatrix::vec3 paperVertices_[4];
 
77
    struct VertexDataMap
 
78
    {
 
79
        unsigned int tvOffset;
 
80
        unsigned int tvSize;
 
81
        unsigned int pvOffset;
 
82
        unsigned int pvSize;
 
83
        unsigned int totalSize;
 
84
    } dataMap_;
 
85
    unsigned int bufferObjects_[2];
 
86
    std::vector<unsigned short> indexData_;
 
87
    int tableVertexIndex_;
 
88
    int paperVertexIndex_;
 
89
    int textVertexIndex_;
 
90
    int underVertexIndex_;
 
91
    bool valid_;
 
92
};
 
93
 
 
94
#endif // TABLE_H_