* commit '3aca01d3b03bdb2e312ff302d04eb36034f09384': 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){
|
||||
|
||||
// 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
|
||||
if(read->native() != draw->native()) return false;
|
||||
switch(draw->type()){
|
||||
|
||||
@@ -60,13 +60,10 @@ void nsWindowMakeCurrent(void* context,void* nativeWin){
|
||||
NSView* win = (NSView *)nativeWin;
|
||||
if(ctx == nil){
|
||||
[NSOpenGLContext clearCurrentContext];
|
||||
} else {
|
||||
if(win != nil){
|
||||
[ctx clearDrawable];
|
||||
} else if (win != nil) {
|
||||
[ctx setView: win];
|
||||
[ctx makeCurrentContext];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void nsSwapBuffers(){
|
||||
|
||||
Reference in New Issue
Block a user