Beispiel #1
0
		public ServiceTest()
		{
			Scheduler = new ThreadedGameLoop(null, "TestThread1");
			PrimaryScheduler = new ThreadedGameLoop(null, "TestThread2");
			Module = new TestModule(null, Scheduler);
			Settings = Module.GetSettings(PrimaryScheduler) as TestService;
		}
Beispiel #2
0
        /// <summary>
        /// Makes a new instance of <see cref="GameHost"/> class.
        /// </summary>
        public GameHost()
        {
            // - Initialize environment if not initialized
            pEngine.Platform.Environment.Initialize();

            // - Make game loops
            InputGameLoop   = new GameLoop(HandleInput, InputInitialization, "InputThread");
            PhysicsGameLoop = new ThreadedGameLoop(HandlePhysics, PhysicsInitialization, "PhysicsThread");

            // - Modules
            Input    = new InputEngine(this, InputGameLoop);
            GameTree = new GameTree(this, PhysicsGameLoop);
            Windows  = new WindowsProvider(this, InputGameLoop);
        }
Beispiel #3
0
        /// <summary>
        /// Initialize the pEngine runtime.
        /// </summary>
        public Runtime()
        {
            // - Initialize debug manager
            Debug.Initialize();

            // - Create a game loop on the main thread because this thread is going to talk with the OS
            InputGameLoop = new GameLoop(InputFunction, InputInit, "InputGameLoop");

            // - Create a threaded update gameloop, we want to run the update in a separate thread
            UpdateGameLoop = new ThreadedGameLoop(UpdateFunction, UpdateInit, "UpdateGameLoop");

            // - Create a threaded render loop, this thread will manage all GPU settings and actions
            GraphicGameLoop = new ThreadedGameLoop(RenderFunction, GraphicInit, "RenderGameLoop");

            // - Initialize resource queues
            ResourceStash = new List <Resource.IDescriptor>();

            // - Initialize graphic buffer
            GraphicRenderBuffer = new TripleBuffer <Asset[]>();
        }