mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 21:14:35 +00:00
Merge branch 'master' into EGL
Conflicts: src/internal.h src/opengl.c tests/glfwinfo.c
This commit is contained in:
commit
7d222030da
@ -392,7 +392,6 @@ extern "C" {
|
|||||||
/* glfwGetWindowParam tokens */
|
/* glfwGetWindowParam tokens */
|
||||||
#define GLFW_ACTIVE 0x00020001
|
#define GLFW_ACTIVE 0x00020001
|
||||||
#define GLFW_ICONIFIED 0x00020002
|
#define GLFW_ICONIFIED 0x00020002
|
||||||
#define GLFW_ACCELERATED 0x00020003
|
|
||||||
#define GLFW_OPENGL_REVISION 0x00020004
|
#define GLFW_OPENGL_REVISION 0x00020004
|
||||||
|
|
||||||
/* The following constants are used for both glfwGetWindowParam
|
/* The following constants are used for both glfwGetWindowParam
|
||||||
|
@ -319,6 +319,7 @@ version of GLFW.</p>
|
|||||||
<li>Removed <code>GLFW_OPENED</code> window parameter</li>
|
<li>Removed <code>GLFW_OPENED</code> window parameter</li>
|
||||||
<li>Removed nonsensical key actions for Unicode character input</li>
|
<li>Removed nonsensical key actions for Unicode character input</li>
|
||||||
<li>Removed <code>GLFWCALL</code> and <code>GLFWAPIENTRY</code> macros for stdcall calling convention</li>
|
<li>Removed <code>GLFWCALL</code> and <code>GLFWAPIENTRY</code> macros for stdcall calling convention</li>
|
||||||
|
<li>Removed <code>GLFW_ACCELERATED</code> window parameter</li>
|
||||||
<li>Bugfix: The default OpenGL version in the <code>glfwinfo</code> test was set to 1.1</li>
|
<li>Bugfix: The default OpenGL version in the <code>glfwinfo</code> test was set to 1.1</li>
|
||||||
<li>Bugfix: The OpenGL profile and forward-compatibility window parameters were not saved after context creation</li>
|
<li>Bugfix: The OpenGL profile and forward-compatibility window parameters were not saved after context creation</li>
|
||||||
<li>Bugfix: The FSAA test did not check for the availability of <code>GL_ARB_multisample</code></li>
|
<li>Bugfix: The FSAA test did not check for the availability of <code>GL_ARB_multisample</code></li>
|
||||||
|
@ -1049,68 +1049,6 @@ void _glfwPlatformRestoreWindow(_GLFWwindow* window)
|
|||||||
|
|
||||||
void _glfwPlatformRefreshWindowParams(void)
|
void _glfwPlatformRefreshWindowParams(void)
|
||||||
{
|
{
|
||||||
GLint value;
|
|
||||||
_GLFWwindow* window = _glfwLibrary.currentWindow;
|
|
||||||
|
|
||||||
// Since GLFW doesn't understand screens, we use virtual screen zero
|
|
||||||
|
|
||||||
[window->NSGL.pixelFormat getValues:&value
|
|
||||||
forAttribute:NSOpenGLPFAAccelerated
|
|
||||||
forVirtualScreen:0];
|
|
||||||
window->accelerated = value;
|
|
||||||
|
|
||||||
[window->NSGL.pixelFormat getValues:&value
|
|
||||||
forAttribute:NSOpenGLPFAAlphaSize
|
|
||||||
forVirtualScreen:0];
|
|
||||||
window->alphaBits = value;
|
|
||||||
|
|
||||||
[window->NSGL.pixelFormat getValues:&value
|
|
||||||
forAttribute:NSOpenGLPFAColorSize
|
|
||||||
forVirtualScreen:0];
|
|
||||||
|
|
||||||
// It seems that the color size includes the size of the alpha channel so
|
|
||||||
// we subtract it before splitting
|
|
||||||
_glfwSplitBPP(value - window->alphaBits,
|
|
||||||
&window->redBits,
|
|
||||||
&window->greenBits,
|
|
||||||
&window->blueBits);
|
|
||||||
|
|
||||||
[window->NSGL.pixelFormat getValues:&value
|
|
||||||
forAttribute:NSOpenGLPFADepthSize
|
|
||||||
forVirtualScreen:0];
|
|
||||||
window->depthBits = value;
|
|
||||||
|
|
||||||
[window->NSGL.pixelFormat getValues:&value
|
|
||||||
forAttribute:NSOpenGLPFAStencilSize
|
|
||||||
forVirtualScreen:0];
|
|
||||||
window->stencilBits = value;
|
|
||||||
|
|
||||||
[window->NSGL.pixelFormat getValues:&value
|
|
||||||
forAttribute:NSOpenGLPFAAccumSize
|
|
||||||
forVirtualScreen:0];
|
|
||||||
|
|
||||||
_glfwSplitBPP(value,
|
|
||||||
&window->accumRedBits,
|
|
||||||
&window->accumGreenBits,
|
|
||||||
&window->accumBlueBits);
|
|
||||||
|
|
||||||
// TODO: Figure out what to set this value to
|
|
||||||
window->accumAlphaBits = 0;
|
|
||||||
|
|
||||||
[window->NSGL.pixelFormat getValues:&value
|
|
||||||
forAttribute:NSOpenGLPFAAuxBuffers
|
|
||||||
forVirtualScreen:0];
|
|
||||||
window->auxBuffers = value;
|
|
||||||
|
|
||||||
[window->NSGL.pixelFormat getValues:&value
|
|
||||||
forAttribute:NSOpenGLPFAStereo
|
|
||||||
forVirtualScreen:0];
|
|
||||||
window->stereo = value;
|
|
||||||
|
|
||||||
[window->NSGL.pixelFormat getValues:&value
|
|
||||||
forAttribute:NSOpenGLPFASamples
|
|
||||||
forVirtualScreen:0];
|
|
||||||
window->samples = value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -198,22 +198,21 @@ struct _GLFWwindow
|
|||||||
char key[GLFW_KEY_LAST + 1];
|
char key[GLFW_KEY_LAST + 1];
|
||||||
|
|
||||||
// Framebuffer attributes
|
// Framebuffer attributes
|
||||||
int redBits;
|
GLint redBits;
|
||||||
int greenBits;
|
GLint greenBits;
|
||||||
int blueBits;
|
GLint blueBits;
|
||||||
int alphaBits;
|
GLint alphaBits;
|
||||||
int depthBits;
|
GLint depthBits;
|
||||||
int stencilBits;
|
GLint stencilBits;
|
||||||
int accumRedBits;
|
GLint accumRedBits;
|
||||||
int accumGreenBits;
|
GLint accumGreenBits;
|
||||||
int accumBlueBits;
|
GLint accumBlueBits;
|
||||||
int accumAlphaBits;
|
GLint accumAlphaBits;
|
||||||
int auxBuffers;
|
GLint auxBuffers;
|
||||||
GLboolean stereo;
|
GLboolean stereo;
|
||||||
int samples;
|
GLint samples;
|
||||||
|
|
||||||
// OpenGL extensions and context attributes
|
// OpenGL extensions and context attributes
|
||||||
GLboolean accelerated; // GL_TRUE if OpenGL context is "accelerated"
|
|
||||||
int clientAPI;
|
int clientAPI;
|
||||||
int glMajor, glMinor, glRevision;
|
int glMajor, glMinor, glRevision;
|
||||||
GLboolean glForward, glDebug;
|
GLboolean glForward, glDebug;
|
||||||
@ -367,6 +366,7 @@ int _glfwStringInExtensionString(const char* string, const GLubyte* extensions);
|
|||||||
const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,
|
const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,
|
||||||
const _GLFWfbconfig* alternatives,
|
const _GLFWfbconfig* alternatives,
|
||||||
unsigned int count);
|
unsigned int count);
|
||||||
|
void _glfwRefreshContextParams(void);
|
||||||
GLboolean _glfwIsValidContextConfig(_GLFWwndconfig* wndconfig);
|
GLboolean _glfwIsValidContextConfig(_GLFWwndconfig* wndconfig);
|
||||||
GLboolean _glfwIsValidContext(_GLFWwindow* window, _GLFWwndconfig* wndconfig);
|
GLboolean _glfwIsValidContext(_GLFWwindow* window, _GLFWwndconfig* wndconfig);
|
||||||
|
|
||||||
|
60
src/opengl.c
60
src/opengl.c
@ -39,9 +39,9 @@
|
|||||||
// Parses the client API version string and extracts the version number
|
// Parses the client API version string and extracts the version number
|
||||||
//========================================================================
|
//========================================================================
|
||||||
|
|
||||||
static GLboolean parseGLVersion(int* major, int* minor, int* rev)
|
static GLboolean parseGLVersion(int* api, int* major, int* minor, int* rev)
|
||||||
{
|
{
|
||||||
int i, _major, _minor = 0, _rev = 0;
|
int i, _api = GLFW_OPENGL_API, _major, _minor = 0, _rev = 0;
|
||||||
const char* version;
|
const char* version;
|
||||||
const char* prefixes[] =
|
const char* prefixes[] =
|
||||||
{
|
{
|
||||||
@ -54,8 +54,7 @@ static GLboolean parseGLVersion(int* major, int* minor, int* rev)
|
|||||||
version = (const char*) glGetString(GL_VERSION);
|
version = (const char*) glGetString(GL_VERSION);
|
||||||
if (!version)
|
if (!version)
|
||||||
{
|
{
|
||||||
_glfwSetError(GLFW_PLATFORM_ERROR,
|
_glfwSetError(GLFW_PLATFORM_ERROR, "Failed to retrieve version string");
|
||||||
"X11/EGL: No version string available");
|
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,17 +65,18 @@ static GLboolean parseGLVersion(int* major, int* minor, int* rev)
|
|||||||
if (strncmp(version, prefixes[i], length) == 0)
|
if (strncmp(version, prefixes[i], length) == 0)
|
||||||
{
|
{
|
||||||
version += length;
|
version += length;
|
||||||
|
_api = GLFW_OPENGL_ES_API;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sscanf(version, "%d.%d.%d", &_major, &_minor, &_rev))
|
if (!sscanf(version, "%d.%d.%d", &_major, &_minor, &_rev))
|
||||||
{
|
{
|
||||||
_glfwSetError(GLFW_PLATFORM_ERROR,
|
_glfwSetError(GLFW_PLATFORM_ERROR, "No version found in version string");
|
||||||
"X11/EGL: No version found in version string");
|
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*api = _api;
|
||||||
*major = _major;
|
*major = _major;
|
||||||
*minor = _minor;
|
*minor = _minor;
|
||||||
*rev = _rev;
|
*rev = _rev;
|
||||||
@ -385,22 +385,26 @@ GLboolean _glfwIsValidContextConfig(_GLFWwndconfig* wndconfig)
|
|||||||
|
|
||||||
|
|
||||||
//========================================================================
|
//========================================================================
|
||||||
// Checks whether the specified context fulfils the requirements
|
// Reads back context properties
|
||||||
// It blames glfwOpenWindow because that's the only caller
|
|
||||||
//========================================================================
|
//========================================================================
|
||||||
|
|
||||||
GLboolean _glfwIsValidContext(_GLFWwindow* window, _GLFWwndconfig* wndconfig)
|
void _glfwRefreshContextParams(void)
|
||||||
{
|
{
|
||||||
window->clientAPI = wndconfig->clientAPI;
|
_GLFWwindow* window = _glfwLibrary.currentWindow;
|
||||||
|
|
||||||
if (!parseGLVersion(&window->glMajor, &window->glMinor, &window->glRevision))
|
if (!parseGLVersion(&window->clientAPI,
|
||||||
return GL_FALSE;
|
&window->glMajor,
|
||||||
|
&window->glMinor,
|
||||||
|
&window->glRevision))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Read back forward-compatibility flag
|
// Read back forward-compatibility flag
|
||||||
{
|
{
|
||||||
window->glForward = GL_FALSE;
|
window->glForward = GL_FALSE;
|
||||||
|
|
||||||
if (window->glMajor >= 3)
|
if (window->clientAPI == GLFW_OPENGL_API && window->glMajor >= 3)
|
||||||
{
|
{
|
||||||
GLint flags;
|
GLint flags;
|
||||||
glGetIntegerv(GL_CONTEXT_FLAGS, &flags);
|
glGetIntegerv(GL_CONTEXT_FLAGS, &flags);
|
||||||
@ -428,8 +432,36 @@ GLboolean _glfwIsValidContext(_GLFWwindow* window, _GLFWwndconfig* wndconfig)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window->glRobustness = wndconfig->glRobustness;
|
glGetIntegerv(GL_RED_BITS, &window->redBits);
|
||||||
|
glGetIntegerv(GL_GREEN_BITS, &window->greenBits);
|
||||||
|
glGetIntegerv(GL_BLUE_BITS, &window->blueBits);
|
||||||
|
|
||||||
|
glGetIntegerv(GL_ALPHA_BITS, &window->alphaBits);
|
||||||
|
glGetIntegerv(GL_DEPTH_BITS, &window->depthBits);
|
||||||
|
glGetIntegerv(GL_STENCIL_BITS, &window->stencilBits);
|
||||||
|
|
||||||
|
glGetIntegerv(GL_ACCUM_RED_BITS, &window->accumRedBits);
|
||||||
|
glGetIntegerv(GL_ACCUM_GREEN_BITS, &window->accumGreenBits);
|
||||||
|
glGetIntegerv(GL_ACCUM_BLUE_BITS, &window->accumBlueBits);
|
||||||
|
glGetIntegerv(GL_ACCUM_ALPHA_BITS, &window->accumAlphaBits);
|
||||||
|
|
||||||
|
glGetIntegerv(GL_AUX_BUFFERS, &window->auxBuffers);
|
||||||
|
glGetBooleanv(GL_STEREO, &window->stereo);
|
||||||
|
|
||||||
|
if (_glfwPlatformExtensionSupported("GL_ARB_multisample"))
|
||||||
|
glGetIntegerv(GL_SAMPLES_ARB, &window->samples);
|
||||||
|
else
|
||||||
|
window->samples = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//========================================================================
|
||||||
|
// Checks whether the specified context fulfils the requirements
|
||||||
|
// It blames glfwOpenWindow because that's the only caller
|
||||||
|
//========================================================================
|
||||||
|
|
||||||
|
GLboolean _glfwIsValidContext(_GLFWwindow* window, _GLFWwndconfig* wndconfig)
|
||||||
|
{
|
||||||
if (window->glMajor < wndconfig->glMajor ||
|
if (window->glMajor < wndconfig->glMajor ||
|
||||||
(window->glMajor == wndconfig->glMajor &&
|
(window->glMajor == wndconfig->glMajor &&
|
||||||
window->glMinor < wndconfig->glMinor))
|
window->glMinor < wndconfig->glMinor))
|
||||||
|
@ -290,94 +290,6 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//========================================================================
|
|
||||||
// Read back framebuffer parameters from the context
|
|
||||||
//========================================================================
|
|
||||||
|
|
||||||
static void refreshContextParams(_GLFWwindow* window, int pixelFormat)
|
|
||||||
{
|
|
||||||
PIXELFORMATDESCRIPTOR pfd;
|
|
||||||
|
|
||||||
if (window->WGL.ARB_pixel_format)
|
|
||||||
{
|
|
||||||
if (getPixelFormatAttrib(window, pixelFormat, WGL_ACCELERATION_ARB) !=
|
|
||||||
WGL_NO_ACCELERATION_ARB)
|
|
||||||
{
|
|
||||||
window->accelerated = GL_TRUE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
window->accelerated = GL_FALSE;
|
|
||||||
|
|
||||||
window->redBits =
|
|
||||||
getPixelFormatAttrib(window, pixelFormat, WGL_RED_BITS_ARB);
|
|
||||||
window->greenBits =
|
|
||||||
getPixelFormatAttrib(window, pixelFormat, WGL_GREEN_BITS_ARB);
|
|
||||||
window->blueBits =
|
|
||||||
getPixelFormatAttrib(window, pixelFormat, WGL_BLUE_BITS_ARB);
|
|
||||||
|
|
||||||
window->alphaBits =
|
|
||||||
getPixelFormatAttrib(window, pixelFormat, WGL_ALPHA_BITS_ARB);
|
|
||||||
window->depthBits =
|
|
||||||
getPixelFormatAttrib(window, pixelFormat, WGL_DEPTH_BITS_ARB);
|
|
||||||
window->stencilBits =
|
|
||||||
getPixelFormatAttrib(window, pixelFormat, WGL_STENCIL_BITS_ARB);
|
|
||||||
|
|
||||||
window->accumRedBits =
|
|
||||||
getPixelFormatAttrib(window, pixelFormat, WGL_ACCUM_RED_BITS_ARB);
|
|
||||||
window->accumGreenBits =
|
|
||||||
getPixelFormatAttrib(window, pixelFormat, WGL_ACCUM_GREEN_BITS_ARB);
|
|
||||||
window->accumBlueBits =
|
|
||||||
getPixelFormatAttrib(window, pixelFormat, WGL_ACCUM_BLUE_BITS_ARB);
|
|
||||||
window->accumAlphaBits =
|
|
||||||
getPixelFormatAttrib(window, pixelFormat, WGL_ACCUM_ALPHA_BITS_ARB);
|
|
||||||
|
|
||||||
window->auxBuffers =
|
|
||||||
getPixelFormatAttrib(window, pixelFormat, WGL_AUX_BUFFERS_ARB);
|
|
||||||
window->stereo =
|
|
||||||
getPixelFormatAttrib(window, pixelFormat, WGL_STEREO_ARB) ? GL_TRUE : GL_FALSE;
|
|
||||||
|
|
||||||
if (window->WGL.ARB_multisample)
|
|
||||||
{
|
|
||||||
window->samples = getPixelFormatAttrib(window, pixelFormat, WGL_SAMPLES_ARB);
|
|
||||||
|
|
||||||
// We force 1 to zero here because all the other APIs say zero when
|
|
||||||
// they really mean 1
|
|
||||||
if (window->samples == 1)
|
|
||||||
window->samples = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
window->samples = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DescribePixelFormat(window->WGL.DC, pixelFormat,
|
|
||||||
sizeof(PIXELFORMATDESCRIPTOR), &pfd);
|
|
||||||
|
|
||||||
// Is current OpenGL context accelerated?
|
|
||||||
window->accelerated = (pfd.dwFlags & PFD_GENERIC_ACCELERATED) ||
|
|
||||||
!(pfd.dwFlags & PFD_GENERIC_FORMAT) ? 1 : 0;
|
|
||||||
|
|
||||||
// "Standard" window parameters
|
|
||||||
window->redBits = pfd.cRedBits;
|
|
||||||
window->greenBits = pfd.cGreenBits;
|
|
||||||
window->blueBits = pfd.cBlueBits;
|
|
||||||
window->alphaBits = pfd.cAlphaBits;
|
|
||||||
window->depthBits = pfd.cDepthBits;
|
|
||||||
window->stencilBits = pfd.cStencilBits;
|
|
||||||
window->accumRedBits = pfd.cAccumRedBits;
|
|
||||||
window->accumGreenBits = pfd.cAccumGreenBits;
|
|
||||||
window->accumBlueBits = pfd.cAccumBlueBits;
|
|
||||||
window->accumAlphaBits = pfd.cAccumAlphaBits;
|
|
||||||
window->auxBuffers = pfd.cAuxBuffers;
|
|
||||||
window->stereo = (pfd.dwFlags & PFD_STEREO) ? GL_TRUE : GL_FALSE;
|
|
||||||
|
|
||||||
// If we don't have WGL_ARB_pixel_format then we can't have created a
|
|
||||||
// multisampling context, so it's safe to hardcode zero here
|
|
||||||
window->samples = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//========================================================================
|
//========================================================================
|
||||||
// Creates an OpenGL context on the specified device context
|
// Creates an OpenGL context on the specified device context
|
||||||
//========================================================================
|
//========================================================================
|
||||||
@ -532,7 +444,6 @@ static GLboolean createContext(_GLFWwindow* window,
|
|||||||
|
|
||||||
glfwMakeContextCurrent(window);
|
glfwMakeContextCurrent(window);
|
||||||
initWGLExtensions(window);
|
initWGLExtensions(window);
|
||||||
refreshContextParams(window, pixelFormat);
|
|
||||||
|
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -322,6 +322,7 @@ GLFWAPI GLFWwindow glfwOpenWindow(int width, int height,
|
|||||||
|
|
||||||
// Cache the actual (as opposed to desired) window parameters
|
// Cache the actual (as opposed to desired) window parameters
|
||||||
glfwMakeContextCurrent(window);
|
glfwMakeContextCurrent(window);
|
||||||
|
_glfwRefreshContextParams();
|
||||||
_glfwPlatformRefreshWindowParams();
|
_glfwPlatformRefreshWindowParams();
|
||||||
|
|
||||||
if (!_glfwIsValidContext(window, &wndconfig))
|
if (!_glfwIsValidContext(window, &wndconfig))
|
||||||
@ -687,8 +688,6 @@ GLFWAPI int glfwGetWindowParam(GLFWwindow handle, int param)
|
|||||||
return window == _glfwLibrary.activeWindow;
|
return window == _glfwLibrary.activeWindow;
|
||||||
case GLFW_ICONIFIED:
|
case GLFW_ICONIFIED:
|
||||||
return window->iconified;
|
return window->iconified;
|
||||||
case GLFW_ACCELERATED:
|
|
||||||
return window->accelerated;
|
|
||||||
case GLFW_RED_BITS:
|
case GLFW_RED_BITS:
|
||||||
return window->redBits;
|
return window->redBits;
|
||||||
case GLFW_GREEN_BITS:
|
case GLFW_GREEN_BITS:
|
||||||
|
@ -197,72 +197,6 @@ static int errorHandler(Display *display, XErrorEvent* event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//========================================================================
|
|
||||||
// Read back framebuffer parameters from the context
|
|
||||||
//========================================================================
|
|
||||||
|
|
||||||
static void refreshContextParams(_GLFWwindow* window, GLXFBConfigID fbconfigID)
|
|
||||||
{
|
|
||||||
int dummy;
|
|
||||||
GLXFBConfig* fbconfig;
|
|
||||||
|
|
||||||
int attribs[] = { GLX_FBCONFIG_ID, fbconfigID, None };
|
|
||||||
|
|
||||||
if (_glfwLibrary.GLX.SGIX_fbconfig)
|
|
||||||
{
|
|
||||||
fbconfig = _glfwLibrary.GLX.ChooseFBConfigSGIX(_glfwLibrary.X11.display,
|
|
||||||
_glfwLibrary.X11.screen,
|
|
||||||
attribs,
|
|
||||||
&dummy);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fbconfig = glXChooseFBConfig(_glfwLibrary.X11.display,
|
|
||||||
_glfwLibrary.X11.screen,
|
|
||||||
attribs,
|
|
||||||
&dummy);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fbconfig == NULL)
|
|
||||||
{
|
|
||||||
// This should never ever happen
|
|
||||||
// TODO: Flag this as an error and propagate up
|
|
||||||
_glfwSetError(GLFW_PLATFORM_ERROR, "X11/GLX: Cannot find known "
|
|
||||||
"GLXFBConfig by ID. This cannot "
|
|
||||||
"happen. Have a nice day.\n");
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
|
|
||||||
// There is no clear definition of an "accelerated" context on X11/GLX, and
|
|
||||||
// true sounds better than false, so we hardcode true here
|
|
||||||
window->accelerated = GL_TRUE;
|
|
||||||
|
|
||||||
window->redBits = getFBConfigAttrib(window, *fbconfig, GLX_RED_SIZE);
|
|
||||||
window->greenBits = getFBConfigAttrib(window, *fbconfig, GLX_GREEN_SIZE);
|
|
||||||
window->blueBits = getFBConfigAttrib(window, *fbconfig, GLX_BLUE_SIZE);
|
|
||||||
|
|
||||||
window->alphaBits = getFBConfigAttrib(window, *fbconfig, GLX_ALPHA_SIZE);
|
|
||||||
window->depthBits = getFBConfigAttrib(window, *fbconfig, GLX_DEPTH_SIZE);
|
|
||||||
window->stencilBits = getFBConfigAttrib(window, *fbconfig, GLX_STENCIL_SIZE);
|
|
||||||
|
|
||||||
window->accumRedBits = getFBConfigAttrib(window, *fbconfig, GLX_ACCUM_RED_SIZE);
|
|
||||||
window->accumGreenBits = getFBConfigAttrib(window, *fbconfig, GLX_ACCUM_GREEN_SIZE);
|
|
||||||
window->accumBlueBits = getFBConfigAttrib(window, *fbconfig, GLX_ACCUM_BLUE_SIZE);
|
|
||||||
window->accumAlphaBits = getFBConfigAttrib(window, *fbconfig, GLX_ACCUM_ALPHA_SIZE);
|
|
||||||
|
|
||||||
window->auxBuffers = getFBConfigAttrib(window, *fbconfig, GLX_AUX_BUFFERS);
|
|
||||||
window->stereo = getFBConfigAttrib(window, *fbconfig, GLX_STEREO) ? GL_TRUE : GL_FALSE;
|
|
||||||
|
|
||||||
// Get FSAA buffer sample count
|
|
||||||
if (_glfwLibrary.GLX.ARB_multisample)
|
|
||||||
window->samples = getFBConfigAttrib(window, *fbconfig, GLX_SAMPLES);
|
|
||||||
else
|
|
||||||
window->samples = 0;
|
|
||||||
|
|
||||||
XFree(fbconfig);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//========================================================================
|
//========================================================================
|
||||||
// Create the actual OpenGL context
|
// Create the actual OpenGL context
|
||||||
//========================================================================
|
//========================================================================
|
||||||
@ -472,8 +406,6 @@ static int createContext(_GLFWwindow* window,
|
|||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshContextParams(window, fbconfigID);
|
|
||||||
|
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,6 @@ typedef struct
|
|||||||
|
|
||||||
static Param parameters[] =
|
static Param parameters[] =
|
||||||
{
|
{
|
||||||
{ GLFW_ACCELERATED, "accelerated" },
|
|
||||||
{ GLFW_RED_BITS, "red bits" },
|
{ GLFW_RED_BITS, "red bits" },
|
||||||
{ GLFW_GREEN_BITS, "green bits" },
|
{ GLFW_GREEN_BITS, "green bits" },
|
||||||
{ GLFW_BLUE_BITS, "blue bits" },
|
{ GLFW_BLUE_BITS, "blue bits" },
|
||||||
|
@ -276,7 +276,7 @@ int main(int argc, char** argv)
|
|||||||
printf(" debug");
|
printf(" debug");
|
||||||
putchar('\n');
|
putchar('\n');
|
||||||
|
|
||||||
printf("%s flags parsed by GLFW:", get_client_api_name(api));
|
printf("%s context flags parsed by GLFW:", get_client_api_name(api));
|
||||||
|
|
||||||
if (glfwGetWindowParam(window, GLFW_OPENGL_FORWARD_COMPAT))
|
if (glfwGetWindowParam(window, GLFW_OPENGL_FORWARD_COMPAT))
|
||||||
printf(" forward-compatible");
|
printf(" forward-compatible");
|
||||||
@ -293,13 +293,7 @@ int main(int argc, char** argv)
|
|||||||
mask,
|
mask,
|
||||||
get_profile_name(mask));
|
get_profile_name(mask));
|
||||||
|
|
||||||
printf("%s profile parsed by GLFW:\n", get_client_api_name(api));
|
printf("%s profile mask parsed by GLFW:\n", get_client_api_name(api));
|
||||||
|
|
||||||
if (glfwGetWindowParam(window, GLFW_OPENGL_FORWARD_COMPAT))
|
|
||||||
printf(" forward-compatible");
|
|
||||||
if (glfwGetWindowParam(window, GLFW_OPENGL_DEBUG_CONTEXT))
|
|
||||||
printf(" debug");
|
|
||||||
putchar('\n');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user