{"action":"opened","issue":{"url":"https://api.github.com/repos/LWJGL/lwjgl3/issues/125","labels_url":"https://api.github.com/repos/LWJGL/lwjgl3/issues/125/labels{/name}","comments_url":"https://api.github.com/repos/LWJGL/lwjgl3/issues/125/comments","events_url":"https://api.github.com/repos/LWJGL/lwjgl3/issues/125/events","html_url":"https://github.com/LWJGL/lwjgl3/issues/125","id":125374495,"number":125,"title":"Callback with JNIEnv and binding for JAWT","user":{"login":"httpdigest","id":7488613,"avatar_url":"https://avatars.githubusercontent.com/u/7488613?v=3","gravatar_id":"","url":"https://api.github.com/users/httpdigest","html_url":"https://github.com/httpdigest","followers_url":"https://api.github.com/users/httpdigest/followers","following_url":"https://api.github.com/users/httpdigest/following{/other_user}","gists_url":"https://api.github.com/users/httpdigest/gists{/gist_id}","starred_url":"https://api.github.com/users/httpdigest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/httpdigest/subscriptions","organizations_url":"https://api.github.com/users/httpdigest/orgs","repos_url":"https://api.github.com/users/httpdigest/repos","events_url":"https://api.github.com/users/httpdigest/events{/privacy}","received_events_url":"https://api.github.com/users/httpdigest/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-07T11:16:29Z","updated_at":"2016-01-07T11:16:29Z","closed_at":null,"body":"It seems like AWT/Swing is still a very popular solution for doing GUI programming in Java.\r\nAs such, the need for a LWJGL 3/AWT/Swing integration often arises.\r\nTherefore, I'd like to revive LWJGL 2's AWTGLCanvas.\r\nThe only really headache is to get a hold of the platform-specific window handles of the AWT Canvas object.\r\nIt seems that JAWT is still a good solution for it. There are probably other solutions involving only reflection against fields of sun-specific AWT implementation classes (like mentioned by this stackoverflow entry: http://stackoverflow.com/questions/386792/in-java-swing-how-do-you-get-a-win32-window-handle-hwnd-reference-to-a-window).\r\nBut if JAWT is going to be used, I'd like to avoid writing native code.\r\nFor that, we would need some way to feedback the JNIEnv argument of a JNI function back to Java code by some means of a callback.\r\nThis is because I would like to access JAWT with only the platform/struct API exposed by LWJGL 3 with Java. But JAWT needs to be initialized and used through the JNIEnv object.\r\nAnd in the future it may be useful for other JNI programming in pure Java/LWJGL 3, too, to be able to access the JNIEnv struct.\r\n\r\nCould there be a way to callback into Java code with the address of the JNIEnv structure? I know that the JNIEnv argument cannot be cached between different JNI functions, so it must be a callback solution working in the same call stack.\r\n\r\nAlso, it would be good to have struct bindings for the JAWT core structs, such as JAWT_Win32DrawingSurfaceInfo (and equivalent)."}}