Does this draw the content of view to surface or viewport to surface? If it draws the content of viewport to the surface, why does it say "generally the surface used for this function should be the size of the view camera itself (not the viewport)."?With this variable, you can set the contents of a given viewport to draw to a surface, or get the current surface id if one has been assigned to a viewport. When working with surfaces, it is often required that you capture the whole visible region of the screen to the surface, and so you would assign it to a viewport using this variable. This means that everything that is shown in the chosen view will now be drawn to the assigned surface. The view will now not be drawn to the screen, meaning that you will need to either:
You can also read this variable to get the index of the surface that has been assigned to the chosen view or it will return -1 if no surface has been assigned, and generally, the surface used for this function should be the size of the view camera itself (not the viewport). The extended example below shows a basic setup for capturing a view and drawing it in the Draw GUI event, and for more information on surfaces see the section Surfaces.
Note that you can also set a viewport to a surface using the function view_set_surface_id().
What's the difference between draw view to surface or draw viewport to surface? My understanding is that there is a transformation between the content of view and the content of viewport.