|
128 | 128 | \pnum
|
129 | 129 | Table~\ref{tab:displaysurface.state.listing} specifies the name, type, function, and default value for each item of a display surface's observable state.
|
130 | 130 |
|
131 |
| -\pnum |
132 |
| -Because the \tcode{display_surface} class publicly derives from the \tcode{surface} class, the observable state of a display surface also includes the observable state of a surface, as specified at \ref{surface.state.default}. |
133 |
| - |
134 | 131 | \begin{libreqtab4b}
|
135 | 132 | {Display surface observable state}
|
136 | 133 | {tab:displaysurface.state.listing}
|
|
147 | 144 | This is the brush that shall be used as specified by \tcode{scaling::letterbox} (Table~\ref{tab:scaling.meanings}) &
|
148 | 145 | \tcode{brush\{ \{ bgra_color::black() \} \}} \\ \rowsep
|
149 | 146 |
|
| 147 | + \term{Letterbox Brush Props} & |
| 148 | + \tcode{brush_props} & |
| 149 | + This is the brush properties for the Letterbox Brush & |
| 150 | + \tcode{brush_props\{ \}} \\ \rowsep |
| 151 | + |
150 | 152 | \term{Scaling Type} &
|
151 | 153 | \tcode{scaling} &
|
152 | 154 | When the User Scaling Callback is equal to its default value, this is the type of scaling that shall be used when transferring the Back Buffer to the Display Buffer &
|
|
211 | 213 |
|
212 | 214 | \term{User Scaling Callback} &
|
213 | 215 | \tcode{function<\br
|
214 |
| - \tcode{experimental::}%%\br |
| 216 | + \tcode{experimental::}\br |
215 | 217 | \tcode{io2d::}\br
|
216 | 218 | \tcode{rectangle(}\br
|
217 | 219 | \tcode{const display_surface\&,}\br
|
|
252 | 254 | noexcept;
|
253 | 255 | \end{itemdecl}
|
254 | 256 | \begin{itemdescr}
|
| 257 | +\pnum |
| 258 | +\preconditions |
| 259 | +\tcode{preferredWidth > 0}. |
| 260 | + |
| 261 | +\pnum |
| 262 | +\tcode{preferredHeight > 0}. |
| 263 | + |
| 264 | +\pnum |
| 265 | +\tcode{preferredFormat != experimental::io2d::format::invalid}. |
| 266 | + |
| 267 | + |
255 | 268 | \pnum
|
256 | 269 | \effects
|
257 | 270 | Constructs an object of type \tcode{display_surface}.
|
|
280 | 293 |
|
281 | 294 | \pnum
|
282 | 295 | \errors
|
283 |
| -\tcode{errc::invalid_argument} if \tcode{preferredWidth <= 0}, \tcode{preferredHeight <= 0}, or \tcode{preferredFormat == experimental::io2d::format::invalid}. |
284 |
| - |
285 | 296 | \tcode{io2d::device_error} if successful creation of the \tcode{display_surface} object would exceed the maximum number of simultaneous valid \tcode{display_surface} objects that the implementation supports.
|
286 | 297 |
|
287 | 298 | \pnum
|
|
305 | 316 | noexcept;
|
306 | 317 | \end{itemdecl}
|
307 | 318 | \begin{itemdescr}
|
| 319 | +\pnum |
| 320 | +\preconditions |
| 321 | +\tcode{preferredWidth > 0}. |
| 322 | + |
| 323 | +\pnum |
| 324 | +\tcode{preferredHeight > 0}. |
| 325 | + |
| 326 | +\pnum |
| 327 | +\tcode{preferredDisplayWidth > 0}. |
| 328 | + |
| 329 | +\pnum |
| 330 | +\tcode{preferredDisplayHeight > 0}. |
| 331 | + |
| 332 | +\pnum |
| 333 | +\tcode{preferredFormat != experimental::io2d::format::invalid}. |
| 334 | + |
308 | 335 | \pnum
|
309 | 336 | \effects
|
310 | 337 | Constructs an object of type \tcode{display_surface}.
|
|
333 | 360 |
|
334 | 361 | \pnum
|
335 | 362 | \errors
|
336 |
| -\tcode{errc::invalid_argument} if \tcode{preferredWidth <= 0}, \tcode{preferredHeight <= 0}, \tcode{preferredDisplayWidth <= 0}, \tcode{preferredDisplayHeight <= 0}, or \tcode{preferredFormat == experimental::io2d::format::invalid}. |
337 |
| - |
338 | 363 | \tcode{io2d::device_error} if successful creation of the \tcode{display_surface} object would exceed the maximum number of simultaneous valid \tcode{display_surface} objects that the implementation supports.
|
339 | 364 |
|
340 | 365 | \pnum
|
|
641 | 666 | \indexlibrary{\idxcode{display_surface}!\idxcode{letterbox_brush}}
|
642 | 667 | \indexlibrary{\idxcode{letterbox_brush}!\idxcode{display_surface}}
|
643 | 668 | \begin{itemdecl}
|
644 |
| -void letterbox_brush(experimental::nullvalue_t) noexcept; |
| 669 | +void letterbox_brush(const optional<brush&>b, |
| 670 | + const optional<brush_props>& bp = nullopt); |
| 671 | +void letterbox_brush(const optional<brush&>b, error_code& ec, |
| 672 | + const optional<brush_props>& bp = nullopt) noexcept; |
645 | 673 | \end{itemdecl}
|
646 | 674 | \begin{itemdescr}
|
647 | 675 | \pnum
|
648 | 676 | \effects
|
649 |
| -Sets the Letterbox Brush to its default value. |
650 |
| -\end{itemdescr} |
| 677 | +Sets the Letterbox Brush to the value contained in \tcode{b} if it contains a value, otherwise set Letterbox Brush to its default value. |
651 | 678 |
|
652 |
| -\indexlibrary{\idxcode{display_surface}!\idxcode{letterbox_brush}} |
653 |
| -\indexlibrary{\idxcode{letterbox_brush}!\idxcode{display_surface}} |
654 |
| -\begin{itemdecl} |
655 |
| -void letterbox_brush(const bgra_color& c); |
656 |
| -void letterbox_brush(const bgra_color& c, error_code& ec) noexcept; |
657 |
| -\end{itemdecl} |
658 |
| -\begin{itemdescr} |
659 |
| -\pnum |
660 |
| -\effects |
661 |
| -Sets the Letterbox Brush to a value as-if \tcode{experimental::io2d::brush\{ solid_color_brush_factory\{ \} \}}. |
662 |
| - |
663 |
| -\pnum |
664 |
| -\throws |
665 |
| -As specified in Error reporting (\ref{\iotwod.err.report}). |
666 |
| - |
667 |
| -\pnum |
668 |
| -\errors |
669 |
| -The errors, if any, produced by this function are \impldef{display_surface!letterbox_brush}. |
670 |
| -\end{itemdescr} |
671 |
| - |
672 |
| -\indexlibrary{\idxcode{display_surface}!\idxcode{letterbox_brush}} |
673 |
| -\indexlibrary{\idxcode{letterbox_brush}!\idxcode{display_surface}} |
674 |
| -\begin{itemdecl} |
675 |
| -void letterbox_brush(const experimental::io2d::brush& b); |
676 |
| -void letterbox_brush(const experimental::io2d::brush& b, error_code& ec) |
677 |
| - noexcept; |
678 |
| -\end{itemdecl} |
679 |
| -\begin{itemdescr} |
680 | 679 | \pnum
|
681 |
| -\effects |
682 |
| -Sets the Letterbox Brush to \tcode{b}. |
| 680 | +Sets the Letterbox Brush Props to the value contained in \tcode{bp} if it contains a value, otherwise sets it Letterbox Brush Props to its default value. |
683 | 681 |
|
684 | 682 | \pnum
|
685 | 683 | \throws
|
|
738 | 736 | \begin{itemdescr}
|
739 | 737 | \pnum
|
740 | 738 | \effects
|
741 |
| -When \tcode{display_surface::show} is executing, informs the implementation that it shall call the Draw Callback as soon as possible. |
| 739 | +When \tcode{display_surface::begin_show} is executing, informs the implementation that the Draw Callback must be called as soon as possible. |
742 | 740 | \end{itemdescr}
|
743 | 741 |
|
744 |
| -\indexlibrary{\idxcode{display_surface}!\idxcode{show}} |
745 |
| -\indexlibrary{\idxcode{show}!\idxcode{display_surface}} |
| 742 | +\indexlibrary{\idxcode{display_surface}!\idxcode{begin_show}} |
746 | 743 | \begin{itemdecl}
|
747 |
| -int show(); |
748 |
| -int show(error_code& ec) noexcept; |
| 744 | +int begin_show(); |
749 | 745 | \end{itemdecl}
|
750 | 746 | \begin{itemdescr}
|
751 | 747 | \pnum
|
|
764 | 760 | \end{enumeraten}
|
765 | 761 |
|
766 | 762 | \pnum
|
767 |
| -If \tcode{display_surface::exit_show} is called from the Draw Callback, the implementation shall finish executing the Draw Callback and shall immediately cease to perform any actions in the continuous loop other than handling any implementation and host environment matters. |
| 763 | +If \tcode{display_surface::end_show} is called from the Draw Callback, the implementation shall finish executing the Draw Callback and shall immediately cease to perform any actions in the continuous loop other than handling any implementation and host environment matters needed to exit the loop properly. |
768 | 764 |
|
769 | 765 | \pnum
|
770 | 766 | No later than when this function returns, the output device shall cease to display the contents of the Display Buffer.
|
|
793 | 789 | Other errors, if any, produced by this function are \impldef{display_surface!show}.
|
794 | 790 | \end{itemdescr}
|
795 | 791 |
|
796 |
| -\indexlibrary{\idxcode{display_surface}!\idxcode{exit_show}} |
797 |
| -\indexlibrary{\idxcode{exit_show}!\idxcode{display_surface}} |
| 792 | +\indexlibrary{\idxcode{display_surface}!\idxcode{end_show}} |
798 | 793 | \begin{itemdecl}
|
799 |
| -void exit_show(); |
800 |
| -void exit_show(error_code& ec) noexcept; |
801 |
| -void exit_show(std::chrono::duration d); |
802 |
| -void exit_show(std::chrono::duration d, error_code& ec) noexcept; |
| 794 | +void end_show(); |
803 | 795 | \end{itemdecl}
|
804 | 796 | \begin{itemdescr}
|
805 |
| -\pnum |
806 |
| -\requires |
807 |
| -This function shall only be called from the Draw Callback; no diagnostic is required. |
808 |
| - |
809 | 797 | \pnum
|
810 | 798 | \effects
|
811 |
| -The implementation shall initiate the process of exiting the \tcode{display_surface::show} function's continuous loop. |
812 |
| - |
813 |
| -\pnum |
814 |
| -Implementations shall not wait until the \tcode{display_surface::show} function's continuous loop ends before returning from this function. |
815 |
| - |
816 |
| -\pnum |
817 |
| -Implementations should follow any procedures that the host environment requires in order to cause the \tcode{display_surface::show} function's continuous loop to stop executing without error. |
| 799 | +If this function is called outside of the Draw Callback while it is being executed in the \tcode{display_surface::begin_show} function's continuous loop, it does nothing. |
818 | 800 |
|
819 | 801 | \pnum
|
820 |
| -A \term{termination time duration} shall then be determined as follows: |
821 |
| -\begin{itemize} |
822 |
| -\item If no \tcode{std::chrono::duration} is provided, the termination time duration is \unspecnorm. Implementations should exit the \tcode{display_surface::show} function's continuous loop as soon as the host environment allows. |
823 |
| -\item Otherwise, implementations shall exit the \tcode{display_surface::show} function's continuous loop as soon as the host environment allows once the \tcode{std::chrono::duration} value has elapsed. |
824 |
| -\end{itemize} |
| 802 | +Otherwise, the implementation initiates the process of exiting the \tcode{display_surface::begin_show} function's continuous loop. |
825 | 803 |
|
826 | 804 | \pnum
|
827 |
| -The implementation shall continue to execute the \tcode{display_surface::show} function until it returns or until termination time duration milliseconds have passed since the termination time duration was determined, whichever comes first. |
| 805 | +If possible, any procedures that the host environment requires in order to cause the \tcode{display_surface::show} function's continuous loop to stop executing without error should be followed. |
828 | 806 |
|
829 | 807 | \pnum
|
830 |
| -If the \tcode{display_surface::show} function has not returned before termination time duration milliseconds have passed since the termination time duration was determined the implementation shall force the \tcode{display_surface::show} function's continuous loop to stop executing and shall then cause \tcode{display_surface::show} to return. |
| 808 | +The \tcode{display_surface::begin_show} function's loop continues execution until it returns. |
831 | 809 | \end{itemdescr}
|
832 | 810 |
|
833 | 811 | \rSec1 [displaysurface.observers]{\tcode{display_surface} observers}
|
|
890 | 868 | \indexlibrary{\idxcode{display_surface}!\idxcode{dimensions}}
|
891 | 869 | \indexlibrary{\idxcode{dimensions}!\idxcode{display_surface}}
|
892 | 870 | \begin{itemdecl}
|
893 |
| -tuple<int, int> dimensions() const noexcept; |
| 871 | +vector_2d dimensions() const noexcept; |
894 | 872 | \end{itemdecl}
|
895 | 873 | \begin{itemdescr}
|
896 | 874 | \pnum
|
897 | 875 | \returns
|
898 |
| -A \tcode{tuple<int, int>} where the first element is the Draw Width and the second element is the Draw Height. |
| 876 | +A \tcode{vector_2d} constructed using the Draw Width as the first argument and the Draw Height as the second argument. |
899 | 877 | \end{itemdescr}
|
900 | 878 |
|
901 | 879 | \indexlibrary{\idxcode{display_surface}!\idxcode{display_dimensions}}
|
902 | 880 | \indexlibrary{\idxcode{display_dimensions}!\idxcode{display_surface}}
|
903 | 881 | \begin{itemdecl}
|
904 |
| -tuple<int, int> display_dimensions() const noexcept; |
| 882 | +vector_2d display_dimensions() const noexcept; |
905 | 883 | \end{itemdecl}
|
906 | 884 | \begin{itemdescr}
|
907 | 885 | \pnum
|
908 | 886 | \returns
|
909 |
| -A \tcode{tuple<int, int>} where the first element is the Display Width and the second element is the Display Height. |
| 887 | +A \tcode{vector_2d} constructed using the Display Width as the first argument and the Display Height as the second argument. |
910 | 888 | \end{itemdescr}
|
911 | 889 |
|
912 | 890 | \indexlibrary{\idxcode{display_surface}!\idxcode{scaling}}
|
|
945 | 923 | \indexlibrary{\idxcode{display_surface}!\idxcode{letterbox_brush}}
|
946 | 924 | \indexlibrary{\idxcode{letterbox_brush}!\idxcode{display_surface}}
|
947 | 925 | \begin{itemdecl}
|
948 |
| -experimental::io2d::brush letterbox_brush() const noexcept; |
| 926 | +optional<brush> letterbox_brush() const noexcept; |
949 | 927 | \end{itemdecl}
|
950 | 928 | \begin{itemdescr}
|
951 | 929 | \pnum
|
952 | 930 | \returns
|
953 |
| -The Letterbox Brush. |
| 931 | +A \tcode{optional<brush>} object constructed using the user-provided Letterbox Brush or, if no user-provided Letterbox Brush is set, an empty \tcode{optional<brush>} object. |
954 | 932 | \end{itemdescr}
|
955 | 933 |
|
956 | 934 | \indexlibrary{\idxcode{display_surface}!\idxcode{auto_clear}}
|
|
0 commit comments