All pastes #902018 Raw Edit

Mine

public text v1 · immutable
·published 2008-02-13 02:25 UTC
rendered paste body
using System;
using Tao.Sdl;

namespace SDLexample
{
    class MainScreen
    {
        static public void Main()
        {
            int flags = (Sdl.SDL_HWSURFACE | Sdl.SDL_DOUBLEBUF | Sdl.SDL_ANYFORMAT);
            int bpp = 16;
            int width = 640;
            int height = 480;
            bool quitFlag = false;
            Sdl.SDL_Event evt;

            try
            {
                Sdl.SDL_Init(Sdl.SDL_INIT_EVERYTHING);
                Sdl.SDL_WM_SetCaption("SDL Example.", "");
                IntPtr screen = Sdl.SDL_SetVideoMode(
                    width,
                    height,
                    bpp,
                    flags);

                while (quitFlag == false)
                {
                    Sdl.SDL_PollEvent(out evt);
                    if (evt.type == Sdl.SDL_QUIT)
                    {
                        quitFlag = true;
                    }
                    else if (evt.type == Sdl.SDL_KEYDOWN)
                    {
                        if (evt.key.keysym.sym == (int)Sdl.SDLK_ESCAPE)
                        {
                            quitFlag = true;
                        }
                    }
                    try
                    {
                        Sdl.SDL_Flip(screen);
                    }
                    catch (Exception) { }
                }
            }
            catch
            {
                Sdl.SDL_Quit();
            }
            finally
            {
                Sdl.SDL_Quit();
            }
        }
    }
}