comparison dwt/opengl/GLCanvas.d @ 135:04928add86e6

Fixed crash in opengl snippet
author Jacob Carlborg <doob@me.com>
date Sun, 24 May 2009 22:24:42 +0200
parents 580596d83ac4
children
comparison
equal deleted inserted replaced
134:623ff6db5f1d 135:04928add86e6
129 } 129 }
130 glView.initWithFrame(parent.view.bounds(), pixelFormat); 130 glView.initWithFrame(parent.view.bounds(), pixelFormat);
131 glView.setAutoresizingMask(OS.NSViewWidthSizable | OS.NSViewHeightSizable); 131 glView.setAutoresizingMask(OS.NSViewWidthSizable | OS.NSViewHeightSizable);
132 parent.view.addSubview(glView); 132 parent.view.addSubview(glView);
133 133
134 Listener listener = new class () Listener { 134 Listener listener = new class (glView, pixelFormat) Listener {
135 NSOpenGLView glView;
136 NSOpenGLPixelFormat pixelFormat;
137
138 this (NSOpenGLView glView, NSOpenGLPixelFormat pixelFormat)
139 {
140 this.glView = glView;
141 this.pixelFormat = pixelFormat;
142 }
143
135 public void handleEvent (Event event) { 144 public void handleEvent (Event event) {
136 switch (event.type) { 145 switch (event.type) {
137 case DWT.Dispose: 146 case DWT.Dispose:
138 if (glView !is null) { 147 if (glView !is null) {
139 glView.clearGLContext(); 148 glView.clearGLContext();