- Q) My demo doesn't display text. I know I used the GLUT font routines!
- A) Then you probably use GLUT as a DXE. Well, there is no direct access to
- variables due to the way DXE works. Read the documentation. The author of
- GLUT took this into account for _WIN32 DLL's only; I don't want to modify
- his headers. The only workaround is to link GLUT the old way :-(
+ Q) I'm getting a "bad font!" fatal error.
+ A) Always use GLUT_STROKE_* and GLUT_BITMAP_* constants when dealing with
+ GLUT fonts. If you're using `glut.dxe', then make sure GLUT_STROKE_* and
+ GLUT_BITMAP_* are mapped to integer constants, not to the actual font
+ address (same mechanism used for Win32 _DLL).
+
+ Q) What is NUL driver good for, if I don't get any output at all?
+ A) For debugging. The NUL driver is very much like OSMesa. Everything is
+ done just the same as VESA/VGA drivers, only it doesn't touch your video
+ hardware. You can query the actual buffer by issuing:
+ DMesaGetIntegerv(DMESA_GET_BUFFER_ADDR, &buffer);
+ and dump it to a file.
+
+ Q) How do I query for a list of available video modes to choose as a visual?
+ A) This is an ugly hack, for which I'm sure I'll burn in hell.
+ First, query for a list of modes:
+ n = DMesaGetIntegerv(DMESA_GET_VIDEO_MODES, NULL);
+ If `n' is strictly positive, you allocate an array of pointers to a given
+ struct (which is guaranteed to be extended only - not changed in future):
+ struct {
+ int xres, yres;
+ int bpp;
+ } **l = malloc(n * sizeof(void *));
+ Now pass the newly allocated buffer to fill in:
+ DMesaGetIntegerv(DMESA_GET_VIDEO_MODES, (GLint *)l);
+ And collect the info:
+ for (i = 0; i < n; i++) {
+ printf("%dx%d:%d\n", l[i]->xres, l[i]->yres, l[i]->bpp);
+ }