Qt 4.8
Public Functions | Properties | List of all members
EAGLPlatformContext Class Reference
Inheritance diagram for EAGLPlatformContext:
QPlatformGLContext

Public Functions

void doneCurrent ()
 Reimplement in subclass to release current context. More...
 
 EAGLPlatformContext (EAGLView *view)
 
void * getProcAddress (const QString &)
 Reimplement in subclass to native getProcAddr calls. More...
 
void makeCurrent ()
 Reimplement in subclass to do makeCurrent on native GL context. More...
 
QPlatformWindowFormat platformWindowFormat () const
 QWidget has the function qplatformWindowFormat(). More...
 
void swapBuffers ()
 Reimplement in subclass to native swap buffers calls. More...
 
 ~EAGLPlatformContext ()
 
- Public Functions inherited from QPlatformGLContext
 QPlatformGLContext ()
 All subclasses needs to specify the platformWindow. More...
 
virtual ~QPlatformGLContext ()
 If this is the current context for the thread, doneCurrent is called. More...
 

Properties

QPlatformWindowFormat mFormat
 
EAGLViewmView
 

Additional Inherited Members

- Static Public Functions inherited from QPlatformGLContext
static const QPlatformGLContextcurrentContext ()
 Returns the last context which called makeCurrent. More...
 
- Protected Variables inherited from QPlatformGLContext
QScopedPointer< QPlatformGLContextPrivated_ptr
 

Detailed Description

Definition at line 73 of file quikitwindow.mm.

Constructors and Destructors

◆ EAGLPlatformContext()

EAGLPlatformContext::EAGLPlatformContext ( EAGLView view)
inline

Definition at line 76 of file quikitwindow.mm.

77  : mView(view)
78  {
90  mFormat.setDepth(true);
91  mFormat.setRgba(true);
92  mFormat.setAlpha(true);
93  mFormat.setAccum(false);
95  mFormat.setStereo(false);
97 
98 #if defined(QT_OPENGL_ES_2)
99  EAGLContext *aContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
100 #else
101  EAGLContext *aContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1];
102 #endif
103  [mView setContext:aContext];
104  }
void setDepthBufferSize(int size)
Set the minimum depth buffer size to size.
void setStereo(bool enable)
If enable is true enables stereo buffering; otherwise disables stereo buffering.
void setDirectRendering(bool enable)
If enable is true enables direct rendering; otherwise disables direct rendering.
void setBlueBufferSize(int size)
Set the preferred blue buffer size to size.
void setStencilBufferSize(int size)
Set the preferred stencil buffer size to size.
static GLint stencilBits()
Definition: quikitwindow.mm:56
void setAccumBufferSize(int size)
Set the preferred accumulation buffer size, where size is the bit depth for each RGBA component...
void setAlphaBufferSize(int size)
Set the preferred alpha buffer size to size.
void setSamples(int numSamples)
Set the preferred number of samples per pixel when multisampling is enabled to numSamples.
void setDoubleBuffer(bool enable)
If enable is true sets double buffering; otherwise sets single buffering.
void setRgba(bool enable)
If enable is true sets RGBA mode.
void setAlpha(bool enable)
If enable is true enables the alpha buffer; otherwise disables the alpha buffer.
void setSampleBuffers(bool enable)
If enable is true, a GL context with multisample buffer support is picked; otherwise ignored...
void setWindowApi(QPlatformWindowFormat::WindowApi api)
void setStencil(bool enable)
If enable is true enables the stencil buffer; otherwise disables the stencil buffer.
void setRedBufferSize(int size)
Set the preferred red buffer size to size.
void setAccum(bool enable)
If enable is true enables the accumulation buffer; otherwise disables the accumulation buffer...
QPlatformWindowFormat mFormat
void setGreenBufferSize(int size)
Set the preferred green buffer size to size.
static GLint depthBits()
Definition: quikitwindow.mm:67
void setDepth(bool enable)
If enable is true enables the depth buffer; otherwise disables the depth buffer.

◆ ~EAGLPlatformContext()

EAGLPlatformContext::~EAGLPlatformContext ( )
inline

Definition at line 106 of file quikitwindow.mm.

106 { }

Functions

◆ doneCurrent()

void EAGLPlatformContext::doneCurrent ( )
inlinevirtual

Reimplement in subclass to release current context.

Typically this is calling makeCurrent with 0 "surface"

Reimplemented from QPlatformGLContext.

Definition at line 114 of file quikitwindow.mm.

115  {
117  }
virtual void doneCurrent()
Reimplement in subclass to release current context.

◆ getProcAddress()

void* EAGLPlatformContext::getProcAddress ( const QString procName)
inlinevirtual

Reimplement in subclass to native getProcAddr calls.

Note: its convenient to use qPrintable(const QString &str) to get the const char * pointer

Implements QPlatformGLContext.

Definition at line 124 of file quikitwindow.mm.

124 { return 0; }

◆ makeCurrent()

void EAGLPlatformContext::makeCurrent ( )
inlinevirtual

Reimplement in subclass to do makeCurrent on native GL context.

Reimplemented from QPlatformGLContext.

Definition at line 108 of file quikitwindow.mm.

109  {
111  [mView makeCurrent];
112  }
void makeCurrent()
Reimplement in subclass to do makeCurrent on native GL context.
virtual void makeCurrent()
Reimplement in subclass to do makeCurrent on native GL context.

◆ platformWindowFormat()

QPlatformWindowFormat EAGLPlatformContext::platformWindowFormat ( ) const
inlinevirtual

QWidget has the function qplatformWindowFormat().

That function is for the application programmer to request the format of the window and the context that he wants.

Reimplement this function in a subclass to indicate what format the glContext actually has.

Implements QPlatformGLContext.

Definition at line 126 of file quikitwindow.mm.

127  {
128  return mFormat;
129  }
QPlatformWindowFormat mFormat

◆ swapBuffers()

void EAGLPlatformContext::swapBuffers ( )
inlinevirtual

Reimplement in subclass to native swap buffers calls.

Implements QPlatformGLContext.

Definition at line 119 of file quikitwindow.mm.

120  {
121  [mView presentFramebuffer];
122  }

Properties

◆ mFormat

QPlatformWindowFormat EAGLPlatformContext::mFormat
private

Definition at line 134 of file quikitwindow.mm.

Referenced by EAGLPlatformContext(), and platformWindowFormat().

◆ mView

EAGLView* EAGLPlatformContext::mView
private

Definition at line 132 of file quikitwindow.mm.

Referenced by EAGLPlatformContext(), makeCurrent(), and swapBuffers().


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