Mercurial > hg > opencollidoscope
comparison CollidoscopeApp/src/Chunk.cpp @ 5:75b744078d66
added license
author | Fiore Martin <f.martin@qmul.ac.uk> |
---|---|
date | Wed, 13 Jul 2016 16:06:46 +0200 |
parents | 02467299402e |
children | 4dad0b810f18 |
comparison
equal
deleted
inserted
replaced
4:ab6db404403a | 5:75b744078d66 |
---|---|
1 /* | |
2 | |
3 Copyright (C) 2015 Fiore Martin | |
4 Copyright (C) 2016 Queen Mary University of London | |
5 Author: Fiore Martin | |
6 | |
7 This file is part of Collidoscope. | |
8 | |
9 Collidoscope is free software: you can redistribute it and/or modify | |
10 it under the terms of the GNU General Public License as published by | |
11 the Free Software Foundation, either version 3 of the License, or | |
12 (at your option) any later version. | |
13 | |
14 This program is distributed in the hope that it will be useful, | |
15 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 GNU General Public License for more details. | |
18 | |
19 You should have received a copy of the GNU General Public License | |
20 along with this program. If not, see <http://www.gnu.org/licenses/>. | |
21 | |
22 */ | |
23 | |
24 | |
1 #include "Chunk.h" | 25 #include "Chunk.h" |
2 #include "DrawInfo.h" | 26 #include "DrawInfo.h" |
3 | 27 |
4 | 28 |
5 #include "cinder/gl/gl.h" | 29 #include "cinder/gl/gl.h" |
43 mX = di.flipX( 1 + (mIndex * (2 + kWidth)) ); // FIXME this should happen only once when resized | 67 mX = di.flipX( 1 + (mIndex * (2 + kWidth)) ); // FIXME this should happen only once when resized |
44 } | 68 } |
45 | 69 |
46 void Chunk::draw( const DrawInfo& di, ci::gl::BatchRef &batch ){ | 70 void Chunk::draw( const DrawInfo& di, ci::gl::BatchRef &batch ){ |
47 using namespace ci; | 71 using namespace ci; |
48 | 72 |
49 gl::pushModelMatrix(); | 73 gl::pushModelMatrix(); |
50 | 74 |
51 const float chunkHeight = mAnimate * mAudioTop * di.getMaxChunkHeight(); | 75 const float chunkHeight = mAnimate * mAudioTop * di.getMaxChunkHeight(); |
52 | 76 |
53 // place the chunk in the right position brigns back the y of chunkHeight/2 so | 77 // place the chunk in the right position brigns back the y of chunkHeight/2 so |
63 gl::popModelMatrix(); | 87 gl::popModelMatrix(); |
64 } | 88 } |
65 | 89 |
66 | 90 |
67 void Chunk::drawBar( const DrawInfo& di, ci::gl::BatchRef &batch ){ | 91 void Chunk::drawBar( const DrawInfo& di, ci::gl::BatchRef &batch ){ |
68 using namespace ci; | 92 using namespace ci; |
69 | 93 |
70 gl::pushModelMatrix(); | 94 gl::pushModelMatrix(); |
71 | 95 |
72 const float barHeight = di.getSelectionBarHeight(); | 96 const float barHeight = di.getSelectionBarHeight(); |
73 | 97 |