Introduction

This sample explains how to render graphics with multisample antialiasing. It uses the same code as the simple GameWindow sample, so refer to that for an explanation on the various event handlers.

Controls

Move or resize the window with your mouse.
Press F11 to toggle between fullscreen and windowed modes.
Press Esc to exit.

Implementation

The GameWindow offers various constructors that allow you to specify the exact GraphicsMode for the constructed GraphicsContext. The "samples" parameter represents the level of antialiasing you wish to use.

In order to enable multisample antialiasing, simply pass a positive integer to the samples parameter. Typical values are 2, 4, 6, 8 and 16, but the exact list depends on the capabilities of your video card.

If you pass an unsupported value, context construction may fail with a GraphicsModeException. However, some drivers may simply ignore unsupported samples values.