26 #include <OVR_CAPI_GL.h>
33 textureSwapChain(nullptr),
36 bytes_per_pixel(
yarp_logo.bytes_per_pixel),
38 padding((4 - (width * bytes_per_pixel) % 4) % 4),
39 rowSize(width * bytes_per_pixel + padding),
40 bufferSize(rowSize * height),
52 void TextureLogo::createTexture()
54 ovrTextureSwapChainDesc desc = {};
55 desc.Type = ovrTexture_2D;
56 desc.Format = OVR_FORMAT_R8G8B8A8_UNORM_SRGB;
62 desc.StaticImage = ovrTrue;
63 desc.MiscFlags = ovrTextureMisc_None;
64 desc.BindFlags = ovrTextureBind_None;
74 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
75 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
76 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
77 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
78 glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0,
width,
height, GL_RGBA, GL_UNSIGNED_BYTE,
ptr);
81 glBindTexture(GL_TEXTURE_2D, 0);
87 void TextureLogo::deleteTexture()
97 textureSwapChain(nullptr),
102 padding((4 - (width * bytes_per_pixel) % 4) % 4),
103 rowSize(width * bytes_per_pixel + padding),
104 bufferSize(rowSize * height),
116 void TextureCrosshairs::createTexture()
118 ovrTextureSwapChainDesc desc = {};
119 desc.Type = ovrTexture_2D;
120 desc.Format = OVR_FORMAT_R8G8B8A8_UNORM_SRGB;
125 desc.SampleCount = 1;
126 desc.StaticImage = ovrTrue;
127 desc.MiscFlags = ovrTextureMisc_None;
128 desc.BindFlags = ovrTextureBind_None;
138 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
139 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
140 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
141 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
142 glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0,
width,
height, GL_RGBA, GL_UNSIGNED_BYTE,
ptr);
145 glBindTexture(GL_TEXTURE_2D, 0);
151 void TextureCrosshairs::deleteTexture()