Qt 4.8
Public Functions | Protected Variables | Properties | List of all members
EAGLView Class Reference

#import <quikitwindow.h>

Inheritance diagram for EAGLView:

Public Functions

(void) - createFramebuffer
 
(void) - deleteFramebuffer
 
(void) - makeCurrent
 
(void) - presentFramebuffer
 
(void) - sendMouseEventForTouches:withEvent:fakeButtons:
 
(void) - setContext:
 
(void) - setWindow:
 

Protected Variables

GLuint mColorRenderbuffer
 
EAGLContext * mContext
 
GLuint mDepthRenderbuffer
 
GLuint mFramebuffer
 
GLint mFramebufferHeight
 
GLint mFramebufferWidth
 
QPlatformWindowmWindow
 

Properties

UITextAutocapitalizationType autocapitalizationType
 
UITextAutocorrectionType autocorrectionType
 
id delegate
 
BOOL enablesReturnKeyAutomatically
 
GLint fbo
 
UIKeyboardAppearance keyboardAppearance
 
UIKeyboardType keyboardType
 
UIReturnKeyType returnKeyType
 
BOOL secureTextEntry
 

Detailed Description

Definition at line 54 of file quikitwindow.h.

Functions

◆ createFramebuffer()

- (void) createFramebuffer

Definition at line 206 of file quikitwindow.mm.

207 {
208  if (mContext && !mFramebuffer)
209  {
210  [EAGLContext setCurrentContext:mContext];
213 
216  [mContext renderbufferStorage:GL_RENDERBUFFER fromDrawable:(CAEAGLLayer *)self.layer];
220 
223  if (stencilBits() > 0) {
226  } else {
228  }
230 
232  NSLog(@"Failed to make complete framebuffer object %x", glCheckFramebufferStatus(GL_FRAMEBUFFER));
233  if (delegate && [delegate respondsToSelector:@selector(eaglView:usesFramebuffer:)]) {
234  [delegate eaglView:self usesFramebuffer:mFramebuffer];
235  }
236  }
237 }
GLuint mDepthRenderbuffer
Definition: quikitwindow.h:63
#define GL_RENDERBUFFER_WIDTH
#define GL_FRAMEBUFFER_COMPLETE
#define glGenRenderbuffers
GLuint mFramebuffer
Definition: quikitwindow.h:63
#define glBindFramebuffer
#define GL_RENDERBUFFER
static GLint stencilBits()
Definition: quikitwindow.mm:56
#define GL_DEPTH_ATTACHMENT
GLint mFramebufferWidth
Definition: quikitwindow.h:60
#define GL_DEPTH_COMPONENT16
#define glCheckFramebufferStatus
#define glGenFramebuffers
EAGLContext * mContext
Definition: quikitwindow.h:58
GLuint mColorRenderbuffer
Definition: quikitwindow.h:63
GLint mFramebufferHeight
Definition: quikitwindow.h:61
#define GL_FRAMEBUFFER
#define glGetRenderbufferParameteriv
#define glBindRenderbuffer
#define GL_STENCIL_ATTACHMENT
#define GL_COLOR_ATTACHMENT0
#define glFramebufferRenderbuffer
#define GL_RENDERBUFFER_HEIGHT
#define glRenderbufferStorage

◆ deleteFramebuffer()

- (void) deleteFramebuffer

Definition at line 186 of file quikitwindow.mm.

Referenced by QUIKitWindow::ensureNativeWindow().

187 {
188  if (mContext)
189  {
190  [EAGLContext setCurrentContext:mContext];
191  if (mFramebuffer) {
193  mFramebuffer = 0;
194  }
195  if (mColorRenderbuffer) {
197  mColorRenderbuffer = 0;
198  }
199  if (mDepthRenderbuffer) {
201  mDepthRenderbuffer = 0;
202  }
203  }
204 }
GLuint mDepthRenderbuffer
Definition: quikitwindow.h:63
GLuint mFramebuffer
Definition: quikitwindow.h:63
#define glDeleteRenderbuffers
#define glDeleteFramebuffers
EAGLContext * mContext
Definition: quikitwindow.h:58
GLuint mColorRenderbuffer
Definition: quikitwindow.h:63

◆ makeCurrent()

- (void) makeCurrent

Definition at line 239 of file quikitwindow.mm.

240 {
241  if (mContext)
242  {
243  [EAGLContext setCurrentContext:mContext];
244  if (!mFramebuffer)
245  [self createFramebuffer];
247  glViewport(0, 0, mFramebufferWidth, mFramebufferHeight);
248  }
249 }
GLuint mFramebuffer
Definition: quikitwindow.h:63
#define glBindFramebuffer
GLint mFramebufferWidth
Definition: quikitwindow.h:60
EAGLContext * mContext
Definition: quikitwindow.h:58
GLint mFramebufferHeight
Definition: quikitwindow.h:61
#define GL_FRAMEBUFFER

◆ presentFramebuffer()

- (void) presentFramebuffer

Definition at line 177 of file quikitwindow.mm.

178 {
179  if (mContext) {
180  [EAGLContext setCurrentContext:mContext];
182  [mContext presentRenderbuffer:GL_RENDERBUFFER];
183  }
184 }
#define GL_RENDERBUFFER
EAGLContext * mContext
Definition: quikitwindow.h:58
GLuint mColorRenderbuffer
Definition: quikitwindow.h:63
#define glBindRenderbuffer

◆ sendMouseEventForTouches:withEvent:fakeButtons:()

- (void) sendMouseEventForTouches: (NSSet *)  touches
withEvent: (UIEvent *)  event
fakeButtons: (Qt::MouseButtons)  buttons 

Definition at line 261 of file quikitwindow.mm.

261  :(NSSet *)touches withEvent:(UIEvent *)event fakeButtons:(Qt::MouseButtons)buttons
262 {
263  UITouch *touch = [touches anyObject];
264  CGPoint locationInView = [touch locationInView:self];
265  CGFloat scaleFactor = [self contentScaleFactor];
266  QPoint p(locationInView.x * scaleFactor, locationInView.y * scaleFactor);
267  // TODO handle global touch point? for status bar?
269  p, p, buttons);
270 }
QPlatformWindow * mWindow
Definition: quikitwindow.h:57
EventRef event
static Qt::MouseButtons buttons
static void handleMouseEvent(QWidget *w, const QPoint &local, const QPoint &global, Qt::MouseButtons b)
tlw == 0 means that ev is in global coords only
unsigned long ulong
Definition: qglobal.h:997
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
QWidget * widget() const
Returnes the widget which belongs to the QPlatformWindow.
float CGFloat

◆ setContext:()

- (void) setContext: (EAGLContext *)  newContext

Definition at line 166 of file quikitwindow.mm.

166  :(EAGLContext *)newContext
167 {
168  if (mContext != newContext)
169  {
170  [self deleteFramebuffer];
171  [mContext release];
172  mContext = [newContext retain];
173  [EAGLContext setCurrentContext:nil];
174  }
175 }
EAGLContext * mContext
Definition: quikitwindow.h:58

◆ setWindow:()

- (void) setWindow: (QPlatformWindow *)  window

Definition at line 256 of file quikitwindow.mm.

Referenced by QUIKitWindow::ensureNativeWindow().

256  :(QPlatformWindow *)window
257 {
258  mWindow = window;
259 }
QPlatformWindow * mWindow
Definition: quikitwindow.h:57
The QPlatformWindow class provides an abstraction for top-level windows.
NSWindow * window

Properties

◆ mColorRenderbuffer

- (GLuint) mColorRenderbuffer
protected

Definition at line 63 of file quikitwindow.h.

◆ mContext

- (EAGLContext*) mContext
protected

Definition at line 58 of file quikitwindow.h.

◆ mDepthRenderbuffer

- (GLuint) mDepthRenderbuffer
protected

Definition at line 63 of file quikitwindow.h.

◆ mFramebuffer

- (GLuint) mFramebuffer
protected

Definition at line 63 of file quikitwindow.h.

◆ mFramebufferHeight

- (GLint) mFramebufferHeight
protected

Definition at line 61 of file quikitwindow.h.

◆ mFramebufferWidth

- (GLint) mFramebufferWidth
protected

Definition at line 60 of file quikitwindow.h.

◆ mWindow

- (QPlatformWindow*) mWindow
protected

Definition at line 57 of file quikitwindow.h.

Property Documentation

◆ autocapitalizationType

- (UITextAutocapitalizationType) autocapitalizationType
readwritenonatomicassign

Definition at line 67 of file quikitwindow.h.

◆ autocorrectionType

- (UITextAutocorrectionType) autocorrectionType
readwritenonatomicassign

Definition at line 68 of file quikitwindow.h.

◆ delegate

- (id) delegate
readwritenonatomicassign

Definition at line 65 of file quikitwindow.h.

Referenced by EAGLPaintDevice::EAGLPaintDevice().

◆ enablesReturnKeyAutomatically

- (BOOL) enablesReturnKeyAutomatically
readwritenonatomicassign

Definition at line 69 of file quikitwindow.h.

◆ fbo

- (GLint) fbo
readatomicassign

Definition at line 84 of file quikitwindow.h.

Referenced by EAGLPaintDevice::EAGLPaintDevice().

◆ keyboardAppearance

- (UIKeyboardAppearance) keyboardAppearance
readwritenonatomicassign

Definition at line 70 of file quikitwindow.h.

◆ keyboardType

- (UIKeyboardType) keyboardType
readwritenonatomicassign

Definition at line 71 of file quikitwindow.h.

◆ returnKeyType

- (UIReturnKeyType) returnKeyType
readwritenonatomicassign

Definition at line 72 of file quikitwindow.h.

Referenced by QUIKitSoftwareInputHandler::eventFilter().

◆ secureTextEntry

- (BOOL) secureTextEntry
readwritenonatomicassign

Definition at line 73 of file quikitwindow.h.


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