Discussion:
File requester in OpenGL
(too old to reply)
Gernot Frisch
2003-11-19 09:13:13 UTC
Permalink
Hi,

is there any class that provides a file requester dialog completely in
OpenGL? Like GetOpenFileName on Win32 API?

If there is none
{
is anybody willing to help me write one? My aim is to have 2
files:
GLFileDlg.h and GLFileDlg.cpp.
The gfx should be in the code.
I have a program that can put a bmp into a cpp file already.

The project would be open source - public domain then.
I don't have much experience with this, sourceforge,
CVS and whatever you might need...

Any volunteers?
}
--
-Gernot

Post here, don't email. If you feel you have to mail, revert my
forename from:
tonreG.Frisch.at.Dream-D-***@invalid.com
________________________________________
Looking for a good game? Do it yourself!
GLBasic - you can do
www.GLBasic.com
fungus
2003-11-19 10:29:49 UTC
Permalink
Post by Gernot Frisch
Hi,
is there any class that provides a file requester dialog completely in
OpenGL? Like GetOpenFileName on Win32 API?
If there is none
{
is anybody willing to help me write one?
Bad idea. File selectors are something which really put
users off if they are "wrong". Use the native one via a
wrapper. It won't make your code terribly unportable or
anything.
--
<\___/> For email, remove my socks.
/ O O \
\_____/ FTB. Why isn't there mouse-flavored cat food?
Wolfgang Draxinger
2003-11-22 13:10:29 UTC
Permalink
Post by fungus
Bad idea. File selectors are something which really put
users off if they are "wrong". Use the native one via a
wrapper. It won't make your code terribly unportable or
anything.
What about applications that draw their whole UI using OpenGL? E.g.
Blender ( http://www.blender.org ). Their file disalog is quite good,
and easy to use. Compared to this, the GTK+ default File Dialog is crap,
which is the gruound, why I'm using a self made one im my GTK+
applications. I even consider to patch GTK+ with it.
--
+------------------------------------------------+
| +----------------+ WOLFGANG DRAXINGER |
| | ,-. DARKSTAR | lead programmer |
| |( ) +---------+ ***@darkstargames.de |
| | `-' / GAMES / |
| +----+'''''''' http://www.darkstargames.de |
+------------------------------------------------+
fungus
2003-11-22 14:38:28 UTC
Permalink
Post by Wolfgang Draxinger
Post by fungus
Bad idea. File selectors are something which really put
users off if they are "wrong". Use the native one via a
wrapper. It won't make your code terribly unportable or
anything.
What about applications that draw their whole UI using OpenGL? E.g.
Blender ( http://www.blender.org ). Their file disalog is quite good,
and easy to use.
It may be "good" but that's not the point. If a user has
to use your program in a different way than all his other
programs then it's bad design.

A simple rule for this sort of thing is to let the user
decide. If you think you can invent a better file selector
then let the user access it through an "advanced" setting.
--
<\___/> For email, remove my socks.
/ O O \
\_____/ FTB. Why isn't there mouse-flavored cat food?
Quaternion
2003-11-19 10:46:27 UTC
Permalink
Post by Gernot Frisch
Hi,
is there any class that provides a file requester dialog completely in
OpenGL? Like GetOpenFileName on Win32 API?
If there is none
{
is anybody willing to help me write one? My aim is to have 2
GLFileDlg.h and GLFileDlg.cpp.
The gfx should be in the code.
I have a program that can put a bmp into a cpp file already.
The project would be open source - public domain then.
I don't have much experience with this, sourceforge,
CVS and whatever you might need...
Any volunteers?
}
Linux' filenames are caps-sensitive, MacOS's and Windows's filenames are
not. What could you accomplish then? It's a bad idea
--
Quaternion
Gernot Frisch
2003-11-19 11:10:59 UTC
Permalink
This post might be inappropriate. Click to display it.
j
2003-11-19 12:01:09 UTC
Permalink
While others may think it's a bad idea,
I have an implementation of a GUI
based on glut, of which the source will
be available as it was partly developed
for an opensource project. I still have to
write, indeed, a ( simple ! ) file-selector.
The release is due in weeks, so we might
as well start now. Email me directly if you're
interested.

J
--
--
reply to j at dynamica dot org
--
Post by Gernot Frisch
Post by Quaternion
Linux' filenames are caps-sensitive, MacOS's and Windows's filenames
are
Post by Quaternion
not. What could you accomplish then? It's a bad idea
--
Quaternion
What's the deal? I simply want a dialog-looking opengl thingy that is
able to allow me to click on a file, change folders or type a name
into the file-name edit control. Case sensitivity doesn't matter here.
The files&folders are displayed the way they will be listed using
opendir / FindFile. When the user types: "MyFile" and only "myfile"
exists, it's his/her fault if the file is not found on Linux. That's
the same with any file browser on Linux as well. I don't see why this
is such a terribly bad idea? It would be totally platform independent
and can be used in fullscreen mode as well.
-Gernot
fungus
2003-11-19 12:46:39 UTC
Permalink
Post by j
While others may think it's a bad idea,
I have an implementation of a GUI
based on glut, of which the source will
be available as it was partly developed
for an opensource project.
I don't care about that, it's a really, really
bad idea to put in a "simple file selector"

GLUT has some platform specific code, why not
add a dozen more lines or so and save yourself
a lot of work.

PS: Even "run anywhere" Java used the system file
selector.
Post by j
I still have to
write, indeed, a ( simple ! ) file-selector.
The release is due in weeks
Even more reason not to waste time writing your own.

Here's a start on Windows: GetOpenFileName()
--
<\___/> For email, remove my socks.
/ O O \
\_____/ FTB. Why isn't there mouse-flavored cat food?
Gernot Frisch
2003-11-19 14:30:06 UTC
Permalink
Post by fungus
Post by j
While others may think it's a bad idea,
I have an implementation of a GUI
based on glut, of which the source will
be available as it was partly developed
for an opensource project.
I don't care about that, it's a really, really
bad idea to put in a "simple file selector"
GLUT has some platform specific code, why not
add a dozen more lines or so and save yourself
a lot of work.
PS: Even "run anywhere" Java used the system file
selector.
Post by j
I still have to
write, indeed, a ( simple ! ) file-selector.
The release is due in weeks
Even more reason not to waste time writing your own.
Here's a start on Windows: GetOpenFileName()
First, I didn't want to offend anyone. Next, when doing a
GetOpenFileName(), my backroung OpenGL window does not redraw. Thus it
looks ugly. More, I have somehow a problem, whe I'm in fullscreen,
topmost window and want to show the dialog. Maybe I'm just dumb?

-Gernot
fungus
2003-11-19 14:42:24 UTC
Permalink
Post by Gernot Frisch
First, I didn't want to offend anyone. Next, when doing a
GetOpenFileName(), my backroung OpenGL window does not redraw.
You´re not handling the WM_PAINT message properly...
--
<\___/> For email, remove my socks.
/ O O \
\_____/ FTB. Why isn't there mouse-flavored cat food?
Gernot Frisch
2003-11-19 15:11:28 UTC
Permalink
YouŽre not handling the WM_PAINT message properly...
Ah. All right. I'm not handling it at all. I just handle WM_MOVE and
WM_SYSCOMMAND/SC_CLOSE, because it's a game and I'm not interested in
any messages.
Right, I should handle WM_PAINT if I'm in the file-dialog.

But then - is there any X-plattform file requester library?

Thank you,
-Gernot
--
<\___/> For email, remove my socks.
/ O O \
\_____/ FTB. Why isn't there mouse-flavored cat food?
sebastian andreas gruber
2003-11-19 15:40:13 UTC
Permalink
Post by Gernot Frisch
Post by fungus
Post by j
While others may think it's a bad idea,
I have an implementation of a GUI
based on glut, of which the source will
be available as it was partly developed
for an opensource project.
I don't care about that, it's a really, really
bad idea to put in a "simple file selector"
GLUT has some platform specific code, why not
add a dozen more lines or so and save yourself
a lot of work.
PS: Even "run anywhere" Java used the system file
selector.
Post by j
I still have to
write, indeed, a ( simple ! ) file-selector.
The release is due in weeks
Even more reason not to waste time writing your own.
Here's a start on Windows: GetOpenFileName()
First, I didn't want to offend anyone. Next, when doing a
GetOpenFileName(), my backroung OpenGL window does not redraw. Thus it
looks ugly. More, I have somehow a problem, whe I'm in fullscreen,
topmost window and want to show the dialog. Maybe I'm just dumb?
-Gernot
Perhaps you could try to use some thread for loading data so your
WM_PAINT routine still will be executed correctly.

Since I do not know what sort of machine you use for OGL I cannot tell
you any examples for creating a 'loader'-thread here right now.

-Sebastian
Gernot Frisch
2003-11-19 15:57:21 UTC
Permalink
Post by sebastian andreas gruber
Perhaps you could try to use some thread for loading data so your
WM_PAINT routine still will be executed correctly.
Propably a good idea.
Post by sebastian andreas gruber
Since I do not know what sort of machine you use for OGL I cannot tell
you any examples for creating a 'loader'-thread here right now.
I'm familiar with creating threads, thank you.
-Gernot
fungus
2003-11-19 16:32:37 UTC
Permalink
Post by Gernot Frisch
Post by sebastian andreas gruber
Perhaps you could try to use some thread for loading data so your
WM_PAINT routine still will be executed correctly.
Propably a good idea.
You don´t need to. Just handle the WM?PAINT messages
while the file select dialog is open.
--
<\___/> For email, remove my socks.
/ O O \
\_____/ FTB. Why isn't there mouse-flavored cat food?
Quaternion
2003-11-19 12:59:41 UTC
Permalink
Post by Gernot Frisch
Post by Quaternion
Linux' filenames are caps-sensitive, MacOS's and Windows's filenames
are
Post by Quaternion
not. What could you accomplish then? It's a bad idea
--
Quaternion
What's the deal? I simply want a dialog-looking opengl thingy that is
able to allow me to click on a file, change folders or type a name
into the file-name edit control. Case sensitivity doesn't matter here.
The files&folders are displayed the way they will be listed using
opendir / FindFile. When the user types: "MyFile" and only "myfile"
exists, it's his/her fault if the file is not found on Linux. That's
the same with any file browser on Linux as well. I don't see why this
is such a terribly bad idea? It would be totally platform independent
and can be used in fullscreen mode as well.
Well perhaps you can use it as part as a project, but it's just a bad idea
to make an API of it (which I hope you'd be doing and not just one
'class'), because there are native solutions (there are cross-platform GUI
api's, you know..try V or Qt. Or better yet, try a better programming
architecture where these GUI matters are totally separate from the
project), and they, like what fungus said, use less extra resources, and
are also familiar to the user, whichever system he uses.
And indeed also one technical difference remains between native solutions
and your openGL exercise, since you will *have* to work caps-sensitive on
all platforms to make it cross-platform, unlike for instance MS MFC or
WTL's file openers which aren't.
Perhaps it has its place somewhere, in some game programmer's project who is
too lazy to code a customized save file opener, ok, go ahead then. Your
question was "is there any class that provides a file requester dialog
completely in OpenGL? Like GetOpenFileName on Win32 API?", and you told us
you are able to put a bmp file into a cpp file, so of course you get these
replies that try to tell you it is not something that sounds very usable.
If you asked if there already was a dialog API using openGL and had an
actual problem with designing one, things would be different.
--
Quaternion
yooyo
2003-11-21 10:56:51 UTC
Permalink
Post by Gernot Frisch
Hi,
is there any class that provides a file requester dialog completely in
OpenGL? Like GetOpenFileName on Win32 API?
It's quite difficult job... You have to deal with special folders
(Desktop, My Documents, ...) you have to support My Network Places,
mapped network drives, icons, and lot more...

yooyo
p***@pci.uzh.ch
2019-09-25 11:17:58 UTC
Permalink
Post by Gernot Frisch
Hi,
is there any class that provides a file requester dialog completely in
OpenGL? Like GetOpenFileName on Win32 API?
I did this many years ago, but not for OpenGl but for xtekplot1.
Now I'm searching for the same thing in OpenGL. If not yet available,
code from xtekplot1 could be ported.
(email is wrong: should be rolf.pfister<at>chem.uzh.ch (not pci.uzh.ch))

Rolf

Loading...