瀏覽代碼

Improved BeginScissorMode()

Now rectangle coordinates refer to upper-left corner instead of bottom-left
pull/703/head
Ray 6 年之前
父節點
當前提交
af33e3848e
共有 1 個檔案被更改,包括 2 行新增1 行删除
  1. +2
    -1
      src/rlgl.h

+ 2
- 1
src/rlgl.h 查看文件

@ -3283,12 +3283,13 @@ void EndBlendMode(void)
} }
// Begin scissor mode (define screen area for following drawing) // Begin scissor mode (define screen area for following drawing)
// NOTE: Scissor rec refers to bottom-left corner, we change it to upper-left
void BeginScissorMode(int x, int y, int width, int height) void BeginScissorMode(int x, int y, int width, int height)
{ {
rlglDraw(); // Force drawing elements rlglDraw(); // Force drawing elements
glEnable(GL_SCISSOR_TEST); glEnable(GL_SCISSOR_TEST);
glScissor(x, y, width, height);
glScissor(x, GetScreenHeight() - (y + height), width, height);
rlClearScreenBuffers(); // Clear current scissor area rlClearScreenBuffers(); // Clear current scissor area
} }

Loading…
取消
儲存