-
Notifications
You must be signed in to change notification settings - Fork 69
Define arbitrary clipping regions #300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
dc8cab9
724fd06
44cd890
c121e94
44d0e3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| #ifndef SP_GRAPHICS_RENDERTARGET_H | ||
| #define SP_GRAPHICS_RENDERTARGET_H | ||
| #pragma once | ||
|
|
||
| #include <glm/vec2.hpp> | ||
| #include <glm/gtc/type_precision.hpp> | ||
|
|
@@ -70,6 +69,24 @@ class RenderTarget : sp::NonCopyable | |
| void drawStretchedHVClipped(sp::Rect rect, sp::Rect clip_rect, float corner_size, std::string_view texture, glm::u8vec4 color={255,255,255,255}); | ||
|
|
||
| void finish(); | ||
|
|
||
| // Functions for using rect masks with glScissor to clip a render. | ||
|
|
||
| // Stack nested rects to determine the mask's bounds. | ||
| void pushScissorRect(sp::Rect virtual_rect); | ||
| // Remove a nested rect from the mask. | ||
| void popScissorRect(); | ||
|
|
||
| // Functions for translating nested renders between virtual and real pixels. | ||
|
|
||
| // Stack nested translation vectors to determine their offsets relative to | ||
| // the container and each other. | ||
| void pushTranslation(glm::vec2 virtual_offset); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if I like these. Feels like a recipe for confusion in combination with the layout managers of the GUI system.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed them and implemented scroll_offset in |
||
| // Remove a nested translation vector. | ||
| void popTranslation(); | ||
| // Get the total translation vector from the top of the stack. | ||
| glm::vec2 getTranslation() const; | ||
|
|
||
| struct VertexData | ||
| { | ||
| glm::vec2 position; | ||
|
|
@@ -89,5 +106,3 @@ class RenderTarget : sp::NonCopyable | |
| }; | ||
|
|
||
| } | ||
|
|
||
| #endif//SP_GRAPHICS_RENDERTARGET_H | ||
Uh oh!
There was an error while loading. Please reload this page.