| | 154 | } |
| | 155 | |
| | 156 | GraphicsContext::Traits::Traits(DisplaySettings* ds): |
| | 157 | x(0), |
| | 158 | y(0), |
| | 159 | width(0), |
| | 160 | height(0), |
| | 161 | windowDecoration(false), |
| | 162 | supportsResize(true), |
| | 163 | red(8), |
| | 164 | blue(8), |
| | 165 | green(8), |
| | 166 | alpha(0), |
| | 167 | depth(24), |
| | 168 | stencil(0), |
| | 169 | sampleBuffers(0), |
| | 170 | samples(0), |
| | 171 | pbuffer(false), |
| | 172 | quadBufferStereo(false), |
| | 173 | doubleBuffer(false), |
| | 174 | target(0), |
| | 175 | format(0), |
| | 176 | level(0), |
| | 177 | face(0), |
| | 178 | mipMapGeneration(false), |
| | 179 | vsync(true), |
| | 180 | useMultiThreadedOpenGLEngine(false), |
| | 181 | useCursor(true), |
| | 182 | glContextVersion("1.0"), |
| | 183 | glContextFlags(0), |
| | 184 | glContextProfileMask(0), |
| | 185 | sharedContext(0), |
| | 186 | setInheritedWindowPixelFormat(false), |
| | 187 | overrideRedirect(false) |
| | 188 | { |
| | 189 | if (ds) |
| | 190 | { |
| | 191 | alpha = ds->getMinimumNumAlphaBits(); |
| | 192 | stencil = ds->getMinimumNumStencilBits(); |
| | 193 | sampleBuffers = ds->getMultiSamples(); |
| | 194 | samples = ds->getNumMultiSamples(); |
| | 195 | if (ds->getStereo()) |
| | 196 | { |
| | 197 | switch(ds->getStereoMode()) |
| | 198 | { |
| | 199 | case(osg::DisplaySettings::QUAD_BUFFER): quadBufferStereo = true; break; |
| | 200 | case(osg::DisplaySettings::VERTICAL_INTERLACE): |
| | 201 | case(osg::DisplaySettings::CHECKERBOARD): |
| | 202 | case(osg::DisplaySettings::HORIZONTAL_INTERLACE): stencil = 8; break; |
| | 203 | default: break; |
| | 204 | } |
| | 205 | } |
| | 206 | |
| | 207 | glContextVersion = ds->getGLContextVersion(); |
| | 208 | glContextFlags = ds->getGLContextFlags(); |
| | 209 | glContextProfileMask = ds->getGLContextProfileMask(); |
| | 210 | } |