Ejemplo n.º 1
0
        /// <summary>
        /// Create and add a render profile based on its type
        /// </summary>

        public void AddRenderProfile(Type renderProfileType)
        {
            /// Instantiate a render profile with the resource content manager
            RenderProfile profile =
                (RenderProfile)Activator.CreateInstance(renderProfileType, ServiceContainer, resxContent);

            renderProfiles.Add(profile);
            currentRenderProfile = renderProfiles[renderProfiles.Count - 1];
            currentRenderProfile.MapInputs(currentScene, currentCamera);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create and add a render profile based on its type
        /// </summary>

        public void AddRenderProfile(Type renderProfileType)
        {
            /// Instantiate a render profile with the resource content manager
            RenderProfile profile =
                (RenderProfile)Activator.CreateInstance(renderProfileType, graphicsDevice, content);

            renderProfiles.Add(profile);
            currentRenderProfile = profile;
            currentRenderProfile.MapInputs();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Update viewport and rendertarget profiles for when window has been resized
        /// </summary>

        public void SetViewportSize(int viewportWidth, int viewportHeight)
        {
            Viewport viewport = graphicsDevice.Viewport;

            viewport.Width  = Math.Max(1, viewportWidth);
            viewport.Height = Math.Max(1, viewportHeight);

            // Resize the viewport for newer render targets
            graphicsDevice.Viewport = viewport;

            // Reset the camera and render profile
            currentCamera.Initialize(viewportWidth, viewportHeight);
            currentRenderProfile.Initialize();

            // Reset the profile inputs
            currentRenderProfile.MapInputs();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Update viewport and rendertarget profiles for when window has been resized
        /// </summary>

        public void SetViewportSize(int viewportWidth, int viewportHeight)
        {
            Viewport v = graphicsDevice.Viewport;

            v.Width  = viewportWidth;
            v.Height = viewportHeight;

            graphicsDevice.Viewport = v;

            targetWidth  = (float)graphicsDevice.Viewport.Width;
            targetHeight = (float)graphicsDevice.Viewport.Height;

            // Restart the render profile
            currentCamera.Initialize(targetWidth, targetHeight);
            currentRenderProfile.Initialize();

            // Reset the inputs
            currentRenderProfile.MapInputs(currentScene, currentCamera);
        }