PDA

View Full Version : How to input a disk data file with mouse



shutian
09-11-2000, 05:20 AM
I use OpenGL and Glut to display large amount of seismic waveforms. Could you tell me how to input a disk file with mouse directly to the program that is running.
examples are greatly helpful.

Thanks in advance

Shutian
Geological Survey of Canada

spak
09-14-2000, 12:42 PM
GLUT lacks interface to "outside" OS environment. What you will have to do is write a menu routine that will scan your disk drive to display a list of filenames. To explain in detail:

1. have a popup menu that says "load data"

2. when that's selected link in a new menu data displays the drives( or starting directory)

3. when the drive/directory is selected, go to that location and read in all the files and make a another menu with the names of the files. ( the filenames can be in an array for later reference )

4. now when your final choice is selected, jump to the routine that reads the datafile.

If the above isn't worth the effort, just ask for the filename from your console window.

Better yet, if you are using Windows, you should have VC++. Just learn how to enable GL drawing on window and translate your GLUT resize and display routines to windows routine. Most of the tutorials can be found at opengl.org.

Sorry, if this didn't hep much

shutian
09-14-2000, 12:53 PM
Good afternoon,

Thank you very much.
I have long way to go.

Shutian