Merge "opengl translator: Mac fixes for unbind context"
This commit is contained in:
@@ -156,6 +156,17 @@ bool destroyContext(EGLNativeDisplayType dpy,EGLNativeContextType ctx) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool makeCurrent(EGLNativeDisplayType dpy,EglSurface* read,EglSurface* draw,EGLNativeContextType ctx){
|
bool makeCurrent(EGLNativeDisplayType dpy,EglSurface* read,EglSurface* draw,EGLNativeContextType ctx){
|
||||||
|
|
||||||
|
// check for unbind
|
||||||
|
if (ctx == NULL && read == NULL && draw == NULL) {
|
||||||
|
nsWindowMakeCurrent(NULL, NULL);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (ctx == NULL || read == NULL || draw == NULL) {
|
||||||
|
// error !
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//dont supporting diffrent read & draw surfaces on Mac
|
//dont supporting diffrent read & draw surfaces on Mac
|
||||||
if(read->native() != draw->native()) return false;
|
if(read->native() != draw->native()) return false;
|
||||||
switch(draw->type()){
|
switch(draw->type()){
|
||||||
|
|||||||
@@ -60,12 +60,9 @@ void nsWindowMakeCurrent(void* context,void* nativeWin){
|
|||||||
NSView* win = (NSView *)nativeWin;
|
NSView* win = (NSView *)nativeWin;
|
||||||
if(ctx == nil){
|
if(ctx == nil){
|
||||||
[NSOpenGLContext clearCurrentContext];
|
[NSOpenGLContext clearCurrentContext];
|
||||||
} else {
|
} else if (win != nil) {
|
||||||
if(win != nil){
|
[ctx setView: win];
|
||||||
[ctx clearDrawable];
|
[ctx makeCurrentContext];
|
||||||
[ctx setView: win];
|
|
||||||
[ctx makeCurrentContext];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user