[23740] | 1 | /** @file
|
---|
| 2 | *
|
---|
| 3 | * VBox frontends: Qt GUI ("VirtualBox"):
|
---|
| 4 | * OpenGL support info used for 2D support detection
|
---|
| 5 | */
|
---|
| 6 |
|
---|
| 7 | /*
|
---|
[44529] | 8 | * Copyright (C) 2009-2010 Oracle Corporation
|
---|
[23740] | 9 | *
|
---|
| 10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
| 11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
| 12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
| 13 | * General Public License (GPL) as published by the Free Software
|
---|
| 14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
| 15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
| 16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
| 17 | *
|
---|
[24409] | 18 | * The contents of this file may alternatively be used under the terms
|
---|
| 19 | * of the Common Development and Distribution License Version 1.0
|
---|
| 20 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
| 21 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
| 22 | * CDDL are applicable instead of those of the GPL.
|
---|
| 23 | *
|
---|
| 24 | * You may elect to license modified versions of this file under the
|
---|
| 25 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
[23740] | 26 | */
|
---|
| 27 | #ifndef __VBoxGLSupportInfo_h__
|
---|
| 28 | #define __VBoxGLSupportInfo_h__
|
---|
| 29 |
|
---|
| 30 | #include <iprt/types.h>
|
---|
| 31 |
|
---|
| 32 | typedef char GLchar;
|
---|
| 33 |
|
---|
| 34 | #ifndef GL_COMPILE_STATUS
|
---|
| 35 | # define GL_COMPILE_STATUS 0x8b81
|
---|
| 36 | #endif
|
---|
| 37 | #ifndef GL_LINK_STATUS
|
---|
| 38 | # define GL_LINK_STATUS 0x8b82
|
---|
| 39 | #endif
|
---|
| 40 | #ifndef GL_FRAGMENT_SHADER
|
---|
| 41 | # define GL_FRAGMENT_SHADER 0x8b30
|
---|
| 42 | #endif
|
---|
| 43 | #ifndef GL_VERTEX_SHADER
|
---|
| 44 | # define GL_VERTEX_SHADER 0x8b31
|
---|
| 45 | #endif
|
---|
| 46 |
|
---|
| 47 | /* GL_ARB_multitexture */
|
---|
| 48 | #ifndef GL_TEXTURE0
|
---|
| 49 | # define GL_TEXTURE0 0x84c0
|
---|
| 50 | #endif
|
---|
| 51 | #ifndef GL_TEXTURE1
|
---|
| 52 | # define GL_TEXTURE1 0x84c1
|
---|
| 53 | #endif
|
---|
| 54 | #ifndef GL_MAX_TEXTURE_COORDS
|
---|
| 55 | # define GL_MAX_TEXTURE_COORDS 0x8871
|
---|
| 56 | #endif
|
---|
| 57 | #ifndef GL_MAX_TEXTURE_IMAGE_UNITS
|
---|
| 58 | # define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
|
---|
| 59 | #endif
|
---|
| 60 |
|
---|
| 61 | #ifndef APIENTRY
|
---|
| 62 | # define APIENTRY
|
---|
| 63 | #endif
|
---|
| 64 |
|
---|
| 65 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_ACTIVE_TEXTURE) (GLenum texture);
|
---|
| 66 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_MULTI_TEX_COORD2I) (GLenum texture, GLint v0, GLint v1);
|
---|
| 67 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_MULTI_TEX_COORD2F) (GLenum texture, GLfloat v0, GLfloat v1);
|
---|
| 68 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_MULTI_TEX_COORD2D) (GLenum texture, GLdouble v0, GLdouble v1);
|
---|
| 69 |
|
---|
| 70 | /* GL_ARB_texture_rectangle */
|
---|
| 71 | #ifndef GL_TEXTURE_RECTANGLE
|
---|
| 72 | # define GL_TEXTURE_RECTANGLE 0x84F5
|
---|
| 73 | #endif
|
---|
| 74 |
|
---|
| 75 | /* GL_ARB_shader_objects */
|
---|
| 76 | /* GL_ARB_fragment_shader */
|
---|
| 77 |
|
---|
| 78 | typedef GLuint (APIENTRY *PFNVBOXVHWA_CREATE_SHADER) (GLenum type);
|
---|
| 79 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_SHADER_SOURCE) (GLuint shader, GLsizei count, const GLchar **string, const GLint *length);
|
---|
| 80 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_COMPILE_SHADER) (GLuint shader);
|
---|
| 81 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_DELETE_SHADER) (GLuint shader);
|
---|
| 82 |
|
---|
| 83 | typedef GLuint (APIENTRY *PFNVBOXVHWA_CREATE_PROGRAM) ();
|
---|
| 84 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_ATTACH_SHADER) (GLuint program, GLuint shader);
|
---|
| 85 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_DETACH_SHADER) (GLuint program, GLuint shader);
|
---|
| 86 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_LINK_PROGRAM) (GLuint program);
|
---|
| 87 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_USE_PROGRAM) (GLuint program);
|
---|
| 88 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_DELETE_PROGRAM) (GLuint program);
|
---|
| 89 |
|
---|
| 90 | typedef GLboolean (APIENTRY *PFNVBOXVHWA_IS_SHADER) (GLuint shader);
|
---|
| 91 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_GET_SHADERIV) (GLuint shader, GLenum pname, GLint *params);
|
---|
| 92 | typedef GLboolean (APIENTRY *PFNVBOXVHWA_IS_PROGRAM) (GLuint program);
|
---|
| 93 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_GET_PROGRAMIV) (GLuint program, GLenum pname, GLint *params);
|
---|
| 94 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_GET_ATTACHED_SHADERS) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
|
---|
| 95 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_GET_SHADER_INFO_LOG) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
|
---|
| 96 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_GET_PROGRAM_INFO_LOG) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
|
---|
| 97 | typedef GLint (APIENTRY *PFNVBOXVHWA_GET_UNIFORM_LOCATION) (GLint programObj, const GLchar *name);
|
---|
| 98 |
|
---|
| 99 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_UNIFORM1F)(GLint location, GLfloat v0);
|
---|
| 100 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_UNIFORM2F)(GLint location, GLfloat v0, GLfloat v1);
|
---|
| 101 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_UNIFORM3F)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
|
---|
| 102 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_UNIFORM4F)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
|
---|
| 103 |
|
---|
| 104 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_UNIFORM1I)(GLint location, GLint v0);
|
---|
| 105 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_UNIFORM2I)(GLint location, GLint v0, GLint v1);
|
---|
| 106 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_UNIFORM3I)(GLint location, GLint v0, GLint v1, GLint v2);
|
---|
| 107 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_UNIFORM4I)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
|
---|
| 108 |
|
---|
| 109 | /* GL_ARB_pixel_buffer_object*/
|
---|
| 110 | #ifndef Q_WS_MAC
|
---|
| 111 | /* apears to be defined on mac */
|
---|
| 112 | typedef ptrdiff_t GLsizeiptr;
|
---|
| 113 | #endif
|
---|
| 114 |
|
---|
| 115 | #ifndef GL_READ_ONLY
|
---|
| 116 | # define GL_READ_ONLY 0x88B8
|
---|
| 117 | #endif
|
---|
| 118 | #ifndef GL_WRITE_ONLY
|
---|
| 119 | # define GL_WRITE_ONLY 0x88B9
|
---|
| 120 | #endif
|
---|
| 121 | #ifndef GL_READ_WRITE
|
---|
| 122 | # define GL_READ_WRITE 0x88BA
|
---|
| 123 | #endif
|
---|
| 124 | #ifndef GL_STREAM_DRAW
|
---|
| 125 | # define GL_STREAM_DRAW 0x88E0
|
---|
| 126 | #endif
|
---|
| 127 | #ifndef GL_STREAM_READ
|
---|
| 128 | # define GL_STREAM_READ 0x88E1
|
---|
| 129 | #endif
|
---|
| 130 | #ifndef GL_STREAM_COPY
|
---|
| 131 | # define GL_STREAM_COPY 0x88E2
|
---|
| 132 | #endif
|
---|
[25385] | 133 | #ifndef GL_DYNAMIC_DRAW
|
---|
| 134 | # define GL_DYNAMIC_DRAW 0x88E8
|
---|
| 135 | #endif
|
---|
[23740] | 136 |
|
---|
| 137 | #ifndef GL_PIXEL_PACK_BUFFER
|
---|
| 138 | # define GL_PIXEL_PACK_BUFFER 0x88EB
|
---|
| 139 | #endif
|
---|
| 140 | #ifndef GL_PIXEL_UNPACK_BUFFER
|
---|
| 141 | # define GL_PIXEL_UNPACK_BUFFER 0x88EC
|
---|
| 142 | #endif
|
---|
| 143 | #ifndef GL_PIXEL_PACK_BUFFER_BINDING
|
---|
| 144 | # define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
|
---|
| 145 | #endif
|
---|
| 146 | #ifndef GL_PIXEL_UNPACK_BUFFER_BINDING
|
---|
| 147 | # define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF
|
---|
| 148 | #endif
|
---|
| 149 |
|
---|
| 150 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_GEN_BUFFERS)(GLsizei n, GLuint *buffers);
|
---|
| 151 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_DELETE_BUFFERS)(GLsizei n, const GLuint *buffers);
|
---|
| 152 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_BIND_BUFFER)(GLenum target, GLuint buffer);
|
---|
| 153 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_BUFFER_DATA)(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
|
---|
| 154 | typedef GLvoid* (APIENTRY *PFNVBOXVHWA_MAP_BUFFER)(GLenum target, GLenum access);
|
---|
| 155 | typedef GLboolean (APIENTRY *PFNVBOXVHWA_UNMAP_BUFFER)(GLenum target);
|
---|
| 156 |
|
---|
[25423] | 157 | /* GL_EXT_framebuffer_object */
|
---|
| 158 | #ifndef GL_FRAMEBUFFER
|
---|
| 159 | # define GL_FRAMEBUFFER 0x8D40
|
---|
| 160 | #endif
|
---|
| 161 | #ifndef GL_COLOR_ATTACHMENT0
|
---|
| 162 | # define GL_COLOR_ATTACHMENT0 0x8CE0
|
---|
| 163 | #endif
|
---|
[23740] | 164 |
|
---|
[25423] | 165 | typedef GLboolean (APIENTRY *PFNVBOXVHWA_IS_FRAMEBUFFER)(GLuint framebuffer);
|
---|
| 166 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_BIND_FRAMEBUFFER)(GLenum target, GLuint framebuffer);
|
---|
| 167 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_DELETE_FRAMEBUFFERS)(GLsizei n, const GLuint *framebuffers);
|
---|
| 168 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_GEN_FRAMEBUFFERS)(GLsizei n, GLuint *framebuffers);
|
---|
| 169 | typedef GLenum (APIENTRY *PFNVBOXVHWA_CHECK_FRAMEBUFFER_STATUS)(GLenum target);
|
---|
| 170 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_FRAMEBUFFER_TEXTURE1D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
---|
| 171 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_FRAMEBUFFER_TEXTURE2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
---|
| 172 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_FRAMEBUFFER_TEXTURE3D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
|
---|
| 173 | typedef GLvoid (APIENTRY *PFNVBOXVHWA_GET_FRAMEBUFFER_ATTACHMENT_PARAMETRIV)(GLenum target, GLenum attachment, GLenum pname, GLint *params);
|
---|
| 174 |
|
---|
| 175 |
|
---|
[23740] | 176 | /*****************/
|
---|
| 177 |
|
---|
| 178 | /* functions */
|
---|
| 179 |
|
---|
| 180 | /* @todo: move those to VBoxGLInfo class instance members ??? */
|
---|
| 181 | extern PFNVBOXVHWA_ACTIVE_TEXTURE vboxglActiveTexture;
|
---|
| 182 | extern PFNVBOXVHWA_MULTI_TEX_COORD2I vboxglMultiTexCoord2i;
|
---|
| 183 | extern PFNVBOXVHWA_MULTI_TEX_COORD2D vboxglMultiTexCoord2d;
|
---|
| 184 | extern PFNVBOXVHWA_MULTI_TEX_COORD2F vboxglMultiTexCoord2f;
|
---|
| 185 |
|
---|
| 186 |
|
---|
| 187 | extern PFNVBOXVHWA_CREATE_SHADER vboxglCreateShader;
|
---|
| 188 | extern PFNVBOXVHWA_SHADER_SOURCE vboxglShaderSource;
|
---|
| 189 | extern PFNVBOXVHWA_COMPILE_SHADER vboxglCompileShader;
|
---|
| 190 | extern PFNVBOXVHWA_DELETE_SHADER vboxglDeleteShader;
|
---|
| 191 |
|
---|
| 192 | extern PFNVBOXVHWA_CREATE_PROGRAM vboxglCreateProgram;
|
---|
| 193 | extern PFNVBOXVHWA_ATTACH_SHADER vboxglAttachShader;
|
---|
| 194 | extern PFNVBOXVHWA_DETACH_SHADER vboxglDetachShader;
|
---|
| 195 | extern PFNVBOXVHWA_LINK_PROGRAM vboxglLinkProgram;
|
---|
| 196 | extern PFNVBOXVHWA_USE_PROGRAM vboxglUseProgram;
|
---|
| 197 | extern PFNVBOXVHWA_DELETE_PROGRAM vboxglDeleteProgram;
|
---|
| 198 |
|
---|
| 199 | extern PFNVBOXVHWA_IS_SHADER vboxglIsShader;
|
---|
| 200 | extern PFNVBOXVHWA_GET_SHADERIV vboxglGetShaderiv;
|
---|
| 201 | extern PFNVBOXVHWA_IS_PROGRAM vboxglIsProgram;
|
---|
| 202 | extern PFNVBOXVHWA_GET_PROGRAMIV vboxglGetProgramiv;
|
---|
| 203 | extern PFNVBOXVHWA_GET_ATTACHED_SHADERS vboxglGetAttachedShaders;
|
---|
| 204 | extern PFNVBOXVHWA_GET_SHADER_INFO_LOG vboxglGetShaderInfoLog;
|
---|
| 205 | extern PFNVBOXVHWA_GET_PROGRAM_INFO_LOG vboxglGetProgramInfoLog;
|
---|
| 206 |
|
---|
| 207 | extern PFNVBOXVHWA_GET_UNIFORM_LOCATION vboxglGetUniformLocation;
|
---|
| 208 |
|
---|
| 209 | extern PFNVBOXVHWA_UNIFORM1F vboxglUniform1f;
|
---|
| 210 | extern PFNVBOXVHWA_UNIFORM2F vboxglUniform2f;
|
---|
| 211 | extern PFNVBOXVHWA_UNIFORM3F vboxglUniform3f;
|
---|
| 212 | extern PFNVBOXVHWA_UNIFORM4F vboxglUniform4f;
|
---|
| 213 |
|
---|
| 214 | extern PFNVBOXVHWA_UNIFORM1I vboxglUniform1i;
|
---|
| 215 | extern PFNVBOXVHWA_UNIFORM2I vboxglUniform2i;
|
---|
| 216 | extern PFNVBOXVHWA_UNIFORM3I vboxglUniform3i;
|
---|
| 217 | extern PFNVBOXVHWA_UNIFORM4I vboxglUniform4i;
|
---|
| 218 |
|
---|
| 219 | extern PFNVBOXVHWA_GEN_BUFFERS vboxglGenBuffers;
|
---|
| 220 | extern PFNVBOXVHWA_DELETE_BUFFERS vboxglDeleteBuffers;
|
---|
| 221 | extern PFNVBOXVHWA_BIND_BUFFER vboxglBindBuffer;
|
---|
| 222 | extern PFNVBOXVHWA_BUFFER_DATA vboxglBufferData;
|
---|
| 223 | extern PFNVBOXVHWA_MAP_BUFFER vboxglMapBuffer;
|
---|
| 224 | extern PFNVBOXVHWA_UNMAP_BUFFER vboxglUnmapBuffer;
|
---|
| 225 |
|
---|
[25423] | 226 | extern PFNVBOXVHWA_IS_FRAMEBUFFER vboxglIsFramebuffer;
|
---|
| 227 | extern PFNVBOXVHWA_BIND_FRAMEBUFFER vboxglBindFramebuffer;
|
---|
| 228 | extern PFNVBOXVHWA_DELETE_FRAMEBUFFERS vboxglDeleteFramebuffers;
|
---|
| 229 | extern PFNVBOXVHWA_GEN_FRAMEBUFFERS vboxglGenFramebuffers;
|
---|
| 230 | extern PFNVBOXVHWA_CHECK_FRAMEBUFFER_STATUS vboxglCheckFramebufferStatus;
|
---|
| 231 | extern PFNVBOXVHWA_FRAMEBUFFER_TEXTURE1D vboxglFramebufferTexture1D;
|
---|
| 232 | extern PFNVBOXVHWA_FRAMEBUFFER_TEXTURE2D vboxglFramebufferTexture2D;
|
---|
| 233 | extern PFNVBOXVHWA_FRAMEBUFFER_TEXTURE3D vboxglFramebufferTexture3D;
|
---|
| 234 | extern PFNVBOXVHWA_GET_FRAMEBUFFER_ATTACHMENT_PARAMETRIV vboxglGetFramebufferAttachmentParameteriv;
|
---|
| 235 |
|
---|
| 236 |
|
---|
[23740] | 237 | class VBoxGLInfo
|
---|
| 238 | {
|
---|
| 239 | public:
|
---|
| 240 | VBoxGLInfo() :
|
---|
| 241 | mGLVersion(0),
|
---|
| 242 | mFragmentShaderSupported(false),
|
---|
| 243 | mTextureRectangleSupported(false),
|
---|
| 244 | mTextureNP2Supported(false),
|
---|
| 245 | mPBOSupported(false),
|
---|
[25423] | 246 | mFBOSupported(false),
|
---|
[23740] | 247 | mMultiTexNumSupported(1), /* 1 would mean it is not supported */
|
---|
| 248 | m_GL_ARB_multitexture(false),
|
---|
| 249 | m_GL_ARB_shader_objects(false),
|
---|
| 250 | m_GL_ARB_fragment_shader(false),
|
---|
| 251 | m_GL_ARB_pixel_buffer_object(false),
|
---|
| 252 | m_GL_ARB_texture_rectangle(false),
|
---|
| 253 | m_GL_EXT_texture_rectangle(false),
|
---|
| 254 | m_GL_NV_texture_rectangle(false),
|
---|
| 255 | m_GL_ARB_texture_non_power_of_two(false),
|
---|
[25423] | 256 | m_GL_EXT_framebuffer_object(false),
|
---|
[23740] | 257 | mInitialized(false)
|
---|
| 258 | {}
|
---|
| 259 |
|
---|
| 260 | void init(const class QGLContext * pContext);
|
---|
| 261 |
|
---|
| 262 | bool isInitialized() const { return mInitialized; }
|
---|
| 263 |
|
---|
| 264 | int getGLVersion() const { return mGLVersion; }
|
---|
| 265 | bool isFragmentShaderSupported() const { return mFragmentShaderSupported; }
|
---|
| 266 | bool isTextureRectangleSupported() const { return mTextureRectangleSupported; }
|
---|
| 267 | bool isTextureNP2Supported() const { return mTextureNP2Supported; }
|
---|
| 268 | bool isPBOSupported() const { return mPBOSupported; }
|
---|
[25453] | 269 | /* some ATI drivers do not seem to support non-zero offsets when dealing with PBOs
|
---|
| 270 | * @todo: add a check for that, always unsupported currently */
|
---|
| 271 | bool isPBOOffsetSupported() const { return false; }
|
---|
[25423] | 272 | bool isFBOSupported() const { return mFBOSupported; }
|
---|
[23740] | 273 | /* 1 would mean it is not supported */
|
---|
| 274 | int getMultiTexNumSupported() const { return mMultiTexNumSupported; }
|
---|
| 275 |
|
---|
| 276 | static int parseVersion(const GLubyte * ver);
|
---|
| 277 | private:
|
---|
| 278 | void initExtSupport(const class QGLContext & context);
|
---|
| 279 |
|
---|
| 280 | int mGLVersion;
|
---|
| 281 | bool mFragmentShaderSupported;
|
---|
| 282 | bool mTextureRectangleSupported;
|
---|
| 283 | bool mTextureNP2Supported;
|
---|
| 284 | bool mPBOSupported;
|
---|
[25423] | 285 | bool mFBOSupported;
|
---|
[23740] | 286 | int mMultiTexNumSupported; /* 1 would mean it is not supported */
|
---|
| 287 |
|
---|
| 288 | bool m_GL_ARB_multitexture;
|
---|
| 289 | bool m_GL_ARB_shader_objects;
|
---|
| 290 | bool m_GL_ARB_fragment_shader;
|
---|
| 291 | bool m_GL_ARB_pixel_buffer_object;
|
---|
| 292 | bool m_GL_ARB_texture_rectangle;
|
---|
| 293 | bool m_GL_EXT_texture_rectangle;
|
---|
| 294 | bool m_GL_NV_texture_rectangle;
|
---|
| 295 | bool m_GL_ARB_texture_non_power_of_two;
|
---|
[25423] | 296 | bool m_GL_EXT_framebuffer_object;
|
---|
[23740] | 297 |
|
---|
| 298 | bool mInitialized;
|
---|
| 299 | };
|
---|
| 300 |
|
---|
| 301 | class VBoxGLTmpContext
|
---|
| 302 | {
|
---|
| 303 | public:
|
---|
| 304 | VBoxGLTmpContext();
|
---|
| 305 | ~VBoxGLTmpContext();
|
---|
| 306 |
|
---|
| 307 | const class QGLContext * makeCurrent();
|
---|
| 308 | private:
|
---|
| 309 | class QGLWidget * mWidget;
|
---|
| 310 | };
|
---|
| 311 |
|
---|
| 312 |
|
---|
| 313 | #define VBOXQGL_MAKEFOURCC(ch0, ch1, ch2, ch3) \
|
---|
| 314 | ((uint32_t)(uint8_t)(ch0) | ((uint32_t)(uint8_t)(ch1) << 8) | \
|
---|
| 315 | ((uint32_t)(uint8_t)(ch2) << 16) | ((uint32_t)(uint8_t)(ch3) << 24 ))
|
---|
| 316 |
|
---|
| 317 | #define FOURCC_AYUV VBOXQGL_MAKEFOURCC('A', 'Y', 'U', 'V')
|
---|
| 318 | #define FOURCC_UYVY VBOXQGL_MAKEFOURCC('U', 'Y', 'V', 'Y')
|
---|
| 319 | #define FOURCC_YUY2 VBOXQGL_MAKEFOURCC('Y', 'U', 'Y', '2')
|
---|
| 320 | #define FOURCC_YV12 VBOXQGL_MAKEFOURCC('Y', 'V', '1', '2')
|
---|
| 321 | #define VBOXVHWA_NUMFOURCC 4
|
---|
| 322 |
|
---|
| 323 | class VBoxVHWAInfo
|
---|
| 324 | {
|
---|
| 325 | public:
|
---|
| 326 | VBoxVHWAInfo() :
|
---|
| 327 | mFourccSupportedCount(0),
|
---|
| 328 | mInitialized(false)
|
---|
| 329 | {}
|
---|
| 330 |
|
---|
| 331 | VBoxVHWAInfo(const VBoxGLInfo & glInfo) :
|
---|
| 332 | mglInfo(glInfo),
|
---|
| 333 | mFourccSupportedCount(0),
|
---|
| 334 | mInitialized(false)
|
---|
| 335 | {}
|
---|
| 336 |
|
---|
| 337 | void init(const class QGLContext * pContext);
|
---|
| 338 |
|
---|
| 339 | bool isInitialized() const { return mInitialized; }
|
---|
| 340 |
|
---|
| 341 | const VBoxGLInfo & getGlInfo() const { return mglInfo; }
|
---|
| 342 |
|
---|
| 343 | bool isVHWASupported() const;
|
---|
| 344 |
|
---|
| 345 | int getFourccSupportedCount() const { return mFourccSupportedCount; }
|
---|
| 346 | const uint32_t * getFourccSupportedList() const { return mFourccSupportedList; }
|
---|
| 347 |
|
---|
| 348 | static bool checkVHWASupport();
|
---|
| 349 | private:
|
---|
| 350 | VBoxGLInfo mglInfo;
|
---|
| 351 | uint32_t mFourccSupportedList[VBOXVHWA_NUMFOURCC];
|
---|
| 352 | int mFourccSupportedCount;
|
---|
| 353 |
|
---|
| 354 | bool mInitialized;
|
---|
| 355 | };
|
---|
| 356 |
|
---|
| 357 | #endif /* #ifndef __VBoxGLSupportInfo_h__ */
|
---|