mirror of
https://github.com/glfw/glfw.git
synced 2025-10-05 06:06:36 +00:00
Renaming alphaMask flag to 'transparent' for consistency
This commit is contained in:
parent
98563d8d4b
commit
1d44ad152e
@ -182,12 +182,6 @@ const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (desired->alphaMask > 0 && current->alphaMask == 0)
|
|
||||||
{
|
|
||||||
// Alpha mask is a hard constraint
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Count number of missing buffers
|
// Count number of missing buffers
|
||||||
{
|
{
|
||||||
missing = 0;
|
missing = 0;
|
||||||
|
@ -492,7 +492,7 @@ GLFWbool _glfwCreateContextEGL(_GLFWwindow* window,
|
|||||||
if (ctxconfig->share)
|
if (ctxconfig->share)
|
||||||
share = ctxconfig->share->context.egl.handle;
|
share = ctxconfig->share->context.egl.handle;
|
||||||
|
|
||||||
if (!chooseEGLConfig(ctxconfig, fbconfig, &config, fbconfig->alphaMask))
|
if (!chooseEGLConfig(ctxconfig, fbconfig, &config, fbconfig->transparent))
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_FORMAT_UNAVAILABLE,
|
_glfwInputError(GLFW_FORMAT_UNAVAILABLE,
|
||||||
"EGL: Failed to find a suitable EGLConfig");
|
"EGL: Failed to find a suitable EGLConfig");
|
||||||
@ -738,7 +738,7 @@ GLFWbool _glfwChooseVisualEGL(const _GLFWwndconfig* wndconfig,
|
|||||||
const long vimask = VisualScreenMask | VisualIDMask;
|
const long vimask = VisualScreenMask | VisualIDMask;
|
||||||
|
|
||||||
|
|
||||||
if (!chooseEGLConfig(ctxconfig, fbconfig, &native, wndconfig->alphaMask))
|
if (!chooseEGLConfig(ctxconfig, fbconfig, &native, wndconfig->transparent))
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_FORMAT_UNAVAILABLE,
|
_glfwInputError(GLFW_FORMAT_UNAVAILABLE,
|
||||||
"EGL: Failed to find a suitable EGLConfig");
|
"EGL: Failed to find a suitable EGLConfig");
|
||||||
|
@ -64,6 +64,8 @@ static GLFWbool chooseGLXFBConfig(
|
|||||||
findTransparent = GLFW_FALSE;
|
findTransparent = GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
findTransparent = GLFW_TRUE;
|
||||||
|
|
||||||
// HACK: This is a (hopefully temporary) workaround for Chromium
|
// HACK: This is a (hopefully temporary) workaround for Chromium
|
||||||
// (VirtualBox GL) not setting the window bit on any GLXFBConfigs
|
// (VirtualBox GL) not setting the window bit on any GLXFBConfigs
|
||||||
vendor = glXGetClientString(_glfw.x11.display, GLX_VENDOR);
|
vendor = glXGetClientString(_glfw.x11.display, GLX_VENDOR);
|
||||||
@ -104,19 +106,25 @@ selectionloop:
|
|||||||
XRenderPictFormat *pictFormat;
|
XRenderPictFormat *pictFormat;
|
||||||
|
|
||||||
visualinfo = glXGetVisualFromFBConfig(_glfw.x11.display, n);
|
visualinfo = glXGetVisualFromFBConfig(_glfw.x11.display, n);
|
||||||
if (!visualinfo)
|
if (!visualinfo) {
|
||||||
|
printf("!visualinfo: bail\n");
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
pictFormat = XRenderFindVisualFormat(_glfw.x11.display, visualinfo->visual);
|
pictFormat = XRenderFindVisualFormat(_glfw.x11.display, visualinfo->visual);
|
||||||
if( !pictFormat ) {
|
if( !pictFormat ) {
|
||||||
|
printf("!pictFormat: bail\n");
|
||||||
XFree( visualinfo );
|
XFree( visualinfo );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !pictFormat->direct.alphaMask ) {
|
if( !pictFormat->direct.alphaMask ) {
|
||||||
|
printf("!pictFormat->direct alphaMask: bail\n");
|
||||||
XFree( visualinfo );
|
XFree( visualinfo );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf("looking for transparent visual: didn't find\n");
|
||||||
XFree( visualinfo );
|
XFree( visualinfo );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -722,4 +730,3 @@ GLFWAPI GLXWindow glfwGetGLXWindow(GLFWwindow* handle)
|
|||||||
|
|
||||||
return window->context.glx.window;
|
return window->context.glx.window;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -305,7 +305,6 @@ struct _GLFWwndconfig
|
|||||||
GLFWbool floating;
|
GLFWbool floating;
|
||||||
GLFWbool maximized;
|
GLFWbool maximized;
|
||||||
GLFWbool centerCursor;
|
GLFWbool centerCursor;
|
||||||
GLFWbool alphaMask;
|
|
||||||
struct {
|
struct {
|
||||||
GLFWbool retina;
|
GLFWbool retina;
|
||||||
GLFWbool frame;
|
GLFWbool frame;
|
||||||
@ -349,7 +348,7 @@ struct _GLFWfbconfig
|
|||||||
int redBits;
|
int redBits;
|
||||||
int greenBits;
|
int greenBits;
|
||||||
int blueBits;
|
int blueBits;
|
||||||
int alphaMask;
|
int transparent;
|
||||||
int alphaBits;
|
int alphaBits;
|
||||||
int depthBits;
|
int depthBits;
|
||||||
int stencilBits;
|
int stencilBits;
|
||||||
|
@ -213,8 +213,10 @@ static int choosePixelFormat(_GLFWwindow* window,
|
|||||||
}
|
}
|
||||||
|
|
||||||
u->handle = n;
|
u->handle = n;
|
||||||
// always able to create alpha mask on win
|
|
||||||
u->alphaMask = 1;
|
// always able to go transparent on win dwmapi
|
||||||
|
u->transparent = 1;
|
||||||
|
|
||||||
usableCount++;
|
usableCount++;
|
||||||
}
|
}
|
||||||
// Reiterate the selection loop without looking for transparency supporting
|
// Reiterate the selection loop without looking for transparency supporting
|
||||||
|
@ -147,13 +147,13 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
|
|||||||
fbconfig = _glfw.hints.framebuffer;
|
fbconfig = _glfw.hints.framebuffer;
|
||||||
ctxconfig = _glfw.hints.context;
|
ctxconfig = _glfw.hints.context;
|
||||||
wndconfig = _glfw.hints.window;
|
wndconfig = _glfw.hints.window;
|
||||||
fbconfig.alphaMask = _glfw.hints.framebuffer.alphaMask ? GLFW_TRUE : GLFW_FALSE;
|
fbconfig.transparent = _glfw.hints.framebuffer.transparent ? GLFW_TRUE : GLFW_FALSE;
|
||||||
|
|
||||||
wndconfig.width = width;
|
wndconfig.width = width;
|
||||||
wndconfig.height = height;
|
wndconfig.height = height;
|
||||||
wndconfig.title = title;
|
wndconfig.title = title;
|
||||||
ctxconfig.share = (_GLFWwindow*) share;
|
ctxconfig.share = (_GLFWwindow*) share;
|
||||||
wndconfig.alphaMask = _glfw.hints.framebuffer.alphaMask ? GLFW_TRUE : GLFW_FALSE;
|
wndconfig.transparent = _glfw.hints.framebuffer.transparent ? GLFW_TRUE : GLFW_FALSE;
|
||||||
|
|
||||||
if (ctxconfig.share)
|
if (ctxconfig.share)
|
||||||
{
|
{
|
||||||
@ -185,7 +185,6 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
|
|||||||
window->transparent = wndconfig.transparent;
|
window->transparent = wndconfig.transparent;
|
||||||
window->autoIconify = wndconfig.autoIconify;
|
window->autoIconify = wndconfig.autoIconify;
|
||||||
window->floating = wndconfig.floating;
|
window->floating = wndconfig.floating;
|
||||||
window->transparent = wndconfig.alphaMask;
|
|
||||||
window->cursorMode = GLFW_CURSOR_NORMAL;
|
window->cursorMode = GLFW_CURSOR_NORMAL;
|
||||||
|
|
||||||
window->minwidth = GLFW_DONT_CARE;
|
window->minwidth = GLFW_DONT_CARE;
|
||||||
@ -267,7 +266,7 @@ void glfwDefaultWindowHints(void)
|
|||||||
_glfw.hints.framebuffer.depthBits = 24;
|
_glfw.hints.framebuffer.depthBits = 24;
|
||||||
_glfw.hints.framebuffer.stencilBits = 8;
|
_glfw.hints.framebuffer.stencilBits = 8;
|
||||||
_glfw.hints.framebuffer.doublebuffer = GLFW_TRUE;
|
_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
|
// The default is to select the highest available refresh rate
|
||||||
_glfw.hints.refreshRate = GLFW_DONT_CARE;
|
_glfw.hints.refreshRate = GLFW_DONT_CARE;
|
||||||
@ -322,7 +321,7 @@ GLFWAPI void glfwWindowHint(int hint, int value)
|
|||||||
_glfw.hints.framebuffer.doublebuffer = value ? GLFW_TRUE : GLFW_FALSE;
|
_glfw.hints.framebuffer.doublebuffer = value ? GLFW_TRUE : GLFW_FALSE;
|
||||||
return;
|
return;
|
||||||
case GLFW_TRANSPARENT:
|
case GLFW_TRANSPARENT:
|
||||||
_glfw.hints.framebuffer.alphaMask = value;
|
_glfw.hints.framebuffer.transparent = value;
|
||||||
return;
|
return;
|
||||||
case GLFW_SAMPLES:
|
case GLFW_SAMPLES:
|
||||||
_glfw.hints.framebuffer.samples = value;
|
_glfw.hints.framebuffer.samples = value;
|
||||||
|
Loading…
Reference in New Issue
Block a user