Create a open/save file dialogue in opengl (codeblocks , C++)


I want to know in the window that is created in opengl, can we also add open file dialogue as is there in many windows (file->open).



OpenGL® is a standard API for rendering graphics. Drawing things is pretty much all it can do, it does not have a concept of a window, GUI, keyboard/mouse etc…

Creating a window for OpenGL® rendering is done by using system dependend functions, or a library that abstracts those away.

Creating a toolbar for your rendering window, let alone a file open/save dialog or other user interfaces is not in the scope of OpenGL® and has to be done using
either system functions, or whatever library you use, if it can handle it.

You won’t actually create an open file dialog in OpenGL unless you write your own rendering engine!
Just use frameworks like QT. QT can work together with OpenGL pretty well and it is easy to use.
There are plenty of tutorials on the internet how to integrate the QT-UI with OpenGL.

no openggl is for rendering api if you want to add this specific you cane use Libraris support do it GUI
SDL Spport Openg gl Window and GUI

or you can render an button using opengl and program it using mous click position …
you need to learn more c++ and Opengl

You can find more information about your question at -

you generally don’t do this in opengl, you use native code for your platform or a third party library.
tiny file dialogs on sourceforge offers several modal dialogs including open file dialog and save file dialog.
it’s a single cross-platform C C++ file that you just add to your project.