diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 96fcb002e..d1075d2cf 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -322,9 +322,9 @@ static int translateKey(unsigned int key) - (BOOL)isOpaque { - // Set to NO even if alphaMask is not used; + // Set to NO even if transparent is not used; // The NSView/GLFWContentView does not need to be opaque anyway, - // and to avoid keeping track of alphaMask inside the NSView we + // and to avoid keeping track of transparent inside the NSView we // just return NO here instead. return NO; } @@ -863,7 +863,7 @@ static GLFWbool createWindow(_GLFWwindow* window, [window->ns.view setWantsBestResolutionOpenGLSurface:YES]; #endif /*_GLFW_USE_RETINA*/ - if (wndconfig->alphaMask) + if (wndconfig->transparent) { [window->ns.object setOpaque:NO]; [window->ns.object setBackgroundColor:[NSColor clearColor]]; diff --git a/src/context.c b/src/context.c index cdec72062..3767c151f 100644 --- a/src/context.c +++ b/src/context.c @@ -216,7 +216,7 @@ const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired, continue; } - if (desired->alphaMask > 0 && current->alphaMask == 0) + if (desired->transparent > 0 && current->transparent == 0) { // Alpha mask is a hard constraint continue; diff --git a/src/internal.h b/src/internal.h index 92983f1de..a5b96454e 100644 --- a/src/internal.h +++ b/src/internal.h @@ -185,7 +185,7 @@ struct _GLFWwndconfig GLFWbool focused; GLFWbool autoIconify; GLFWbool floating; - GLFWbool alphaMask; + GLFWbool transparent; _GLFWmonitor* monitor; }; @@ -236,7 +236,7 @@ struct _GLFWfbconfig int samples; GLFWbool sRGB; GLFWbool doublebuffer; - int alphaMask; + int transparent; // This is defined in the context API's context.h _GLFW_PLATFORM_FBCONFIG; diff --git a/src/nsgl_context.m b/src/nsgl_context.m index 5a16766e6..afbef6cdd 100644 --- a/src/nsgl_context.m +++ b/src/nsgl_context.m @@ -215,7 +215,7 @@ GLFWbool _glfwCreateContextNSGL(_GLFWwindow* window, return GLFW_FALSE; } - if (fbconfig->alphaMask) + if (fbconfig->transparent) { GLint opaque = 0; [window->context.nsgl.object setValues:&opaque forParameter:NSOpenGLCPSurfaceOpacity]; diff --git a/src/wgl_context.c b/src/wgl_context.c index c07d58edb..9f9a04118 100644 --- a/src/wgl_context.c +++ b/src/wgl_context.c @@ -236,8 +236,8 @@ static GLFWbool choosePixelFormat(_GLFWwindow* window, u->doublebuffer = GLFW_TRUE; } - // always able to create alpha mask on win - u->alphaMask = desired->alphaMask; + // always able to create transparent windows on Windows + u->transparent = desired->transparent; u->wgl = n; usableCount++; diff --git a/src/window.c b/src/window.c index f9c1e11bf..54e407779 100644 --- a/src/window.c +++ b/src/window.c @@ -132,17 +132,17 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, return NULL; } - fbconfig = _glfw.hints.framebuffer; - ctxconfig = _glfw.hints.context; - wndconfig = _glfw.hints.window; - fbconfig.alphaMask = _glfw.hints.framebuffer.alphaMask ? GLFW_TRUE : GLFW_FALSE; + fbconfig = _glfw.hints.framebuffer; + ctxconfig = _glfw.hints.context; + wndconfig = _glfw.hints.window; + fbconfig.transparent = _glfw.hints.framebuffer.transparent ? GLFW_TRUE : GLFW_FALSE; - wndconfig.width = width; - wndconfig.height = height; - wndconfig.title = title; - wndconfig.monitor = (_GLFWmonitor*) monitor; - ctxconfig.share = (_GLFWwindow*) share; - wndconfig.alphaMask = _glfw.hints.framebuffer.alphaMask ? GLFW_TRUE : GLFW_FALSE; + wndconfig.width = width; + wndconfig.height = height; + wndconfig.title = title; + wndconfig.monitor = (_GLFWmonitor*) monitor; + ctxconfig.share = (_GLFWwindow*) share; + wndconfig.transparent = _glfw.hints.framebuffer.transparent ? GLFW_TRUE : GLFW_FALSE; if (ctxconfig.share) { @@ -179,7 +179,7 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, window->decorated = wndconfig.decorated; window->autoIconify = wndconfig.autoIconify; window->floating = wndconfig.floating; - window->transparent = wndconfig.alphaMask; + window->transparent = wndconfig.transparent; window->cursorMode = GLFW_CURSOR_NORMAL; // Save the currently current context so it can be restored later @@ -268,7 +268,7 @@ void glfwDefaultWindowHints(void) _glfw.hints.framebuffer.depthBits = 24; _glfw.hints.framebuffer.stencilBits = 8; _glfw.hints.framebuffer.doublebuffer = GLFW_TRUE; - _glfw.hints.framebuffer.alphaMask = GLFW_FALSE; + _glfw.hints.framebuffer.transparent = GLFW_FALSE; // The default is to select the highest available refresh rate _glfw.hints.refreshRate = GLFW_DONT_CARE; @@ -320,7 +320,7 @@ GLFWAPI void glfwWindowHint(int target, int hint) _glfw.hints.framebuffer.doublebuffer = hint ? GLFW_TRUE : GLFW_FALSE; break; case GLFW_TRANSPARENT: - _glfw.hints.framebuffer.alphaMask = hint; + _glfw.hints.framebuffer.transparent = hint; break; case GLFW_SAMPLES: _glfw.hints.framebuffer.samples = hint;