Browse Source

Misc

gh-pages
falkTX 10 years ago
parent
commit
d2033dd45d
2 changed files with 12 additions and 7 deletions
  1. +1
    -0
      dgl/src/pugl/pugl_internal.h
  2. +11
    -7
      dgl/src/pugl/pugl_osx.m

+ 1
- 0
dgl/src/pugl/pugl_internal.h View File

@@ -80,6 +80,7 @@ puglInit(int* pargc, char** argv)


PuglInternals* impl = puglInitInternals(); PuglInternals* impl = puglInitInternals();
if (!impl) { if (!impl) {
free(view);
return NULL; return NULL;
} }




+ 11
- 7
dgl/src/pugl/pugl_osx.m View File

@@ -24,8 +24,6 @@


#include "pugl_internal.h" #include "pugl_internal.h"


#include <assert.h>

@interface PuglWindow : NSWindow @interface PuglWindow : NSWindow
{ {
@public @public
@@ -97,10 +95,11 @@ puglDisplay(PuglView* view)


- (BOOL) acceptsFirstMouse:(NSEvent*)e; - (BOOL) acceptsFirstMouse:(NSEvent*)e;
- (BOOL) isFlipped; - (BOOL) isFlipped;
- (BOOL) isOpaque;
- (BOOL) preservesContentInLiveResize; - (BOOL) preservesContentInLiveResize;
- (id) initWithFrame:(NSRect)frame; - (id) initWithFrame:(NSRect)frame;
- (void) reshape; - (void) reshape;
- (void) drawRect:(NSRect)r;
- (void) drawRect:(NSRect)rect;
- (void) cursorUpdate:(NSEvent*)e; - (void) cursorUpdate:(NSEvent*)e;
- (void) updateTrackingAreas; - (void) updateTrackingAreas;
- (void) viewWillMoveToWindow:(NSWindow*)newWindow; - (void) viewWillMoveToWindow:(NSWindow*)newWindow;
@@ -136,6 +135,11 @@ puglDisplay(PuglView* view)
return YES; return YES;
} }


- (BOOL) isOpaque
{
return YES;
}

- (BOOL) preservesContentInLiveResize - (BOOL) preservesContentInLiveResize
{ {
return NO; return NO;
@@ -143,7 +147,7 @@ puglDisplay(PuglView* view)


- (id) initWithFrame:(NSRect)frame - (id) initWithFrame:(NSRect)frame
{ {
puglview = nil;
puglview = nil;
trackingArea = nil; trackingArea = nil;


NSOpenGLPixelFormatAttribute pixelAttribs[16] = { NSOpenGLPixelFormatAttribute pixelAttribs[16] = {
@@ -200,14 +204,13 @@ puglDisplay(PuglView* view)
puglview->height = height; puglview->height = height;
} }


- (void) drawRect:(NSRect)r
- (void) drawRect:(NSRect)rect
{ {
puglDisplay(puglview); puglDisplay(puglview);
glFlush(); glFlush();
glSwapAPPLE(); glSwapAPPLE();


// unused
return; (void)r;
[super drawRect:rect];
} }


- (void) cursorUpdate:(NSEvent*)e - (void) cursorUpdate:(NSEvent*)e
@@ -494,6 +497,7 @@ puglDestroy(PuglView* view)
PuglStatus PuglStatus
puglProcessEvents(PuglView* view) puglProcessEvents(PuglView* view)
{ {
[view->impl->glview setNeedsDisplay:YES];
view->redisplay = false; view->redisplay = false;
return PUGL_SUCCESS; return PUGL_SUCCESS;
} }


Loading…
Cancel
Save