How to make interfaces in OpenGL

Hi!
I’d like to ask how to make interface (buttons, etc) using OpenGL.
Is there anything needed to do this except for the glut files and Micr.Visual C++?

Thanks a lot!

You can use the Win32 library, check the MSDN to learn more

You’ll get MUCH more pleasure if you’ll try to make interface elements by your own. If you are using glut or something like that you’ve got all you need to do that: graphics (OpenGL) and input from mouse & keyboard (glut/glfw/whatever).
Standart approach is next: you create an object “container” (or “manager”, or “scene”) whitch contains links to all the interface elements on the screen (whitch are also objects, derived from “generic interface element”, with only method “handle event/message”). If event (kb or mouse input or, for example event “render yourself” whitch orders elements to redraw) hapends container sends a message to all the elements (calls “handle event” method).
Example: buttons logic is next:

switch(event_type)
{
case render_yourself:
	glBegin(<whatever>);
	<render a button>
	glEnd();
	break;
case mouse_over:
	<highlight this button>
	<by changing it's texture>
	<or increasing size>
	break;
case mouse_out:
	<back to normal state>
	break;
case question_does_this_point_belong_to_you:
	return <true, if point (x, y)>
		<belongs to the button>
		<false otherwise>
	break;
default:
	return <don't want to handle,>
		<whatever you've sent me>
}
return <handeled fine>;

NOTE: there is an event/message called “does this point belong to you” (with coordinates x, y added to the message) - this message (or question, actually) is used mostly to determinate if mouse poiter is over the element or not; if it is then container should send an event “mouse over” indicating that the mouse pointer is over the button, so it should be focused. If not, but it was before, than container sends “mouse out” message for element to blur.
Another example: to redraw the window container does next:

glClear(<all buffers>);
<all the pre-drawing code>
<like initializing the matrixes>
<and so on>
for(every element in the list)
	elemet-><handle event method>(<redraw yourself event>);
glutSwapBuffers();
<or glfwSwapBuffers()>
<or wglSwapBuffers(hdc)>

Actually it’s what I’ve been working on for last couple of months (of cource I could do it faster, but you always want your code to be better; for example first I’ve been using wgl, after - glut; right now I’m using glfw, but I may go back to wgl again…).

You might want to check out the open-source code of the program Blender at www.blender.org which has a full OpenGL user interface. I have to warn you though: there is a LOT of code to study :smiley: .

Good luck.
Pete.

help me out here need a Opengl software

i installed a game and when i run it tels me that OpenGL not currently installed!!!

where can i find one to be installed on my computer???

plsss help me ASAP!!!

where can i find one to be installed on my computer???

You must look at Web of your graphics card manufacturer(www.nvidia.com,www.ati.com,www.intel.com, …) for the newest driver for your card.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.