Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 8 additions & 16 deletions src/ruis/render/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,7 @@ class context : public std::enable_shared_from_this<context>
* @brief Get window coordinates of a point in renderer's clipping coordinates.
* Renderer's clipping coordinates of a point are coordinates after all matrix transformations
* and perspective division.
* The window coordinate system is renderer-specific. It can be top-bottom or bottom-top.
* For example, OpenGL/ES renderer has bottom-top coordinate system, i.e. origin is
* at the bottom left corner of the window and y-axis goes up. So, the resulting position of a point
* should be interpreted in context of the specific renderer.
* The window coordinate system is always top-left origin (x right, y down).
* @return Window coordinates of the point.
*/
virtual r4::vector2<uint32_t> to_window_coords(const ruis::vec2& point) const = 0;
Expand All @@ -228,27 +225,23 @@ class context : public std::enable_shared_from_this<context>
/**
* @brief Get scissor rectangle.
* Get scissor rectangle in application window coordinates.
* TODO:
*
* The window coordinate system is always top-left origin (x right, y down).
* @return Current scissor rectangle.
*/
virtual r4::rectangle<uint32_t> get_scissor() const = 0;

/**
* @brief Set scissor rectangle.
* Set scissor rectangle in application window coordinates.
* TODO:
* The window coordinate system is always top-left origin (x right, y down).
* @param r - new scissor rectangle.
*/
virtual void set_scissor(const r4::rectangle<uint32_t>& r) = 0;

/**
* @brief Get current rendering viewport within application window.
* Get the rendering viewport rectangle in application window coordinates.
* The window coordinate system is renderer-specific. It can be top-bottom or bottom-top.
* For example, OpenGL/ES renderer has bottom-top coordinate system, i.e. origin is
* at the bottom left corner of the window and y-axis goes up. So, the viewport's position
* should be interpreted in context of the specific renderer.
* The window coordinate system is always top-left origin (x right, y down).
* The viewport's dimensions are renderer-agnostic.
* @return Current rendering viewport rectangle.
*/
Expand All @@ -257,11 +250,10 @@ class context : public std::enable_shared_from_this<context>

/**
* @brief Set rendering viewport within application window.
* Since application window's coordinate system is renderer-specific
* (see description of get_viewport() for details), the meaning of the viewport rectangle's
* position is also renderer-specific. Though, the position of (0, 0) in combination with
* framebuffer's dimensions can safely be used regardless of the renderer to set the viewport
* covering the whole framebuffer.
* The viewport rectangle is specified in top-left origin window coordinates
* (x right, y down). The position of (0, 0) in combination with the
* framebuffer's dimensions can safely be used regardless of the renderer
* to set the viewport covering the whole framebuffer.
* @param r - new viewport rectangle.
*/
virtual void set_viewport(const r4::rectangle<uint32_t>& r) = 0;
Expand Down
Loading