1 /*
2  * Copyright (C) 2017 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #ifndef TEXWRAPPER_H
17 #define TEXWRAPPER_H
18 
19 #include <GLES2/gl2.h>
20 
21 namespace android {
22 namespace automotive {
23 namespace evs {
24 namespace support {
25 
26 class TexWrapper {
27 public:
28     TexWrapper(GLuint textureId, unsigned width, unsigned height);
29     virtual ~TexWrapper();
30 
glId()31     GLuint glId()       { return id; };
width()32     unsigned width()    { return w; };
height()33     unsigned height()   { return h; };
34 
35 protected:
36     TexWrapper();
37 
38     GLuint id;
39     unsigned w;
40     unsigned h;
41 };
42 
43 
44 TexWrapper* createTextureFromPng(const char* filename);
45 
46 }  // namespace support
47 }  // namespace evs
48 }  // namespace automotive
49 }  // namespace android
50 
51 #endif  // TEXWRAPPER_H
52