Sephiroth
11-27-2007, 07:15 PM
I'm working on an OpenGL library that will allow a user to create a primary OpenGL window and then create child windows inside that window for use in games and such, but I am not sure whatt he best method to go about this is. I wanted some advice on the topic because I may want to port this project from Win32/Win64 to Linux/X eventually and would prefer to stay away from subclassing Windows forms. If I have to subclass the Windows forms and simply check for which OS the library is compiling on, so be it, but I would prefer not to go down this road.
I was thinking about creating a class (all of this is being done in C++) for child windows that would specify location, width, height, text, image, etc and just pass mouse-clicks to the library and let it decide what button the clicks are within and handling them, but this may not be the fastest way. However, this method would also bring forth another problem or possible solution depending on how you look at it. There would be no messages passed through Windows/Linux when a button is pressed since the library is handling it. This would allow the library to send private messages to the main module and such, and allow the main module to process them.
So, ideas or suggestions?
I was thinking about creating a class (all of this is being done in C++) for child windows that would specify location, width, height, text, image, etc and just pass mouse-clicks to the library and let it decide what button the clicks are within and handling them, but this may not be the fastest way. However, this method would also bring forth another problem or possible solution depending on how you look at it. There would be no messages passed through Windows/Linux when a button is pressed since the library is handling it. This would allow the library to send private messages to the main module and such, and allow the main module to process them.
So, ideas or suggestions?