int attribute (int mode, int type, void *data)
The mode-parameter may have the following values,
but not every mode and type will work together. For the
correct specification see the appropriate table.
The modes PRE and POST are used in the transformation function and
only mentioned here for completeness.
/* modes */ G_MODE_QUERY G_MODE_GET G_MODE_SET G_MODE_PRE G_MODE_POST G_MODE_SWAP
This paragraph describes the possible modes and their functionality:
Now the list of attributes, which can be demanded or set by the attribute() function. The attributes are not only depending upon the graphic-hardware, but mostly on the device-driver.
G_RASTER_ABILITY G_COLOR_ABILITY G_ZBUFF_ABILITY G_RESOLUTION G_ASPECTRATIO G_BACKGROUND_COLOR G_LINE_COLOR G_LINE_TYPE G_ANTIALIAS G_DEPTHCUE G_PATCH_SUPROP G_TEXT_COLOR G_TEXT_TYPE G_DOUBLEBUFFER G_LIGHT_MODEL G_LIGHT_NUMBER G_HAS_DOUBLEBUFFER G_ORIGIN G_TEXTURE
The following table shows the possible combinations of modes, types and the appropriate data-type needed. (-- means data ignored, return value of one means yes)
attribute modes *data comment --------- ----- ----- ------- G_RASTER_ABILITY QUERY - hardw. for raster graphic G_COLOR_ABILITY QUERY - hardware for colors G_ZBUFF_ABILITY QUERY - hardware z-buffering G_RESOLUTION GET | SET RESOLUTION_TYPE xy size of window in pixel G_ASPECTRATIO GET double aspect win_size_x / win_size_y (only 1.0 for now) G_BACKGROUND_COLOR GET | SET VEC3 rgb G_LINE_COLOR GET | SET VEC3 rgb G_LINE_TYPE GET | SET int itype (only X11: default = 0, dashed < 0 < thickness) G_ANTIALIAS GET | SET int yes_no G_DEPTHCUE GET | SET DEPTHCUE_TYPE depthcue G_PATCH_SUPROP GET | SET SUPROP_DEV suprop G_TEXT_COLOR GET | SET VEC3 rgb G_TEXT_TYPE - - (not implemented) G_DOUBLEBUFFER GET|SET|SWAP int yes_no G_LIGHT_MODEL SET int on_off inhibit light calculation G_LIGHT_NUMBER QUERY - number of light sources G_HAS_DOUBLEBUFFER - - (not implemented) G_ORIGIN GET | SET RESOLUTION_TYPE xy position of window
In the table above the following typedefs are used:
int on_off, yes_no; /* NO, OFF or YES, ON */ typedef struct suprop_dev { double emission[3]; /* rgb color emission (incl. intensity) */ double ambient[3]; /* ambient rgb reflectance */ double diffuse[3]; /* diffuse rgb reflectance */ double specular[3]; /* specular rgb reflectance */ double specular_exp; /* specular reflectance exponent */ double transparency; /* transparency factor (0..1) */ } SUPROP_DEV; typedef struct depthcue_type { int on_off; /* OFF, ON */ double zmin; /* dist. where depth cueing begins (full intensity) */ double zmax; /* dist. where depth cueing ends (reduced intensity)*/ double dark; /* max. reduction of intensity (0.0 <= dark <= 1.0) */ } DEPTHCUE_TYPE;
Copyright © by the Sonderforschungsbereich 256 at the Institut für Angewandte Mathematik, Universität Bonn.