Qt 4.8
Public Functions | Properties | List of all members
QDirectFbGLContext Class Reference

#include <qdirectfbglcontext.h>

Inheritance diagram for QDirectFbGLContext:
QPlatformGLContext

Public Functions

void doneCurrent ()
 Reimplement in subclass to release current context. More...
 
void * getProcAddress (const QString &procName)
 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...
 
 QDirectFbGLContext (IDirectFBGL *glContext)
 
void swapBuffers ()
 Reimplement in subclass to native swap buffers calls. More...
 
- 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

IDirectFBGL * m_dfbGlContext
 
QPlatformWindowFormat m_windowFormat
 

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 49 of file qdirectfbglcontext.h.

Constructors and Destructors

◆ QDirectFbGLContext()

QDirectFbGLContext::QDirectFbGLContext ( IDirectFBGL *  glContext)
explicit

Definition at line 50 of file qdirectfbglcontext.cpp.

51  : m_dfbGlContext(glContext)
52 {
53  DFBResult result;
54  DFBGLAttributes glAttribs;
55  result = m_dfbGlContext->GetAttributes(glContext, &glAttribs);
56  if (result == DFB_OK) {
57  m_windowFormat.setDepthBufferSize(glAttribs.depth_size);
58  m_windowFormat.setStencilBufferSize(glAttribs.stencil_size);
59 
60  m_windowFormat.setRedBufferSize(glAttribs.red_size);
61  m_windowFormat.setGreenBufferSize(glAttribs.green_size);
62  m_windowFormat.setBlueBufferSize(glAttribs.blue_size);
63  m_windowFormat.setAlphaBufferSize(glAttribs.alpha_size);
64 
65  m_windowFormat.setAccumBufferSize(glAttribs.accum_red_size);
66  m_windowFormat.setAlpha(glAttribs.accum_alpha_size);
67 
68  m_windowFormat.setDoubleBuffer(glAttribs.double_buffer);
69  m_windowFormat.setStereo(glAttribs.stereo);
70  }
71 }
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 setBlueBufferSize(int size)
Set the preferred blue buffer size to size.
void setStencilBufferSize(int size)
Set the preferred stencil buffer size to size.
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.
QPlatformWindowFormat m_windowFormat
void setDoubleBuffer(bool enable)
If enable is true sets double buffering; otherwise sets single buffering.
void setAlpha(bool enable)
If enable is true enables the alpha buffer; otherwise disables the alpha buffer.
void setRedBufferSize(int size)
Set the preferred red buffer size to size.
IDirectFBGL * m_dfbGlContext
void setGreenBufferSize(int size)
Set the preferred green buffer size to size.

Functions

◆ doneCurrent()

void QDirectFbGLContext::doneCurrent ( )
virtual

Reimplement in subclass to release current context.

Typically this is calling makeCurrent with 0 "surface"

Reimplemented from QPlatformGLContext.

Definition at line 79 of file qdirectfbglcontext.cpp.

80 {
83 }
virtual void doneCurrent()
Reimplement in subclass to release current context.
IDirectFBGL * m_dfbGlContext

◆ getProcAddress()

void * QDirectFbGLContext::getProcAddress ( const QString procName)
virtual

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 85 of file qdirectfbglcontext.cpp.

86 {
87  void *proc;
88  DFBResult result = m_dfbGlContext->GetProcAddress(m_dfbGlContext,qPrintable(procName),&proc);
89  if (result == DFB_OK)
90  return proc;
91  return 0;
92 }
IDirectFBGL * m_dfbGlContext
#define qPrintable(string)
Definition: qglobal.h:1750

◆ makeCurrent()

void QDirectFbGLContext::makeCurrent ( )
virtual

Reimplement in subclass to do makeCurrent on native GL context.

Reimplemented from QPlatformGLContext.

Definition at line 73 of file qdirectfbglcontext.cpp.

74 {
77 }
virtual void makeCurrent()
Reimplement in subclass to do makeCurrent on native GL context.
IDirectFBGL * m_dfbGlContext

◆ platformWindowFormat()

QPlatformWindowFormat QDirectFbGLContext::platformWindowFormat ( ) const
virtual

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 100 of file qdirectfbglcontext.cpp.

101 {
102  return m_windowFormat;
103 }
QPlatformWindowFormat m_windowFormat

◆ swapBuffers()

void QDirectFbGLContext::swapBuffers ( )
virtual

Reimplement in subclass to native swap buffers calls.

Implements QPlatformGLContext.

Definition at line 94 of file qdirectfbglcontext.cpp.

95 {
96 // m_dfbGlContext->Unlock(m_dfbGlContext); //maybe not in doneCurrent()
97  qDebug() << "Swap buffers";
98 }
Q_CORE_EXPORT void qDebug(const char *,...)

Properties

◆ m_dfbGlContext

IDirectFBGL* QDirectFbGLContext::m_dfbGlContext
private

Definition at line 63 of file qdirectfbglcontext.h.

Referenced by doneCurrent(), getProcAddress(), makeCurrent(), and QDirectFbGLContext().

◆ m_windowFormat

QPlatformWindowFormat QDirectFbGLContext::m_windowFormat
private

Definition at line 65 of file qdirectfbglcontext.h.

Referenced by platformWindowFormat(), and QDirectFbGLContext().


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