1 /*************************************************************************** 2 * 3 * Copyright 2010,2011 BMW Car IT GmbH 4 * Copyright (C) 2018 Advanced Driver Information Technology Joint Venture GmbH 5 * 6 * 7 * Licensed under the Apache License, Version 2.0 (the "License"); 8 * you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 * 19 ****************************************************************************/ 20 #ifndef _HOUSE_H 21 #define _HOUSE_H 22 23 #include "IRenderable.h" 24 #include "IUpdateable.h" 25 #include "vec.h" 26 #include "TextureLoader.h" 27 #include "ShaderTexture.h" 28 29 class ShaderBase; 30 31 class House : public IRenderable, public IUpdateable 32 { 33 public: 34 House(vec3f position, vec3f size, vec4f houseColor, ShaderBase* pShader, TextureLoader* houseTexture = nullptr, float numElements = 3.0); 35 virtual ~House(); 36 37 virtual void render(); 38 virtual void update(int currentTimeInMs, int lastFrameTime); 39 40 private: 41 void attachVertexBuffer(); 42 void detachVertexBuffer(); 43 44 private: 45 vec3f m_position; 46 vec3f m_size; 47 vec4f m_color; 48 49 vec3f m_normals[6]; 50 vec3u m_index[12]; 51 vec3f m_vertex[8]; 52 vec2f m_texCoords[8]; 53 bool withTexture = false; 54 TextureLoader* texture = nullptr; 55 float numElements; 56 57 ShaderBase* m_pShader; 58 }; 59 60 #endif /* _HOUSE_H */ 61