Line data Source code
1 0 : /* 2 : 3 : DustEntity.h 4 : 5 : Entity representing a number of dust particles. 6 : 7 : Oolite 8 : Copyright (C) 2004-2013 Giles C Williams and contributors 9 : 10 : This program is free software; you can redistribute it and/or 11 : modify it under the terms of the GNU General Public License 12 : as published by the Free Software Foundation; either version 2 13 : of the License, or (at your option) any later version. 14 : 15 : This program is distributed in the hope that it will be useful, 16 : but WITHOUT ANY WARRANTY; without even the implied warranty of 17 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 : GNU General Public License for more details. 19 : 20 : You should have received a copy of the GNU General Public License 21 : along with this program; if not, write to the Free Software 22 : Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 23 : MA 02110-1301, USA. 24 : 25 : */ 26 : 27 : #import "Entity.h" 28 : #import "OOOpenGLExtensionManager.h" 29 : #import "OOTexture.h" 30 : 31 0 : #define DUST_SCALE 2000 32 0 : #define DUST_N_PARTICLES 600 33 : 34 : @class OOColor, OOShaderProgram, OOShaderUniform; 35 : 36 : 37 0 : @interface DustEntity: Entity 38 : { 39 : @private 40 0 : OOColor *dust_color; 41 0 : Vector vertices[DUST_N_PARTICLES * 2]; 42 0 : GLushort indices[DUST_N_PARTICLES * 2]; 43 0 : GLfloat color_fv[4]; 44 0 : OOTexture *texture; 45 0 : bool hasPointSprites; 46 0 : bool drawDust; 47 : 48 : #if OO_SHADERS 49 : GLfloat warpinessAttr[DUST_N_PARTICLES * 2]; 50 : OOShaderProgram *shader; 51 : NSArray *uniforms; 52 : uint8_t shaderMode; 53 : #endif 54 : } 55 : 56 0 : - (void) setDustColor:(OOColor *) color; 57 0 : - (OOColor *) dustColor; 58 : 59 : @end