mirror of
https://github.com/glfw/glfw.git
synced 2025-06-16 20:47:43 +00:00
Parent window
Added `parent` feature to cocoa and X11. Its need to be tested and I actually dont know how to do it with X11.
This commit is contained in:
parent
ef463151b1
commit
8069d56c8c
@ -844,7 +844,8 @@ static GLboolean initializeAppKit(void)
|
||||
// Create the Cocoa window
|
||||
//
|
||||
static GLboolean createWindow(_GLFWwindow* window,
|
||||
const _GLFWwndconfig* wndconfig)
|
||||
const _GLFWwndconfig* wndconfig,
|
||||
_GLFWwindow* parent)
|
||||
{
|
||||
unsigned int styleMask = 0;
|
||||
|
||||
@ -904,7 +905,8 @@ static GLboolean createWindow(_GLFWwindow* window,
|
||||
|
||||
int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
||||
const _GLFWwndconfig* wndconfig,
|
||||
const _GLFWfbconfig* fbconfig)
|
||||
const _GLFWfbconfig* fbconfig,
|
||||
_GLFWwindow* parent)
|
||||
{
|
||||
if (!initializeAppKit())
|
||||
return GL_FALSE;
|
||||
@ -938,7 +940,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
||||
if (!createWindow(window, wndconfig))
|
||||
return GL_FALSE;
|
||||
|
||||
if (!_glfwCreateContext(window, wndconfig, fbconfig))
|
||||
if (!_glfwCreateContext(window, wndconfig, fbconfig, parent))
|
||||
return GL_FALSE;
|
||||
|
||||
[window->nsgl.context setView:window->ns.view];
|
||||
|
@ -100,7 +100,8 @@ static int translateChar(XKeyEvent* event)
|
||||
// Create the X11 window (and its colormap)
|
||||
//
|
||||
static GLboolean createWindow(_GLFWwindow* window,
|
||||
const _GLFWwndconfig* wndconfig)
|
||||
const _GLFWwndconfig* wndconfig,
|
||||
_GLFWwindow* parent )
|
||||
{
|
||||
unsigned long wamask;
|
||||
XSetWindowAttributes wa;
|
||||
@ -139,7 +140,7 @@ static GLboolean createWindow(_GLFWwindow* window,
|
||||
_glfwGrabXErrorHandler();
|
||||
|
||||
window->x11.handle = XCreateWindow(_glfw.x11.display,
|
||||
_glfw.x11.root,
|
||||
parent ? parent->x11.handle , _glfw.x11.root,
|
||||
0, 0,
|
||||
wndconfig->width, wndconfig->height,
|
||||
0, // Border width
|
||||
@ -936,12 +937,13 @@ unsigned long _glfwGetWindowProperty(Window window,
|
||||
|
||||
int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
||||
const _GLFWwndconfig* wndconfig,
|
||||
const _GLFWfbconfig* fbconfig)
|
||||
const _GLFWfbconfig* fbconfig,
|
||||
_GLFWwindow* parent )
|
||||
{
|
||||
if (!_glfwCreateContext(window, wndconfig, fbconfig))
|
||||
return GL_FALSE;
|
||||
|
||||
if (!createWindow(window, wndconfig))
|
||||
if (!createWindow(window, wndconfig, parent))
|
||||
return GL_FALSE;
|
||||
|
||||
if (wndconfig->monitor)
|
||||
|
Loading…
Reference in New Issue
Block a user