
ES20 application problem, Graphicmode with stencil buffer?
Posted Sunday, 27 December, 2009 - 08:12 by aik6980| Project: | The Open Toolkit library |
| Version: | 1.0-beta-3 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
how could I use OpenTK to create ES20 application with stencil buffer?
here is what I use and got error
public Game()
: base (Renderer.PANDORA_SCREEN_WIDTH, Renderer.PANDORA_SCREEN_HEIGHT, new GraphicsMode(16, 8, 8), "Equilibrium", GameWindowFlags.Default, DisplayDevice.Default, 2, 0, GraphicsContextFlags.Embedded)
GraphicsMode: Index: 9, Color: 24 (0888), Depth: 24, Stencil: 8, Samples: 0, Accum: 64 (16161616), Buffers: 2, Stereo: False
IWindowInfo: Windows.WindowInfo: Handle 400008, Parent (Windows.WindowInfo: Handle 8390682, Parent (null))
GraphicsContextFlags: Embedded
error: "EGL window surface not supported" -> something along this line
if I use GraphicsMode(16, 16), the application run fine
application is tested on AMD ES Emulator
any ideas?
ok, I got a workaround on this, which I'm not 100% sure this is the correct way to fix this problem
Here I have modified this line
OpenTK\Platform\Egl\EglContext.cs
Mode = new EglGraphicsMode().SelectGraphicsMode(mode.ColorFormat, mode.Depth, mode.Stencil, mode.Samples, mode.AccumulatorFormat, mode.Buffers, mode.Stereo); if (!Mode.Index.HasValue) throw new GraphicsModeException("Invalid or unsupported GraphicsMode."); // EqFixed: Stencil buffer problem //EGLConfig config = new EGLConfig(mode.Index.Value); EGLConfig config = new EGLConfig(Mode.Index.Value);
the result show that the supported surface has been created, but
public Game()
: base (Renderer.PANDORA_SCREEN_WIDTH, Renderer.PANDORA_SCREEN_HEIGHT, new GraphicsMode(16, 8, 8), "Equilibrium", GameWindowFlags.Default, DisplayDevice.Default, 2, 0, GraphicsContextFlags.Embedded)
why the final surface config shows
GraphicsMode: Index: 9, Color: 24 (0888), Depth: 24, Stencil: 8, Samples: 0, Accum: 64 (16161616), Buffers: 2, Stereo: False
IWindowInfo: Windows.WindowInfo: Handle 2693780, Parent (Windows.WindowInfo: Handle 597098, Parent (null))
GraphicsContextFlags: Embedded
hmm, the graphic mode doesn't show matched surface, 16-8-8(ES) -> 32-24-8(WGL)??


Comments
#1
This is indeed a bug.
#2
Fixed in r2574.
#4
Closing issues fixed in opentk-1.0-beta-3.