Shocker's picture

Stencil Buffer in WinForm + GLControl Application

I made an application which uses stencil buffer . It draws polygon with hole .
But this couldn't make a hole .
Perhaps, can't I use stencil buffer in GLControl ?

I'm sorry my poor English .

AttachmentSize
Form1.cs5.83 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

OpenTK will not create a stencil buffer, unless you explicitly request one. Create a new control that inherits from GLControl and add a constructor like this:

class CustomGLControl : GLControl
{
    public CustomGLControl()
        : base(new GraphicsMode(32, 24, 8))
    { }
}

Use the new control in place of the GLControl and it should work fine.

Shocker's picture

Thanks !
I made a class which inherits GLControl , and I executed a new program .
It came to be able to render a polygon with hole .