GLFW Input Problems
Hi, I've been trying to do input with GLFW. The problem is, glfwGetKey() (and other input functions) will get called only if I create a window using glfwOpenWindow(), but I don't want that (I need more control). glfwOpenWindow() sets its own Windows Procedure and my function sets its own, hence none of the input functions will work (won't get called). I wonder if it is possible to solve this? Can I use my own function to create a window and still be able to use GLFW input functions?
In short, no, and I wonder why you would even want to. The whole purpose of GLFW is to simplify the construction of the window and input handling for multiple platforms--with the emphasis on the window. Most such frameworks require control of the window because they attach their own code to the management and handling of the window, and 99.99% of all applications using the framework are going to go through the framework's window creation routine, so there is little point in coding extra functionality to enable the user to create a window and pass it in--especially given the complications of enabling such a system for different platforms (Windows, Linux, etc...)
If you don't want GLFW to control your window, use a different toolkit for input handling.
If you don't want GLFW to control your window, use a different toolkit for input handling.
What VertexNormal said is true, but if you're serious about
then I suggest copying and pasting. GLFW has a very agreeable license in that regard as opposed to SDL.
I am curious as to what exactly it is that you need more control over. Are you trying to create two rendering contexts?
I had a similar problem where I was creating a simple input tester, so I just called glfwOpenWindow() with all zeros, creating a default window.
Quote:
Original post by Wingman
I wonder if it is possible to solve this? Can I use my own function to create a window and still be able to use GLFW input functions?
then I suggest copying and pasting. GLFW has a very agreeable license in that regard as opposed to SDL.
I am curious as to what exactly it is that you need more control over. Are you trying to create two rendering contexts?
I had a similar problem where I was creating a simple input tester, so I just called glfwOpenWindow() with all zeros, creating a default window.
Thanks to both of you.
About more control: I create my icons/cursor from a resource and I log some things - I can survive without logging, but I really want to use my own cursor/icons (although I believe there are other ways besides setting them in Window Class) and as far as I know, you can't do that with GLFW.
I'll try some things, will post more later.
About more control: I create my icons/cursor from a resource and I log some things - I can survive without logging, but I really want to use my own cursor/icons (although I believe there are other ways besides setting them in Window Class) and as far as I know, you can't do that with GLFW.
I'll try some things, will post more later.
I just use glfwOpenWindow() now and it works.
RolandofGilead, I tried your suggestion (calling glfwOpenWindow() with all zeros), but didn't work.
So, is there any (fast) alternative way to set a custom icon/cursor to a GLFW app?
RolandofGilead, I tried your suggestion (calling glfwOpenWindow() with all zeros), but didn't work.
So, is there any (fast) alternative way to set a custom icon/cursor to a GLFW app?
Whoops, my bad, the last parameter to glfwOpenWindow() was GLFW_WINDOW in my function.
I don't really know anything about icons and cursors though, sorry. I know you can include them as resources directly into the executable on Windows, but that's about it. It also appears that GLFW doesn't have that functionality, but SDL does and I find its source has been easy enough to read and learn from.
I don't really know anything about icons and cursors though, sorry. I know you can include them as resources directly into the executable on Windows, but that's about it. It also appears that GLFW doesn't have that functionality, but SDL does and I find its source has been easy enough to read and learn from.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement