]> git.sesse.net Git - casparcg/commitdiff
Merged borderless screen consumer support from 2.0
authorHelge Norberg <helge.norberg@svt.se>
Fri, 21 Aug 2015 13:21:07 +0000 (15:21 +0200)
committerHelge Norberg <helge.norberg@svt.se>
Fri, 21 Aug 2015 13:21:07 +0000 (15:21 +0200)
modules/screen/consumer/screen_consumer.cpp
shell/casparcg.config

index 4d6887164b9d21e0a0a3818e55f4e4d33e2ebb84..c57cb6b397a5705c09d78d3f0cce5f18dc428ac2 100644 (file)
@@ -106,6 +106,7 @@ struct configuration
        aspect_ratio    aspect                          = aspect_ratio::aspect_invalid;
        bool                    vsync                           = true;
        bool                    interactive                     = true;
+       bool                    borderless                      = false;
 };
 
 struct screen_consumer : boost::noncopyable
@@ -228,7 +229,12 @@ public:
 
        void init()
        {
-               window_.create(sf::VideoMode(screen_width_, screen_height_, 32), u8(L"Screen consumer " + channel_and_format()), config_.windowed ? sf::Style::Resize | sf::Style::Close : sf::Style::Fullscreen);
+               auto window_style = config_.borderless
+                       ? sf::Style::None
+                       : (config_.windowed
+                               ? sf::Style::Resize | sf::Style::Close
+                               : sf::Style::Fullscreen);
+               window_.create(sf::VideoMode(screen_width_, screen_height_, 32), u8(L"Screen consumer " + channel_and_format()), window_style);
                window_.setMouseCursorVisible(config_.interactive);
                window_.setPosition(sf::Vector2i(screen_x_, screen_y_));
                window_.setSize(sf::Vector2u(screen_width_, screen_height_));
@@ -667,6 +673,7 @@ void describe_consumer(core::help_sink& sink, const core::help_repository& repo)
                        L"SCREEN "
                        L"{[screen_index:int]|1} "
                        L"{[fullscreen:FULLSCREEN]} "
+                       L"{[borderless:BORDERLESS]} "
                        L"{[key_only:KEY_ONLY]} "
                        L"{[non_interactive:NON_INTERACTIVE]} "
                        L"{[no_auto_deinterlace:NO_AUTO_DEINTERLACE]} "
@@ -675,6 +682,7 @@ void describe_consumer(core::help_sink& sink, const core::help_repository& repo)
        sink.definitions()
                ->item(L"screen_index", L"Determines which screen the channel should be displayed on. Defaults to 1.")
                ->item(L"fullscreen", L"If specified opens the window in fullscreen.")
+               ->item(L"borderless", L"Makes the window appear without any window decorations.")
                ->item(L"key_only", L"Only displays the alpha channel of the video channel if specified.")
                ->item(L"non_interactive", L"If specified does not send mouse input to producers on the video channel.")
                ->item(L"no_auto_deinterlace", L"If the video mode of the channel is an interlaced mode, specifying this will turn of deinterlacing.")
@@ -683,6 +691,7 @@ void describe_consumer(core::help_sink& sink, const core::help_repository& repo)
        sink.example(L">> ADD 1 SCREEN", L"opens a screen consumer on the default screen.");
        sink.example(L">> ADD 1 SCREEN 2", L"opens a screen consumer on the screen 2.");
        sink.example(L">> ADD 1 SCREEN 1 FULLSCREEN", L"opens a screen consumer in fullscreen on screen 1.");
+       sink.example(L">> ADD 1 SCREEN 1 BORDERLESS", L"opens a screen consumer without borders/window decorations on screen 1.");
 }
 
 spl::shared_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params, core::interaction_sink* sink)
@@ -699,6 +708,7 @@ spl::shared_ptr<core::frame_consumer> create_consumer(const std::vector<std::wst
        config.key_only                 =  contains_param(L"KEY_ONLY", params);
        config.interactive              = !contains_param(L"NON_INTERACTIVE", params);
        config.auto_deinterlace = !contains_param(L"NO_AUTO_DEINTERLACE", params);
+       config.borderless               =  contains_param(L"BORDERLESS", params);
 
        if (contains_param(L"NAME", params))
                config.name = get_param(L"NAME", params);
@@ -716,6 +726,7 @@ spl::shared_ptr<core::frame_consumer> create_preconfigured_consumer(const boost:
        config.auto_deinterlace = ptree.get(L"auto-deinterlace",        config.auto_deinterlace);
        config.vsync                    = ptree.get(L"vsync",                           config.vsync);
        config.interactive              = ptree.get(L"interactive",                     config.interactive);
+       config.borderless               = ptree.get(L"borderless",                      config.borderless);
 
        auto stretch_str = ptree.get(L"stretch", L"default");
        if(stretch_str == L"uniform")
index 82a5493331a3eb939ff550e528fa677684317847..5c1c4096cd4da446a85ce1903297fd2d1a4bf24c 100644 (file)
@@ -90,6 +90,7 @@
                 <auto-deinterlace>true [true|false]</auto-deinterlace>\r
                 <vsync>false [true|false]</vsync>\r
                 <interactive>true [true|false]</interactive>\r
+                <borderless>false [true|false]</borderless>\r
             </screen>\r
             <newtek-ivga></newtek-ivga>\r
             <file>\r