Ejemplo n.º 1
0
 public Context(RenderWindow window,ResourceHolder<Texture,TextureID> textures, ResourceHolder<Font,FontID> fonts, Player player)
 {
     mWindow = window;
     mTextures = textures;
     mFonts = fonts;
     mPlayer = player;
 }
Ejemplo n.º 2
0
        public GameApplication()
        {
            mWindow = new RenderWindow(new VideoMode(640, 480), "SFML App", Styles.Close);
            mWindow.SetKeyRepeatEnabled(false);

            mPlayer = new Player();

            mTextures = new ResourceHolder<Texture, TextureID>();

            mFonts = new ResourceHolder<Font, FontID>();
            mFonts.load(FontID.Title, "Assets/KarmaFuture.ttf");

            mStateStack = new StateStack(new Context(mWindow, mTextures, mFonts, mPlayer));
            eventqueue = new Queue<Input.Event>();

            registerStates();
            mStateStack.pushState(StateID.Title);

            mWindow.Closed += onClosed;
            mWindow.GainedFocus += gainedFocus;
            mWindow.LostFocus += lostFocus;
            mWindow.KeyPressed += keyPressed;
        }