annotate dwt/opengl/GLData.d @ 212:ab60f3309436

reverted the char[] to String and use the an alias.
author Frank Benoit <benoit@tionex.de>
date Mon, 05 May 2008 00:12:38 +0200
parents 8d7572b6f3f6
children fd9c62a2998e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
212
ab60f3309436 reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents: 126
diff changeset
1 /*******************************************************************************
126
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
2 * Copyright (c) 2005, 2006 IBM Corporation and others.
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
3 * All rights reserved. This program and the accompanying materials
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
4 * are made available under the terms of the Eclipse Public License v1.0
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
5 * which accompanies this distribution, and is available at
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
6 * http://www.eclipse.org/legal/epl-v10.html
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
7 *
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
8 * Contributors:
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
9 * IBM Corporation - initial API and implementation
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
10 * Port to the D Programming Language:
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
11 * John Reimer <terminal.node@gmail.com>
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
12 *******************************************************************************/
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
13 module dwt.opengl.GLData;
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
14
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
15 import tango.text.Util;
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
16 import tango.util.Convert;
212
ab60f3309436 reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents: 126
diff changeset
17 import dwt.dwthelper.utils;
126
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
18
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
19 /**
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
20 * The GLData class is a device-independent description
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
21 * of the pixel format attributes of a GL drawable.
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
22 *
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
23 * @see GLCanvas
212
ab60f3309436 reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents: 126
diff changeset
24 *
126
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
25 * @since 3.2
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
26 */
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
27
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
28 public class GLData {
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
29 /**
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
30 * Specifies a double-buffered surface. During context
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
31 * creation, only double-buffered formats are considered
212
ab60f3309436 reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents: 126
diff changeset
32 * when set to true.
126
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
33 */
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
34 public bool doubleBuffer;
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
35
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
36 /**
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
37 * Specifies a stereo surface. During context creation,
212
ab60f3309436 reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents: 126
diff changeset
38 * only stereo formats are considered when set to true.
126
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
39 */
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
40 public bool stereo;
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
41
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
42 /**
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
43 * The size in bits of the color buffer's red channel.
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
44 * During context creation, this specifies the minimum
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
45 * required red bits.
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
46 */
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
47 public int redSize;
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
48
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
49 /**
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
50 * The size in bits of the color buffer's green channel.
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
51 * During context creation, this specifies the minimum
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
52 * required green bits.
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
53 */
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
54 public int greenSize;
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
55
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
56 /**
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
57 * The size in bits of the color buffer's blue channel.
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
58 * During context creation, this specifies the minimum
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
59 * required blue bits.
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
60 */
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
61 public int blueSize;
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
62
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
63 /**
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
64 * The size in bits of the color buffer's alpha channel.
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
65 * During context creation, this specifies the minimum
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
66 * required alpha bits.
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
67 */
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
68 public int alphaSize;
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
69
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
70 /**
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
71 * The size in bits of the depth buffer. During context
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
72 * creation, the smallest depth buffer of at least the
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
73 * specified value is preferred, or zero for no depth
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
74 * buffer.
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
75 */
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
76 public int depthSize;
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
77
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
78 /**
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
79 * The desired number of stencil bitplanes. During
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
80 * context creation, the smallest stencil buffer of at
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
81 * least the specified value is preferred, or zero for
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
82 * no stencil buffer.
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
83 */
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
84 public int stencilSize;
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
85
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
86 /**
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
87 * The size in bits of the accumulation buffer's red
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
88 * channel. During context creation, this specifies the
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
89 * minimum required red bits.
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
90 */
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
91 public int accumRedSize;
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
92
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
93 /**
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
94 * The size in bits of the accumulation buffer's green
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
95 * channel. During context creation, this specifies the
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
96 * minimum required green bits.
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
97 */
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
98 public int accumGreenSize;
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
99
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
100 /**
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
101 * The size in bits of the accumulation buffer's blue
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
102 * channel. During context creation, this specifies the
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
103 * minimum required blue bits.
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
104 */
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
105 public int accumBlueSize;
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
106
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
107 /**
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
108 * The size in bits of the accumulation buffer's alpha
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
109 * channel. During context creation, this specifies the
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
110 * minimum required alpha bits.
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
111 */
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
112 public int accumAlphaSize;
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
113
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
114 /**
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
115 * The number of multisample buffers used by this context.
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
116 * During context creation, this specifies the minimum
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
117 * number of multisample buffers requested.
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
118 */
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
119 public int sampleBuffers;
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
120
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
121 /**
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
122 * The number of samples accepted in the multisample buffer.
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
123 * During creation, pixel formats with the smallest number of
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
124 * samples that meets or exceeds the specified minimum number
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
125 * are preferred.
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
126 */
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
127 public int samples;
212
ab60f3309436 reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents: 126
diff changeset
128
126
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
129 /**
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
130 * Returns a string containing a concise, human-readable
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
131 * description of the receiver.
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
132 *
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
133 * @return a string representation of the data
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
134 */
212
ab60f3309436 reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents: 126
diff changeset
135 override public String toString() {
ab60f3309436 reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents: 126
diff changeset
136 String string = doubleBuffer ? "doubleBuffer," : "";
126
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
137 string ~= stereo ? "stereo," : "";
212
ab60f3309436 reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents: 126
diff changeset
138 string ~= "r:" ~ to!(String)(redSize) ~ " g:" ~ to!(String)(greenSize) ~
ab60f3309436 reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents: 126
diff changeset
139 " b:" ~ to!(String)(blueSize) ~ " a:" ~ to!(String)(alphaSize) ~ "," ~
ab60f3309436 reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents: 126
diff changeset
140 "depth:" ~ to!(String)(depthSize) ~ ",stencil:" ~ to!(String)(stencilSize) ~
ab60f3309436 reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents: 126
diff changeset
141 ",accum r:" ~ to!(String)(accumRedSize) ~ "g:" ~ to!(String)(accumGreenSize) ~
ab60f3309436 reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents: 126
diff changeset
142 "b:" ~ to!(String)(accumBlueSize) ~ "a:" ~ to!(String)(accumAlphaSize) ~
ab60f3309436 reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents: 126
diff changeset
143 ",sampleBuffers:" ~ to!(String)(sampleBuffers) ~ ",samples:" ~ to!(String)(samples);
126
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
144 return string;
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
145 }
8d7572b6f3f6 Add OpenGL Support
John Reimer <terminal.node@gmail.com
parents:
diff changeset
146 }