YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
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{
28public:
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
54private:
55 void createTexture();
56 void deleteTexture();
57};
58
59#endif // YARP_OVRHEADSET_TEXTURESTATIC_H
unsigned int padding
unsigned int bytes_per_pixel
ovrTextureSwapChain textureSwapChain
ovrSession session
unsigned int rowSize
unsigned int bufferSize
unsigned int width
GLubyte * ptr
unsigned int height
const char * pixel_data
unsigned int bytes_per_pixel