KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > swt > opengl > GLData


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.swt.opengl;
12
13 /**
14  * The GLData class is a device-independent description
15  * of the pixel format attributes of a GL drawable.
16  *
17  * @see GLCanvas
18  *
19  * @since 3.2
20  */

21
22 public class GLData {
23     /**
24      * Specifies a double-buffered surface. During context
25      * creation, only double-buffered formats are considered
26      * when set to true.
27      */

28     public boolean doubleBuffer;
29
30     /**
31      * Specifies a stereo surface. During context creation,
32      * only stereo formats are considered when set to true.
33      */

34     public boolean stereo;
35
36     /**
37      * The size in bits of the color buffer's red channel.
38      * During context creation, this specifies the minimum
39      * required red bits.
40      */

41     public int redSize;
42
43     /**
44      * The size in bits of the color buffer's green channel.
45      * During context creation, this specifies the minimum
46      * required green bits.
47      */

48     public int greenSize;
49
50     /**
51      * The size in bits of the color buffer's blue channel.
52      * During context creation, this specifies the minimum
53      * required blue bits.
54      */

55     public int blueSize;
56
57     /**
58      * The size in bits of the color buffer's alpha channel.
59      * During context creation, this specifies the minimum
60      * required alpha bits.
61      */

62     public int alphaSize;
63
64     /**
65      * The size in bits of the depth buffer. During context
66      * creation, the smallest depth buffer of at least the
67      * specified value is preferred, or zero for no depth
68      * buffer.
69      */

70     public int depthSize;
71
72     /**
73      * The desired number of stencil bitplanes. During
74      * context creation, the smallest stencil buffer of at
75      * least the specified value is preferred, or zero for
76      * no stencil buffer.
77      */

78     public int stencilSize;
79
80     /**
81      * The size in bits of the accumulation buffer's red
82      * channel. During context creation, this specifies the
83      * minimum required red bits.
84      */

85     public int accumRedSize;
86
87     /**
88      * The size in bits of the accumulation buffer's green
89      * channel. During context creation, this specifies the
90      * minimum required green bits.
91      */

92     public int accumGreenSize;
93
94     /**
95      * The size in bits of the accumulation buffer's blue
96      * channel. During context creation, this specifies the
97      * minimum required blue bits.
98      */

99     public int accumBlueSize;
100
101     /**
102      * The size in bits of the accumulation buffer's alpha
103      * channel. During context creation, this specifies the
104      * minimum required alpha bits.
105      */

106     public int accumAlphaSize;
107
108     /**
109      * The number of multisample buffers used by this context.
110      * During context creation, this specifies the minimum
111      * number of multisample buffers requested.
112      */

113     public int sampleBuffers;
114
115     /**
116      * The number of samples accepted in the multisample buffer.
117      * During creation, pixel formats with the smallest number of
118      * samples that meets or exceeds the specified minimum number
119      * are preferred.
120      */

121     public int samples;
122     
123 /**
124  * Returns a string containing a concise, human-readable
125  * description of the receiver.
126  *
127  * @return a string representation of the data
128  */

129 public String JavaDoc toString() {
130     return (doubleBuffer ? "doubleBuffer," : "") +
131         (stereo ? "stereo," : "") +
132         "r:" + redSize + " g:" + greenSize + " b:" + blueSize + " a:" + alphaSize + "," +
133         "depth:" + depthSize + ",stencil:" + stencilSize +
134         ",accum r:" + accumRedSize + "g:" + accumGreenSize + "b:" + accumBlueSize + "a:" + accumAlphaSize +
135         ",sampleBuffers:" + sampleBuffers + ",samples:" + samples;
136 }
137 }
138
Popular Tags