GLUT|ES - Frequently Asked Questions

I am trying to compile GLUT|ES on Symbian but the compiler gives me a lot of errors!

GLUT|ES has not yet been ported on Symbian. If you want to port it, do not hesitate, we will be pleased to add your updates to the official GLUT|ES release.


I have a linkage error when I compile my project in emulator mode.

Which OpenGL|ES library do you use? You must be aware that the non-commercial release package of Hybrid Gerbera does not currently include a library for the x86 emulator.
If you use another OpenGL|ES implementation, you will have to build GLUT|ES in emulator mode and link it with your OpenGL|ES library.


How to use the function glutSelectFile()?

glutSelectFile() opens a dialog box and let the user choose a file of specified type (extension). As the function is based on the GetOpenFileName() function of the Windows API, the second parameter is a filter compatible with the one used by GetOpenFileName(). So it's a pointer to a buffer containing pairs of null-terminated filter strings. The last string in the buffer must be terminated by two NULL characters. The first string in each pair is a display string that describes the filter (for example, "JPEG Files"), and the second string specifies the filter pattern (for example, "*.JPG"). To specify multiple filter patterns for a single display string, use a semicolon to separate the patterns (for example, "*.3DS;*.OBJ;*.X"). A pattern string can be a combination of valid filename characters and the asterisk (*) wildcard character. Do not include spaces in the pattern string.
The last parameter is the title of the file chooser dialog-box.
The following example ask the user to select a .3DS or any other kind of file, the file path is saved in the filename string:

 if(glutSelectFile(filename, "3DS Files\0*.3ds\0All files (*.*)\0*.*\0", "Select a 3DS file"))
 {
 	FILE *f = fopen(filename, "r");
 	...
 }
 

How to use the function glutTrueTypeString()?

glutTrueTypeString() draws an UNICODE string using a specified True Type font (which must be installed in the Windows\Font directory) at a specified screen position. You can also indicate characters' size and set different flags corresponding to italic(1), bold(2) and underlined(4). These flags can be combined using a bit to bit OR operation.
The following example print the string "Hello world in UNICODE" in underlined italic at the position (100, 100) using Arial font at size 12pt:

 	glutTrueTypeString(L"Arial", 12, 1|4, 100, 100, L"Hello world in UNICODE");
 

How to use the function glutInitDisplayString(const char *mode)?

Because of the specificites of EGL (EGL is an interface between OpenGL ES and the underlying native platform window system) the function glutInitDisplayString() does not accept the same parameters that the classical Glut implementations. See this page.
In GLUT|ES, you can provide the following capability names: buffer, red, green, blue, alpha, caveat, id, depth, level, sample_buffers, samples, stencil, surface, transparent_type, transparent_red, transparent_green and transparent_blue. Note that = is the only valid comparator support. The values of each capability name is a integer corresponding to the value of the corresponding EGL configuration attribute. Only numerical values are supported so you need, by example, to replace EGL_DONT_CARE by -1 and EGL_NONE by 12344.
Call to glutInitDisplayString must be done BEFORE the creation of the window.

 	glutInit(&argc, argv);
 	glutInitDisplayString("stencil=8 depth=8");  // Request 8 bits for both depth and stencil bufers.
 	glutInitWindowSize(240, 320); 
   	glutCreateWindow("Hello GLUT|ES"); 
   	...
 




Back to main page