Exemple #1
0
        public bool ShowViewer(IntPtr handle, int width, int height, bool isOpenGLMode = false)
        {
            if (isViewerShown)
            {
                return(false);
            }

            if (native == null)
            {
                throw new Exception("native is null.");
            }

            if (native.CreateWindow_Effekseer(
                    handle, width <= 0 ? 1 : width,
                    height <= 0 ? 1 : height,
                    Core.Option.ColorSpace.Value == Data.OptionValues.ColorSpaceType.LinearSpace,
                    isOpenGLMode))
            {
                isViewerShown = true;
                return(true);
            }
            else
            {
                Core.OnOutputMessage("描画画面の生成に失敗しました。DirectXのバージョンの問題、メモリの不足等が考えられます。");
            }

            return(false);
        }
Exemple #2
0
        public bool ShowViewer(IntPtr handle, int width, int height, swig.DeviceType deviceType)
        {
            if (isViewerShown)
            {
                return(false);
            }

            if (native == null)
            {
                throw new Exception("native is null.");
            }

            ViewPointController = new swig.ViewPointController();

            ViewPointController.ProjectionStyle = deviceType == swig.DeviceType.OpenGL ? swig.ProjectionMatrixStyle.OpenGLStyle : swig.ProjectionMatrixStyle.DirectXStyle;

            if (native.CreateWindow_Effekseer(
                    handle,
                    width <= 0 ? 1 : width,
                    height <= 0 ? 1 : height,
                    Core.Option.ColorSpace.Value == Data.OptionValues.ColorSpaceType.LinearSpace,
                    deviceType))
            {
                isViewerShown = true;
            }
            else
            {
                var message = MultiLanguageTextProvider.GetText("System_FailedToInitialize");
                Core.OnOutputMessage(message);
                return(false);
            }

            ViewMode_OnChanged(null, null);
            Core.Option.ViewerMode.OnChanged += ViewMode_OnChanged;

            Core.Option.RenderingMode.OnChanged += RenderingMode_OnChanged;
            RenderingMode_OnChanged(null, null);

            Bloom_OnChanged(null, null);
            Core.Environment.PostEffect.BloomSwitch.OnChanged     += Bloom_OnChanged;
            Core.Environment.PostEffect.Bloom.Intensity.OnChanged += Bloom_OnChanged;
            Core.Environment.PostEffect.Bloom.Threshold.OnChanged += Bloom_OnChanged;
            Core.Environment.PostEffect.Bloom.SoftKnee.OnChanged  += Bloom_OnChanged;

            Tonemap_OnChanged(null, null);
            Core.Environment.PostEffect.TonemapSelector.OnChanged          += Tonemap_OnChanged;
            Core.Environment.PostEffect.TonemapReinhard.Exposure.OnChanged += Tonemap_OnChanged;

            effectFactory = new swig.EffectFactory(native);

            return(true);
        }
Exemple #3
0
        public bool ShowViewer(IntPtr handle, int width, int height, swig.DeviceType deviceType)
        {
            if (isViewerShown)
            {
                return(false);
            }

            if (native == null)
            {
                throw new Exception("native is null.");
            }

            if (native.CreateWindow_Effekseer(
                    handle,
                    width <= 0 ? 1 : width,
                    height <= 0 ? 1 : height,
                    Core.Option.ColorSpace.Value == Data.OptionValues.ColorSpaceType.LinearSpace,
                    deviceType))
            {
                isViewerShown = true;
            }
            else
            {
                if (Core.Language == Language.Japanese)
                {
                    Core.OnOutputMessage("描画画面の生成に失敗しました。DirectXのバージョンの問題、メモリの不足等が考えられます。");
                }
                else
                {
                    Core.OnOutputMessage("Failed to generate drawing screen. DirectX version problems, memory shortage, and so on.");
                }
                return(false);
            }

            ViewMode_OnChanged(null, null);
            Core.Option.ViewerMode.OnChanged += ViewMode_OnChanged;

            Bloom_OnChanged(null, null);
            Core.Environment.PostEffect.BloomSwitch.OnChanged     += Bloom_OnChanged;
            Core.Environment.PostEffect.Bloom.Intensity.OnChanged += Bloom_OnChanged;
            Core.Environment.PostEffect.Bloom.Threshold.OnChanged += Bloom_OnChanged;
            Core.Environment.PostEffect.Bloom.SoftKnee.OnChanged  += Bloom_OnChanged;

            Tonemap_OnChanged(null, null);
            Core.Environment.PostEffect.TonemapSelector.OnChanged          += Tonemap_OnChanged;
            Core.Environment.PostEffect.TonemapReinhard.Exposure.OnChanged += Tonemap_OnChanged;

            return(true);
        }
Exemple #4
0
        public bool ShowViewer(IntPtr handle, int width, int height, swig.DeviceType deviceType)
        {
            if (isViewerShown)
            {
                return(false);
            }

            if (native == null)
            {
                throw new Exception("native is null.");
            }

            if (native.CreateWindow_Effekseer(
                    handle,
                    width <= 0 ? 1 : width,
                    height <= 0 ? 1 : height,
                    Core.Option.ColorSpace.Value == Data.OptionValues.ColorSpaceType.LinearSpace,
                    deviceType))
            {
                isViewerShown = true;
                return(true);
            }
            else
            {
                if (Core.Language == Language.Japanese)
                {
                    Core.OnOutputMessage("描画画面の生成に失敗しました。DirectXのバージョンの問題、メモリの不足等が考えられます。");
                }
                else
                {
                    Core.OnOutputMessage("Failed to generate drawing screen. DirectX version problems, memory shortage, and so on.");
                }
            }

            return(false);
        }