001: /*******************************************************************************
002: * Copyright (c) 2000, 2005 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.swt.opengl;
011:
012: /**
013: * The GLData class is a device-independent description
014: * of the pixel format attributes of a GL drawable.
015: *
016: * @see GLCanvas
017: */
018:
019: public class GLData {
020: /**
021: * Specifies a double-buffered surface. During context
022: * creation, only double-buffered formats are considered
023: * when set to true.
024: */
025: public boolean doubleBuffer;
026:
027: /**
028: * Specifies a stereo surface. During context creation,
029: * only stereo formats are considered when set to true.
030: */
031: public boolean stereo;
032:
033: /**
034: * The size in bits of the color buffer's red channel.
035: * During context creation, this specifies the minimum
036: * required red bits.
037: */
038: public int redSize;
039:
040: /**
041: * The size in bits of the color buffer's green channel.
042: * During context creation, this specifies the minimum
043: * required green bits.
044: */
045: public int greenSize;
046:
047: /**
048: * The size in bits of the color buffer's blue channel.
049: * During context creation, this specifies the minimum
050: * required blue bits.
051: */
052: public int blueSize;
053:
054: /**
055: * The size in bits of the color buffer's alpha channel.
056: * During context creation, this specifies the minimum
057: * required alpha bits.
058: */
059: public int alphaSize;
060:
061: /**
062: * The size in bits of the depth buffer. During context
063: * creation, the smallest depth buffer of at least the
064: * specified value is preferred, or zero for no depth
065: * buffer.
066: */
067: public int depthSize;
068:
069: /**
070: * The desired number of stencil bitplanes. During
071: * context creation, the smallest stencil buffer of at
072: * least the specified value is preferred, or zero for
073: * no stencil buffer.
074: */
075: public int stencilSize;
076:
077: /**
078: * The size in bits of the accumulation buffer's red
079: * channel. During context creation, this specifies the
080: * minimum required red bits.
081: */
082: public int accumRedSize;
083:
084: /**
085: * The size in bits of the accumulation buffer's green
086: * channel. During context creation, this specifies the
087: * minimum required green bits.
088: */
089: public int accumGreenSize;
090:
091: /**
092: * The size in bits of the accumulation buffer's blue
093: * channel. During context creation, this specifies the
094: * minimum required blue bits.
095: */
096: public int accumBlueSize;
097:
098: /**
099: * The size in bits of the accumulation buffer's alpha
100: * channel. During context creation, this specifies the
101: * minimum required alpha bits.
102: */
103: public int accumAlphaSize;
104:
105: /**
106: * The number of multisample buffers used by this context.
107: * During context creation, this specifies the minimum
108: * number of multisample buffers requested.
109: */
110: public int sampleBuffers;
111:
112: /**
113: * The number of samples accepted in the multisample buffer.
114: * During creation, pixel formats with the smallest number of
115: * samples that meets or exceeds the specified minimum number
116: * are preferred.
117: */
118: public int samples;
119:
120: /**
121: * Returns a string containing a concise, human-readable
122: * description of the receiver.
123: *
124: * @return a string representation of the data
125: */
126: public String toString() {
127: return (doubleBuffer ? "doubleBuffer," : "")
128: + (stereo ? "stereo," : "") + "r:" + redSize + " g:"
129: + greenSize + " b:" + blueSize + " a:" + alphaSize
130: + "," + "depth:" + depthSize + ",stencil:"
131: + stencilSize + ",accum r:" + accumRedSize + "g:"
132: + accumGreenSize + "b:" + accumBlueSize + "a:"
133: + accumAlphaSize + ",sampleBuffers:" + sampleBuffers
134: + ",samples:" + samples;
135: }
136: }
|