+
+#if defined( _DEBUG ) && !defined( _WIN32 ) && !defined( __MACH__ )
+/* just some DEBUG ONLY code, to show the 'attributes' */
+
+typedef struct tagPXATTS {
+ int attr;
+ const char * name;
+ const char * desc;
+ int def;
+}PXATTS, * PPXATTS;
+
+static PXATTS pxAtts[] = {
+ { GLX_FBCONFIG_ID, "GLX_FBCONFIG_ID",
+ "followed by a valid XID that indicates the desired GLX frame buffer configuration. "
+ "When a GLX_FBCONFIG_ID is specified, all attributes are ignored. The default value is GLX_DONT_CARE.",
+ GLX_DONT_CARE },
+ { GLX_BUFFER_SIZE, "GLX_BUFFER_SIZE",
+ "Must be followed by a nonnegative integer that indicates the desired color index buffer size."
+ "The smallest index buffer of at least the specified size is preferred. This attribute is ignored if GLX_COLOR_INDEX_BIT is not set "
+ "in GLX_RENDER_TYPE. The default value is 0.",
+ 0 },
+ { GLX_LEVEL, "GLX_LEVEL",
+ "Must be followed by an integer buffer-level specification. This specification is honored exactly."
+ "Buffer level 0 corresponds to the default frame buffer of the display. "
+ "Buffer level 1 is the first overlay frame buffer, level two the second overlay frame buffer, and so on."
+ "Negative buffer levels correspond to underlay frame buffers. The default value is 0.",
+ 0 },
+ { GLX_DOUBLEBUFFER, "GLX_DOUBLEBUFFER",
+ "Must be followed by True or False. If True is specified, then only double-buffered frame buffer configurations are considered;"
+ "if False is specified, then only single-buffered frame buffer configurations are considered. The default value is GLX_DONT_CARE.",
+ GLX_DONT_CARE },
+ { GLX_STEREO, "GLX_STEREO",
+ "Must be followed by True or False. If True is specified, then only stereo frame buffer configurations are considered;"
+ " if False is specified, then only monoscopic frame buffer configurations are considered. The default value is False.",
+ False },
+ { GLX_AUX_BUFFERS, "GLX_AUX_BUFFERS",
+ "Must be followed by a nonnegative integer that indicates the desired number of auxiliary buffers."
+ " Configurations with the smallest number of auxiliary buffers that meet or exceed the specified number are preferred."
+ " The default value is 0.",
+ 0 },
+ { GLX_RED_SIZE, "GLX_RED_SIZE",
+ "must be followed by a nonnegative minimum size",
+ 0 },
+ { GLX_GREEN_SIZE, "GLX_GREEN_SIZE",
+ "must be followed by a nonnegative minimum size",
+ 0 },
+ { GLX_BLUE_SIZE, "GLX_BLUE_SIZE",
+ "must be followed by a nonnegative minimum size",
+ 0 },
+ { GLX_ALPHA_SIZE, "GLX_ALPHA_SIZE",
+ "Each attribute, if present, must be followed by a nonnegative minimum size specification or GLX_DONT_CARE."
+ " The largest available total RGBA color buffer size (sum of GLX_RED_SIZE, GLX_GREEN_SIZE, GLX_BLUE_SIZE, and GLX_ALPHA_SIZE) "
+ " of at least the minimum size specified for each color component is preferred. If the requested number of bits for a color "
+ " component is 0 or GLX_DONT_CARE, it is not considered. The default value for each color component is 0.",
+ 0 },
+ { GLX_DEPTH_SIZE, "GLX_DEPTH_SIZE",
+ "Must be followed by a nonnegative minimum size specification. If this value is zero, "
+ "frame buffer configurations with no depth buffer are preferred."
+ "Otherwise, the largest available depth buffer of at least the minimum size is preferred. The default value is 0.",
+ 0 },
+ { GLX_STENCIL_SIZE, "GLX_STENCIL_SIZE",
+ "Must be followed by a nonnegative integer that indicates the desired number of stencil bitplanes."
+ "The smallest stencil buffer of at least the specified size is preferred. If the desired value is zero,"
+ " frame buffer configurations with no stencil buffer are preferred. The default value is 0.",
+ 0 },
+ { GLX_ACCUM_RED_SIZE, "GLX_ACCUM_RED_SIZE",
+ "Must be followed by a nonnegative minimum size specification. If this value is zero, "
+ " frame buffer configurations with no red accumulation buffer are preferred."
+ " Otherwise, the largest possible red accumulation buffer of at least the minimum size is preferred. The default value is 0.",
+ 0 },
+ { GLX_ACCUM_GREEN_SIZE, "GLX_ACCUM_GREEN_SIZE",
+ "Must be followed by a nonnegative minimum size specification. If this value is zero, "
+ "frame buffer configurations with no green accumulation buffer are preferred. "
+ "Otherwise, the largest possible green accumulation buffer of at least the minimum size is preferred. The default value is 0.",
+ 0 },
+ { GLX_ACCUM_BLUE_SIZE, "GLX_ACCUM_BLUE_SIZE",
+ "Must be followed by a nonnegative minimum size specification. If this value is zero, "
+ "frame buffer configurations with no blue accumulation buffer are preferred. "
+ "Otherwise, the largest possible blue accumulation buffer of at least the minimum size is preferred. The default value is 0.",
+ 0 },
+ { GLX_ACCUM_ALPHA_SIZE, "GLX_ACCUM_ALPHA_SIZE",
+ "Must be followed by a nonnegative minimum size specification. If this value is zero, "
+ "frame buffer configurations with no alpha accumulation buffer are preferred. "
+ "Otherwise, the largest possible alpha accumulation buffer of at least the minimum size is preferred. The default value is 0.",
+ 0 },
+ { GLX_RENDER_TYPE, "GLX_RENDER_TYPE",
+ "Must be followed by a mask indicating which OpenGL rendering modes the frame buffer configuration must support. "
+ "Valid bits are GLX_RGBA_BIT and GLX_COLOR_INDEX_BIT. If the mask is set to GLX_RGBA_BIT | GLX_COLOR_INDEX_BIT, "
+ "then only frame buffer configurations that can be bound to both RGBA contexts and color index contexts will be considered. "
+ "The default value is GLX_RGBA_BIT.",
+ GLX_RGBA_BIT },
+ { GLX_DRAWABLE_TYPE, "GLX_DRAWABLE_TYPE",
+ "Must be followed by a mask indicating which GLX drawable types the frame buffer configuration must support. "
+ "Valid bits are GLX_WINDOW_BIT, GLX_PIXMAP_BIT, and GLX_PBUFFER_BIT. For example, if mask is set to "
+ "GLX_WINDOW_BIT | GLX_PIXMAP_BIT, only frame buffer configurations that support both windows and GLX pixmaps "
+ "will be considered. The default value is GLX_WINDOW_BIT.",
+ GLX_WINDOW_BIT },
+ { GLX_X_RENDERABLE, "GLX_X_RENDERABLE",
+ "Must be followed by True or False. If True is specified, then only frame buffer configurations that "
+ "have associated X visuals (and can be used to render to Windows and/or GLX pixmaps) will be considered. "
+ "The default value is GLX_DONT_CARE. ",
+ GLX_DONT_CARE },
+ { GLX_X_VISUAL_TYPE, "GLX_X_VISUAL_TYPE",
+ "Must be followed by one of GLX_TRUE_COLOR, GLX_DIRECT_COLOR, GLX_PSEUDO_COLOR, GLX_STATIC_COLOR, "
+ "GLX_GRAY_SCALE, or GLX_STATIC_GRAY, indicating the desired X visual type. "
+ "Not all frame buffer configurations have an associated X visual. If GLX_DRAWABLE_TYPE is specified in attrib_list and the "
+ "mask that follows does not have GLX_WINDOW_BIT set, then this value is ignored. It is also ignored if "
+ "GLX_X_RENDERABLE is specified as False. RGBA rendering may be supported for visuals of type "
+ "GLX_TRUE_COLOR, GLX_DIRECT_COLOR, GLX_PSEUDO_COLOR, or GLX_STATIC_COLOR, "
+ "but color index rendering is only supported for visuals of type GLX_PSEUDO_COLOR or GLX_STATIC_COLOR "
+ "(i.e., single-channel visuals). The tokens GLX_GRAY_SCALE and GLX_STATIC_GRAY will "
+ "not match current OpenGL enabled visuals, but are included for future use."
+ "The default value for GLX_X_VISUAL_TYPE is GLX_DONT_CARE.",
+ GLX_DONT_CARE },
+ { GLX_CONFIG_CAVEAT, "GLX_CONFIG_CAVEAT",
+ "Must be followed by one of GLX_NONE, GLX_SLOW_CONFIG, GLX_NON_CONFORMANT_CONFIG. "
+ "If GLX_NONE is specified, then only frame buffer configurations with "
+ "no caveats will be considered; if GLX_SLOW_CONFIG is specified, then only slow frame buffer configurations will be considered; if "
+ "GLX_NON_CONFORMANT_CONFIG is specified, then only nonconformant frame buffer configurations will be considered."
+ "The default value is GLX_DONT_CARE.",
+ GLX_DONT_CARE },
+ { GLX_TRANSPARENT_TYPE, "GLX_TRANSPARENT_TYPE",
+ "Must be followed by one of GLX_NONE, GLX_TRANSPARENT_RGB, GLX_TRANSPARENT_INDEX. "
+ "If GLX_NONE is specified, then only opaque frame buffer configurations will be considered; "
+ "if GLX_TRANSPARENT_RGB is specified, then only transparent frame buffer configurations that support RGBA rendering will be considered; "
+ "if GLX_TRANSPARENT_INDEX is specified, then only transparent frame buffer configurations that support color index rendering will be considered."
+ "The default value is GLX_NONE.",
+ GLX_NONE },
+ { GLX_TRANSPARENT_INDEX_VALUE, "GLX_TRANSPARENT_INDEX_VALUE",
+ "Must be followed by an integer value indicating the transparent index value; the value must be between 0 and the maximum "
+ "frame buffer value for indices. Only frame buffer configurations that use the "
+ "specified transparent index value will be considered. The default value is GLX_DONT_CARE. "
+ "This attribute is ignored unless GLX_TRANSPARENT_TYPE is included in attrib_list and specified as GLX_TRANSPARENT_INDEX.",
+ GLX_DONT_CARE },
+ { GLX_TRANSPARENT_RED_VALUE, "GLX_TRANSPARENT_RED_VALUE",
+ "Must be followed by an integer value indicating the transparent red value; the value must be between 0 and the maximum "
+ "frame buffer value for red. Only frame buffer configurations that use the specified transparent red value will be considered. "
+ "The default value is GLX_DONT_CARE. This attribute is ignored unless GLX_TRANSPARENT_TYPE is included in "
+ "attrib_list and specified as GLX_TRANSPARENT_RGB.",
+ GLX_DONT_CARE },
+ { GLX_TRANSPARENT_GREEN_VALUE, "GLX_TRANSPARENT_GREEN_VALUE",
+ "Must be followed by an integer value indicating the transparent green value; the value must be between 0 and the maximum "
+ "frame buffer value for green. Only frame buffer configurations that use the specified transparent green value will be considered."
+ "The default value is GLX_DONT_CARE. This attribute is "
+ "ignored unless GLX_TRANSPARENT_TYPE is included in attrib_list and specified as GLX_TRANSPARENT_RGB.",
+ GLX_DONT_CARE },
+ { GLX_TRANSPARENT_BLUE_VALUE, "GLX_TRANSPARENT_BLUE_VALUE",
+ "Must be followed by an integer value indicating the transparent blue value; the value must be between 0 and the maximum "
+ "frame buffer value for blue. Only frame buffer configurations that use the specified transparent blue value will be considered."
+ "The default value is GLX_DONT_CARE. This attribute is ignored unless GLX_TRANSPARENT_TYPE is included in "
+ "attrib_list and specified as GLX_TRANSPARENT_RGB. ",
+ GLX_DONT_CARE },
+ { GLX_TRANSPARENT_ALPHA_VALUE, "GLX_TRANSPARENT_ALPHA_VALUE",
+ "Must be followed by an integer value indicating the transparent alpha value; the value must be between 0 and the maximum "
+ "frame buffer value for alpha. Only frame buffer configurations that use the "
+ "specified transparent alpha value will be considered. The default value is GLX_DONT_CARE.",
+ GLX_DONT_CARE },
+ { 0, NULL, NULL, -1 }
+};
+
+const char * get_attr_name( int val, int * pdef )
+{
+ PPXATTS pat = &pxAtts[0];
+ while( pat->name )
+ {
+ if ( pat->attr == val ) {
+ *pdef = pat->def;
+ return pat->name;
+ }
+ pat++;
+ }
+ *pdef = -1;
+ return "VALUE NOT IN LIST";
+}
+
+#endif
+// eof - RenderTexture.cpp