protected override OpenGLContext CreateContext() { ControlGLContext context = new ControlGLContext(this); DisplayType displayType = new DisplayType(COLOR_DEPTH, Z_DEPTH, STENCIL_DEPTH, ACCUM_DEPTH); context.Create(displayType, null); return(context); }
protected override OpenGLContext CreateContext() { ControlGLContext context = new ControlGLContext(this); DisplayType displayType = new DisplayType(32, 32, 32, 32); context.Create(displayType, null); return(context); }
// --- Protected Methods --- #region CreateContext() /// <summary> /// Overrides the creation of the OpenGL context. /// </summary> /// <returns>An OpenGLContext.</returns> protected override OpenGLContext CreateContext() { // Setup Our PixelFormat And Context ControlGLContext context = new ControlGLContext(this); DisplayType displayType = new DisplayType(App.ColorDepth, App.ZDepth, App.StencilDepth, App.AccumDepth); context.Create(displayType, null); return(context); }
protected override OpenGLContext CreateContext() { ControlGLContext ctxt = new ControlGLContext(this); int i, n = ctxt.NumPixelFormats; // try hard to have a palette... for (i = 0; i < n; i++) { DisplayType dt = ctxt.GetPixelFormat(i); if (!dt.isRgba && dt.cColorBits <= 16) { if ((int)(dt.flags & DisplayFlags.DRAW_TO_WINDOW) == 0) { continue; } ctxt.Create(i, null); break; } } if (i == n) { ctxt.Create(new DisplayType(0, 0), null); } Console.WriteLine(ctxt.PixelFormat); Palette pal = ctxt.Palette; if (pal != null) { pal[23] = new Palette.Color(0, 128, 0); pal.Sync(); isPaletized = true; } else { isPaletized = false; } Console.WriteLine(isPaletized ? "use palette" : "no palette"); ctxt.Grab(); InitGLContext(); return(ctxt); }
/// <summary> /// Overrides the creation of the OpenGL context. /// </summary> /// <returns>An OpenGLContext.</returns> protected override OpenGLContext CreateContext() { // Setup Our PixelFormat And Context ControlGLContext context = new ControlGLContext(this); DisplayType displayType = new DisplayType(App.ColorDepth, App.ZDepth, App.StencilDepth, App.AccumDepth); context.Create(displayType, null); return context; }