gui opengl

Started by
12 comments, last by djsteffey 16 years, 2 months ago
please someone answer my query??
i have been trying for about a week to know this about how to draw buttons on a opengl window(if possible)...
thanks


Advertisement
Ok heres an answer for you some pepole are saying to just use the standard win32 controls in your application now to create them you would use the function CreateWindow or CreateWindowEx... just look it up on msdn.com and search google For c++ Win32 tutorials and im sure you will find out how to create a button in no time.

Now as for the Win32 control drawing to the application this however raises the question of wether or not the win32 api is compatable with the OpenGL device context for drawin i myself am not to sure if its not then you would have to go and use a GUI lib or do the GUI yourself if you have not been programing for too long or do not have a good grasp of class's i recommend you just use the library until you are comfterable with inheritance of class's and the other nine yards.

my recommendation is if you want to do just standard controls in win32 just like "Ms Paint" try to create a win32 controls " Google for FunctionX that may help" and just make a OpenGL window and create a control its not that hard to make one and you will soon find out if the two apis are nicly compatable if not then Try a GUI library. On the other if you have really simple controls that do not require much more then a click on it like sya a button you could just fake it by drawing a texture on a plane in your screen and seeing if the window has been left clicked on while within the Pixels Region of that Plane.

Anyways Try doing the win32 control first then go to a GUI lib if it draws funny or just don't work out well

Regards Jouei.
Ahh it looks like I was very mistaken, I was using some faulty assumptions. If other OpenGL guys say it's okay to use Win32 controls, then please listen to them (they probably have much more experience with GL than I do!). I hope I haven't wasted too much of your time by setting you on the wrong path.
where exactly do you want the buttons to be? in the middle of the rendering area? off to the side?

in map editors and the like i have made before i generally make 1 big dialog and place my button controls and stuff on it out of the rendering area, then i put another control (doesnt really matter what it is) and place it where i want to render and make it the size i want to render. then in the code, you can get a HWND and DC and such of that control and render to the control.

this way you can put all your buttons, list box, etc... on this dialog and also be rendering to an area of this dialog.

now if you want to actually draw buttons into the rendering area...well that is a different story but can still be done with opengl

This topic is closed to new replies.

Advertisement