Qt 4.8
Public Types | List of all members
QGLExtensions Class Reference

#include <qgl_p.h>

Public Types

enum  Extension {
  TextureRectangle = 0x00000001, SampleBuffers = 0x00000002, GenerateMipmap = 0x00000004, TextureCompression = 0x00000008,
  FragmentProgram = 0x00000010, MirroredRepeat = 0x00000020, FramebufferObject = 0x00000040, StencilTwoSide = 0x00000080,
  StencilWrap = 0x00000100, PackedDepthStencil = 0x00000200, NVFloatBuffer = 0x00000400, PixelBufferObject = 0x00000800,
  FramebufferBlit = 0x00001000, NPOTTextures = 0x00002000, BGRATextureFormat = 0x00004000, DDSTextureCompression = 0x00008000,
  ETC1TextureCompression = 0x00010000, PVRTCTextureCompression = 0x00020000, FragmentShader = 0x00040000, ElementIndexUint = 0x00080000,
  Depth24 = 0x00100000, SRGBFrameBuffer = 0x00200000
}
 

Static Public Functions

static Extensions glExtensions ()
 
static Extensions currentContextExtensions ()
 

Detailed Description

Definition at line 284 of file qgl_p.h.

Enumerations

◆ Extension

Enumerator
TextureRectangle 
SampleBuffers 
GenerateMipmap 
TextureCompression 
FragmentProgram 
MirroredRepeat 
FramebufferObject 
StencilTwoSide 
StencilWrap 
PackedDepthStencil 
NVFloatBuffer 
PixelBufferObject 
FramebufferBlit 
NPOTTextures 
BGRATextureFormat 
DDSTextureCompression 
ETC1TextureCompression 
PVRTCTextureCompression 
FragmentShader 
ElementIndexUint 
Depth24 
SRGBFrameBuffer 

Definition at line 286 of file qgl_p.h.

286  {
287  TextureRectangle = 0x00000001,
288  SampleBuffers = 0x00000002,
289  GenerateMipmap = 0x00000004,
290  TextureCompression = 0x00000008,
291  FragmentProgram = 0x00000010,
292  MirroredRepeat = 0x00000020,
293  FramebufferObject = 0x00000040,
294  StencilTwoSide = 0x00000080,
295  StencilWrap = 0x00000100,
296  PackedDepthStencil = 0x00000200,
297  NVFloatBuffer = 0x00000400,
298  PixelBufferObject = 0x00000800,
299  FramebufferBlit = 0x00001000,
300  NPOTTextures = 0x00002000,
301  BGRATextureFormat = 0x00004000,
302  DDSTextureCompression = 0x00008000,
303  ETC1TextureCompression = 0x00010000,
304  PVRTCTextureCompression = 0x00020000,
305  FragmentShader = 0x00040000,
306  ElementIndexUint = 0x00080000,
307  Depth24 = 0x00100000,
308  SRGBFrameBuffer = 0x00200000
309  };

Functions

◆ currentContextExtensions()

QGLExtensions::Extensions QGLExtensions::currentContextExtensions ( )
static

Definition at line 5673 of file qgl.cpp.

5674 {
5676  Extensions glExtensions;
5677 
5678  if (extensions.match("GL_ARB_texture_rectangle"))
5679  glExtensions |= TextureRectangle;
5680  if (extensions.match("GL_ARB_multisample"))
5681  glExtensions |= SampleBuffers;
5682  if (extensions.match("GL_SGIS_generate_mipmap"))
5683  glExtensions |= GenerateMipmap;
5684  if (extensions.match("GL_ARB_texture_compression"))
5685  glExtensions |= TextureCompression;
5686  if (extensions.match("GL_EXT_texture_compression_s3tc"))
5687  glExtensions |= DDSTextureCompression;
5688  if (extensions.match("GL_OES_compressed_ETC1_RGB8_texture"))
5689  glExtensions |= ETC1TextureCompression;
5690  if (extensions.match("GL_IMG_texture_compression_pvrtc"))
5691  glExtensions |= PVRTCTextureCompression;
5692  if (extensions.match("GL_ARB_fragment_program"))
5693  glExtensions |= FragmentProgram;
5694  if (extensions.match("GL_ARB_fragment_shader"))
5695  glExtensions |= FragmentShader;
5696  if (extensions.match("GL_ARB_shader_objects"))
5697  glExtensions |= FragmentShader;
5698  if (extensions.match("GL_ARB_texture_mirrored_repeat"))
5699  glExtensions |= MirroredRepeat;
5700  if (extensions.match("GL_EXT_framebuffer_object"))
5701  glExtensions |= FramebufferObject;
5702  if (extensions.match("GL_EXT_stencil_two_side"))
5703  glExtensions |= StencilTwoSide;
5704  if (extensions.match("GL_EXT_stencil_wrap"))
5705  glExtensions |= StencilWrap;
5706  if (extensions.match("GL_EXT_packed_depth_stencil"))
5707  glExtensions |= PackedDepthStencil;
5708  if (extensions.match("GL_NV_float_buffer"))
5709  glExtensions |= NVFloatBuffer;
5710  if (extensions.match("GL_ARB_pixel_buffer_object"))
5711  glExtensions |= PixelBufferObject;
5712  if (extensions.match("GL_IMG_texture_format_BGRA8888")
5713  || extensions.match("GL_EXT_texture_format_BGRA8888"))
5714  glExtensions |= BGRATextureFormat;
5715 #if defined(QT_OPENGL_ES_2)
5716  glExtensions |= FramebufferObject;
5717  glExtensions |= GenerateMipmap;
5718  glExtensions |= FragmentShader;
5719 #endif
5720 #if defined(QT_OPENGL_ES_1)
5721  if (extensions.match("GL_OES_framebuffer_object"))
5722  glExtensions |= FramebufferObject;
5723 #endif
5724 #if defined(QT_OPENGL_ES)
5725  if (extensions.match("GL_OES_packed_depth_stencil"))
5726  glExtensions |= PackedDepthStencil;
5727  if (extensions.match("GL_OES_element_index_uint"))
5728  glExtensions |= ElementIndexUint;
5729  if (extensions.match("GL_OES_depth24"))
5730  glExtensions |= Depth24;
5731 #else
5732  glExtensions |= ElementIndexUint;
5733 #endif
5734  if (extensions.match("GL_ARB_framebuffer_object")) {
5735  // ARB_framebuffer_object also includes EXT_framebuffer_blit.
5736  glExtensions |= FramebufferObject;
5737  glExtensions |= FramebufferBlit;
5738  }
5739 
5740  if (extensions.match("GL_EXT_framebuffer_blit"))
5741  glExtensions |= FramebufferBlit;
5742 
5743  if (extensions.match("GL_ARB_texture_non_power_of_two"))
5744  glExtensions |= NPOTTextures;
5745 
5746  if (extensions.match("GL_EXT_bgra"))
5747  glExtensions |= BGRATextureFormat;
5748 
5749  {
5750  GLboolean srgbCapableFramebuffers = false;
5751  glGetBooleanv(FRAMEBUFFER_SRGB_CAPABLE_EXT, &srgbCapableFramebuffers);
5752  if (srgbCapableFramebuffers)
5753  glExtensions |= SRGBFrameBuffer;
5754  // Clear possible error which is generated if
5755  // FRAMEBUFFER_SRGB_CAPABLE_EXT isn't supported.
5756  glGetError();
5757  }
5758 
5759  return glExtensions;
5760 }
#define FRAMEBUFFER_SRGB_CAPABLE_EXT
Q_GUI_EXPORT QString extensions()
Definition: qegl.cpp:785
bool match(const char *str) const
Definition: qgl_p.h:906
static Extensions glExtensions()
Definition: qgl.cpp:5781
typedef GLboolean
Definition: glfunctions.h:67

◆ glExtensions()

QGLExtensions::Extensions QGLExtensions::glExtensions ( )
static

Definition at line 5781 of file qgl.cpp.

Referenced by QOpenGLPaintEngine::begin(), QGLFramebufferObject::bindDefault(), QGLFramebufferObject::blitFramebuffer(), QGLContext::choosePixelFormat(), QGLContext::chooseVisual(), QGL2PaintEngineExPrivate::fill(), QGLWindowSurface::flush(), QGLFramebufferObject::hasOpenGLFramebufferBlit(), QGLFramebufferObject::hasOpenGLFramebufferObjects(), QGLFramebufferObjectPrivate::init(), QGLOffscreen::isSupported(), nearest_gl_texture_size(), needsEmulation(), pfiToQGLFormat(), QGLEngineSelector::preferredPaintEngine(), qPolyline(), qt_format_to_attrib_list(), qt_gl_preferredTextureFormat(), qt_gl_preferredTextureTarget(), qt_resolve_glsl_extensions(), qTriangulate(), QGLWindowSurface::updateGeometry(), QOpenGLPaintEnginePrivate::updateGradient(), and QOpenGLPaintEngine::updateRenderHints().

5782 {
5783  Extensions extensionFlags = 0;
5784  QGLContext *currentCtx = const_cast<QGLContext *>(QGLContext::currentContext());
5785 
5786  if (currentCtx && currentCtx->d_func()->extension_flags_cached)
5787  return currentCtx->d_func()->extension_flags;
5788 
5789  if (!currentCtx) {
5790  extensionFlags = qtDefaultExtensions()->extensions;
5791  } else {
5792  extensionFlags = currentContextExtensions();
5793  currentCtx->d_func()->extension_flags_cached = true;
5794  currentCtx->d_func()->extension_flags = extensionFlags;
5795  }
5796  return extensionFlags;
5797 }
static const QGLContext * currentContext()
Returns the current context, i.e.
Definition: qgl.cpp:3545
The QGLContext class encapsulates an OpenGL rendering context.
Definition: qgl.h:310
static Extensions currentContextExtensions()
Definition: qgl.cpp:5673

The documentation for this class was generated from the following files: