visual.h File Reference


Enumerations

enum  {
  RGB_COLOR, INDEXED_COLOR, SINGLE_BUFFER, DOUBLE_BUFFER,
  ACCUM_BUFFER, ALPHA_BUFFER, DEPTH_BUFFER, STENCIL_BUFFER,
  RGB24_COLOR, MULTISAMPLE, STEREO
}

Functions

bool visual (int)
bool glVisual (int)
void own_colormap ()

Detailed Description


Function Documentation

bool glVisual int  mode  ) 
 

Same as visual(int) except choose a visual that is also capable of drawing OpenGL. On modern X servers this is true by default, but on older ones OpenGL will crash if the visual is not selected with this.

mode is the same bitflags accepted by GlWindow::mode(). This causes all windows (and thus glstart()) to have these capabilities.

void own_colormap  ) 
 

Makes FLTK use its own X colormap. This may make FLTK display better and will reduce conflicts with other programs that want lots of colors. However the colors may flash as you move the cursor between windows. This function is pretty much legacy nowadays as all modern systems are full color, on such systems this does nothing.

You must call this before you show() any windows. If you call visual(int) you must call this after that.

bool visual int   ) 
 

X-specific crap to allow you to force the "visual" used by fltk to one you like, rather than the "default visual" which in many cases has less capabilities than your machine really has! For instance visual(RGB_COLOR) will get you a full color display instead of an 8-bit colormap, if possible.

You must call this before you show() any windows. The integer argument is an 'or' of the following:

  • INDEXED_COLOR indicates that a colormapped visual is ok. This call will normally fail if a TrueColor visual cannot be found.
  • RGB_COLOR this value is zero and may be passed to indicate that INDEXED_COLOR is not wanted.
  • RGB24_COLOR indicates that the visual must have at least 8 bits of red, green, and blue (Windows calls this "millions of colors").
  • DOUBLE_BUFFER indicates that hardware accelerated double buffering is wanted.
  • Other bits used by glVisual() and GlWindow::mode() are ignored by this.

This returns true if the system has the capabilities by default or FLTK suceeded in turing them on. Your program will still work even if this returns false (it just won't look as good).

On non-X systems this just returns true or false indicating if the system supports the passed values.


Sun Jan 7 00:55:17 2007. FLTK ©2006 Bill Spitzak and others.
Permission is granted to reproduce this manual or any portion for any purpose, provided this copyright and permission notice are preserved.