How to Create a buttons in OpenGL c++

Hi there,
I wanted to make a button in OpenGL c++. I have seen many pages but they do not give the button I need. I know about imgui but in imgui you make buttons with a separate window. I want to make a button on the same screen, like some icons on a phone. Thanks in advaned.

OpenGL
C++
GLFW

There is nothing about Imgui that creates a window for you. It’s perfectly capable of rendering to your OpenGL window.

There is. In imgui there is a icon on the top were it says imgui demo(the window name). I want to make a button like the ones in computers or phones

Well, yes. If you’re running the Imgui demonstration application, then it has to create a window in order to demonstrate how Imgui works. But you can’t create a program just by looking at a demo app.

If you’re using Imgui as a library, then you are responsible for creating and managing the OpenGL window.

What do you mean? Is there some way I can remove the window icon and blend the color in with the opengl window so they both look the same? Is yes, that would work

I don’t really know how to say what I’m saying any more clearly. You are running a demonstration program; that’s not the same thing as using Imgui. The demonstration program uses Imgui. You can use Imgui. But you can’t use the demonstration program to use Imgui.

Just write an application that uses Imgui in accord with its documentation.

Is there some way I can remove the window icon and blend the color in with the opengl window so they both look the same?

There’s no need to do that because you should not be running the Imgui demo application to use Imgui. Do you understand the difference between a program that uses a library and the library itself?

this seems to be the second account named “shanveer kamboj” that i see here. the first one kept asking questions about making buttons with opengl too.

1 Like

I understand, but can you send an image for clarification

I’m afraid not, for several reasons.

First, you haven’t explained what you need “clarification” on, so I have no idea what I would put into said image. Second, within the context of this discussion, I don’t know why you would want an image at all.

And most importantly third… this conversation is over.

You are posting from a new iteration of an existing account that was asking for the same thing. Regardless of the quality of your posts under either account, creating a new account to post further content suggests that you are trying to pretend to be someone new. That you’re trying to escape the negative reputation of your previous account.

And to me, this suggests that you are not posting in good faith.

That you’re basically going to keep posting the same question over and over, perhaps under multiple different alt accounts in some attempt to not be noticed. And that you will continue to do so until someone finally does the thing you seem to want:

To write your code for you.

So I am no longer participating in this conversation. I would simply suggest that you seek out an Imgui tutorial or other learning material. There are plenty of them available, and learning how to learn on your own is a valuable skill to develop.

I need an image of an imgui project in opengl that is not a demo. Meaning same as opengl color and without the top part where the name of the window is

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