mirror of
https://github.com/glfw/glfw.git
synced 2025-10-04 21:56:36 +00:00
Merge 98557d0f89
into e6cc3c4752
This commit is contained in:
commit
9e2d6de3a6
@ -623,6 +623,7 @@ extern "C" {
|
|||||||
#define GLFW_OPENGL_DEBUG_CONTEXT 0x00022007
|
#define GLFW_OPENGL_DEBUG_CONTEXT 0x00022007
|
||||||
#define GLFW_OPENGL_PROFILE 0x00022008
|
#define GLFW_OPENGL_PROFILE 0x00022008
|
||||||
#define GLFW_CONTEXT_RELEASE_BEHAVIOR 0x00022009
|
#define GLFW_CONTEXT_RELEASE_BEHAVIOR 0x00022009
|
||||||
|
#define GLFW_REUSE_CONTEXT 0x0002200A
|
||||||
|
|
||||||
#define GLFW_OPENGL_API 0x00030001
|
#define GLFW_OPENGL_API 0x00030001
|
||||||
#define GLFW_OPENGL_ES_API 0x00030002
|
#define GLFW_OPENGL_ES_API 0x00030002
|
||||||
|
@ -189,6 +189,7 @@ struct _GLFWctxconfig
|
|||||||
int robustness;
|
int robustness;
|
||||||
int release;
|
int release;
|
||||||
_GLFWwindow* share;
|
_GLFWwindow* share;
|
||||||
|
int reuseContext;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -353,6 +354,7 @@ struct _GLFWlibrary
|
|||||||
int profile;
|
int profile;
|
||||||
int robustness;
|
int robustness;
|
||||||
int release;
|
int release;
|
||||||
|
int reuseContext;
|
||||||
} hints;
|
} hints;
|
||||||
|
|
||||||
double cursorPosX, cursorPosY;
|
double cursorPosX, cursorPosY;
|
||||||
|
@ -338,7 +338,11 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window->wgl.ARB_create_context)
|
if (share && ctxconfig->reuseContext)
|
||||||
|
{
|
||||||
|
window->wgl.context = share;
|
||||||
|
}
|
||||||
|
else if (window->wgl.ARB_create_context)
|
||||||
{
|
{
|
||||||
int index = 0, mask = 0, flags = 0;
|
int index = 0, mask = 0, flags = 0;
|
||||||
|
|
||||||
|
@ -171,6 +171,7 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
|
|||||||
ctxconfig.robustness = _glfw.hints.robustness;
|
ctxconfig.robustness = _glfw.hints.robustness;
|
||||||
ctxconfig.release = _glfw.hints.release;
|
ctxconfig.release = _glfw.hints.release;
|
||||||
ctxconfig.share = (_GLFWwindow*) share;
|
ctxconfig.share = (_GLFWwindow*) share;
|
||||||
|
ctxconfig.reuseContext = _glfw.hints.reuseContext;
|
||||||
|
|
||||||
// Check the OpenGL bits of the window config
|
// Check the OpenGL bits of the window config
|
||||||
if (!_glfwIsValidContextConfig(&ctxconfig))
|
if (!_glfwIsValidContextConfig(&ctxconfig))
|
||||||
@ -295,6 +296,7 @@ void glfwDefaultWindowHints(void)
|
|||||||
_glfw.hints.depthBits = 24;
|
_glfw.hints.depthBits = 24;
|
||||||
_glfw.hints.stencilBits = 8;
|
_glfw.hints.stencilBits = 8;
|
||||||
_glfw.hints.doublebuffer = GL_TRUE;
|
_glfw.hints.doublebuffer = GL_TRUE;
|
||||||
|
_glfw.hints.reuseContext = GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLFWAPI void glfwWindowHint(int target, int hint)
|
GLFWAPI void glfwWindowHint(int target, int hint)
|
||||||
@ -393,6 +395,8 @@ GLFWAPI void glfwWindowHint(int target, int hint)
|
|||||||
case GLFW_CONTEXT_RELEASE_BEHAVIOR:
|
case GLFW_CONTEXT_RELEASE_BEHAVIOR:
|
||||||
_glfw.hints.release = hint;
|
_glfw.hints.release = hint;
|
||||||
break;
|
break;
|
||||||
|
case GLFW_REUSE_CONTEXT:
|
||||||
|
_glfw.hints.reuseContext = hint;
|
||||||
default:
|
default:
|
||||||
_glfwInputError(GLFW_INVALID_ENUM, "Invalid window hint");
|
_glfwInputError(GLFW_INVALID_ENUM, "Invalid window hint");
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user