modules/graphics/src/main/native-glass/mac/GlassOffscreen.m

Print this page

        

@@ -41,10 +41,11 @@
 @end
 
 @implementation GlassOffscreen
 
 - (id)initWithContext:(CGLContextObj)ctx
+            andIsSwPipe:(BOOL)isSwPipe;
 {
     self = [super init];
     if (self != nil)
     {
         self->_ctx = CGLRetainContext(ctx);

@@ -60,10 +61,11 @@
             if (self->_offscreen == nil)
             {
                 // TODO: implement PBuffer if needed
                 //self->_offscreen = [[GlassPBuffer alloc] init];
             }
+            [(GlassFrameBufferObject*)self->_offscreen setIsSwPipe:(BOOL)isSwPipe];
         }
         [self unsetContext];
     }
     return self;
 }

@@ -137,10 +139,16 @@
 
 - (void)bindForWidth:(GLuint)width andHeight:(GLuint)height
 {
     [self setContext];
     [self->_offscreen bindForWidth:width andHeight:height];
+}
+
+- (void)unbind
+{
+    assert(CGLGetCurrentContext() == self->_ctx);
+    [self->_offscreen unbind];
     [self unsetContext];
 }
 
 - (void)blit
 {