YARP
Yet Another Robot Platform
TextureStatic.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #ifndef YARP_OVRHEADSET_TEXTURESTATIC_H
20 #define YARP_OVRHEADSET_TEXTURESTATIC_H
21 
22 #include <GL/glew.h>
23 #include <OVR_CAPI.h>
24 
25 
27 {
28 public:
29  struct Image {
30  unsigned int width;
31  unsigned int height;
32  unsigned int bytes_per_pixel; /* 2:RGB16, 3:RGB, 4:RGBA */
33  const char *pixel_data;
34  };
35 
36  TextureStatic(ovrSession session, const TextureStatic::Image &img);
38 
39  ovrSession session;
40  ovrTextureSwapChain textureSwapChain;
41 
42  unsigned int width;
43  unsigned int height;
44  unsigned int bytes_per_pixel;
45  unsigned int padding;
46  unsigned int rowSize;
47  unsigned int bufferSize;
48 
49  GLuint chainTexId;
50  GLuint texId;
51 
52  GLubyte* ptr;
53 
54 private:
55  void createTexture();
56  void deleteTexture();
57 };
58 
59 #endif // YARP_OVRHEADSET_TEXTURESTATIC_H
TextureStatic::Image::width
unsigned int width
Definition: TextureStatic.h:30
TextureStatic::Image::bytes_per_pixel
unsigned int bytes_per_pixel
Definition: TextureStatic.h:32
TextureStatic::bytes_per_pixel
unsigned int bytes_per_pixel
Definition: TextureStatic.h:44
TextureStatic::padding
unsigned int padding
Definition: TextureStatic.h:45
TextureStatic::texId
GLuint texId
Definition: TextureStatic.h:50
TextureStatic::rowSize
unsigned int rowSize
Definition: TextureStatic.h:46
TextureStatic::width
unsigned int width
Definition: TextureStatic.h:42
TextureStatic::textureSwapChain
ovrTextureSwapChain textureSwapChain
Definition: TextureStatic.h:40
TextureStatic::chainTexId
GLuint chainTexId
Definition: TextureStatic.h:49
TextureStatic::ptr
GLubyte * ptr
Definition: TextureStatic.h:52
TextureStatic::bufferSize
unsigned int bufferSize
Definition: TextureStatic.h:47
TextureStatic::TextureStatic
TextureStatic(ovrSession session, const TextureStatic::Image &img)
Definition: TextureStatic.cpp:27
TextureStatic::~TextureStatic
~TextureStatic()
Definition: TextureStatic.cpp:42
TextureStatic::session
ovrSession session
Definition: TextureStatic.h:39
TextureStatic
Definition: TextureStatic.h:27
TextureStatic::Image::pixel_data
const char * pixel_data
Definition: TextureStatic.h:33
TextureStatic::Image
Definition: TextureStatic.h:29
TextureStatic::Image::height
unsigned int height
Definition: TextureStatic.h:31
TextureStatic::height
unsigned int height
Definition: TextureStatic.h:43