Closed welch closed 4 years ago
looking at issue #39, and recalling i am on a mac, this seemed promising: winid = glfw._glfw.glfwGetCocoaWindow(window)
but now I'm told I need a NSView*, which I would get like this in obj-c:
NSWindow* win = (NSWindow*)glfwGetCocoaWindow(glfwWindow);
NSView* view = [win contentView];
return view;
likely I've left the scope of this package, I'll leave this up anyway.
The code you mentioned was for the NSWindow*
or the NSView*
. If you actually need the GLFWwindow*
it's much simpler. When you create a GLFW window with this package using glfw.create_window(...)
, what you get in return is the GLFWwindow*
as a ctypes Pointer to a dummy _GLFWwindow struct. You can use ctypes.cast
to cast this pointer to any other pointer type you want, depending on the package that you want to pass it to.
Feels like I'm missing something obvious here, but how do I get the pointer value that I'd pass to some other library wanting a GLFWwindow*?