X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4cc4bfafe5a31cb96f35b3ec9b19fa2b0b3a4eef..e98e625cbbe269f109b2296a045a657cba00fede:/interface/glcanvas.h diff --git a/interface/glcanvas.h b/interface/glcanvas.h index 5b015bb87e..89fcd6da94 100644 --- a/interface/glcanvas.h +++ b/interface/glcanvas.h @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: glcanvas.h -// Purpose: documentation for wxGLContext class +// Purpose: interface of wxGLContext // Author: wxWidgets team // RCS-ID: $Id$ // Licence: wxWindows license @@ -38,15 +38,14 @@ @library{wxgl} @category{gl} - @seealso - wxGLCanvas + @see wxGLCanvas */ class wxGLContext : public wxObject { public: /** Constructor. - + @param win The canvas that is used to initialize this context. This parameter is needed only temporarily, @@ -72,6 +71,64 @@ public: void SetCurrent(const wxGLCanvas& win); }; +/** + Constants for use with wxGLCanvas. + + Notice that not all implementation support options such as stereo, + auxiliary buffers, alpha channel, and accumulator buffer, use + wxGLCanvas::IsDisplaySupported() to check for individual attributes support. + */ +enum +{ + /// Use true color palette (on if no attributes at all specified). + WX_GL_RGBA = 1, + + /// Specifies the number of bits for buffer if not WX_GL_RGBA. + WX_GL_BUFFER_SIZE, + + /// Must be followed by 0 for main buffer, >0 for overlay, <0 for underlay. + WX_GL_LEVEL, + + /// Use double buffering if present (on if no attributes specified). + WX_GL_DOUBLEBUFFER, + + /// Use stereoscopic display. + WX_GL_STEREO, + + /// Specifies number of auxiliary buffers. + WX_GL_AUX_BUFFERS, + + /// Use red buffer with most bits (> MIN_RED bits) + WX_GL_MIN_RED, + + /// Use green buffer with most bits (> MIN_GREEN bits) + WX_GL_MIN_GREEN, + + /// Use blue buffer with most bits (> MIN_BLUE bits) + WX_GL_MIN_BLUE, + + /// Use alpha buffer with most bits (> MIN_ALPHA bits) + WX_GL_MIN_ALPHA, + + /// Specifies number of bits for Z-buffer (typically 0, 16 or 32). + WX_GL_DEPTH_SIZE, + + /// Specifies number of bits for stencil buffer. + WX_GL_STENCIL_SIZE, + + /// Specifies minimal number of red accumulator bits. + WX_GL_MIN_ACCUM_RED, + + /// Specifies minimal number of green accumulator bits. + WX_GL_MIN_ACCUM_GREEN, + + /// Specifies minimal number of blue accumulator bits. + WX_GL_MIN_ACCUM_BLUE, + + /// Specifies minimal number of alpha accumulator bits. + WX_GL_MIN_ACCUM_ALPHA + +}; /** @class wxGLCanvas @@ -112,8 +169,7 @@ public: @library{wxgl} @category{gl} - @seealso - wxGLContext + @see wxGLContext */ class wxGLCanvas : public wxWindow { @@ -122,9 +178,9 @@ public: Creates a window with the given parameters. Notice that you need to create and use a wxGLContext to output to this window. If - + @param attribList is not specified, double buffered RGBA mode is used. - + parent Pointer to a parent window. @param id @@ -142,15 +198,23 @@ public: @param name Window name. @param attribList - Array of integers. With this parameter you can set the device context - attributes associated to this window. - This array is zero-terminated: it should be set up with constants described - in the table above. - If a constant should be followed by a value, put it in the next array - position. - For example, the WX_GL_DEPTH_SIZE should be followed by the value that - indicates the number of - bits for the depth buffer, so: + Array of integers. With this parameter you can set the device + context attributes associated to this window. This array is + zero-terminated: it should be set up with constants described in + the table above. If a constant should be followed by a value, put + it in the next array position. For example, the WX_GL_DEPTH_SIZE + should be followed by the value that indicates the number of bits + for the depth buffer, e.g: + @code + attribList[n++] = WX_GL_DEPTH_SIZE; + attribList[n++] = 32; + attribList[n] = 0; // terminate the list + @endcode + If the attribute list is not specified at all, i.e. if this + parameter is @NULL, the default attributes including @c WX_GL_RGBA + and @c WX_GL_DOUBLEBUFFER are used. But notice that if you do + specify some attributes you also need to explicitly include these + two default attributes in the list if you need them. @param palette Palette for indexed colour (i.e. non WX_GL_RGBA) mode. Ignored under most platforms. @@ -166,7 +230,7 @@ public: /** Determines if a canvas having the specified attributes is available. Returns @true if attributes are supported. - + @param attribList See attribList for wxGLCanvas(). */ @@ -198,3 +262,4 @@ public: */ bool SwapBuffers(); }; +