PDA

View Full Version : Create a open/save file dialogue in opengl (codeblocks , C++)



abhiMishka
11-05-2014, 12:58 AM
Hi,

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).

Abhishek

Thanks

Agent D
11-05-2014, 03:31 AM
OpenGL(R) 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(R) 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(R) and has to be done using
either system functions, or whatever library you use, if it can handle it.

Alphaomega86
11-08-2014, 03:41 PM
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.

DragonForce99
11-10-2014, 03:06 AM
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

kaufenpreis
11-12-2014, 06:28 AM
You can find more information about your question at - http://www.steinsoft.net/index.php?site=Programming/Tutorials/opengl_dialog

chafporte
03-22-2015, 01:13 AM
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.