• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 _STREET_H
21 #define _STREET_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 Street : public IRenderable, public IUpdateable
32 {
33 public:
34     Street(vec3f position, vec3f size, vec4f color, ShaderBase* shader);
35     Street(vec3f position, vec3f size, vec4f color, ShaderTexture* shader, TextureLoader* texture, float numRepeats = 2.0);
~Street()36     virtual ~Street() {}
37 
38     virtual void render();
39     virtual void update(int currentTimeInMs, int lastFrameTime);
40 
41 private:
42     vec3f m_position;
43     vec3f m_size;
44     vec4f m_color;
45 
46     vec3u m_index[2];
47     vec3f m_vertex[4];
48     vec2f m_texCoords[4];
49     bool withTexture = false;
50     TextureLoader* texture = nullptr;
51 
52     ShaderBase* m_shader;
53 };
54 
55 #endif /* _STREET_H */
56