From e506284e5a31d6855a1230c180b8bc43accaae63 Mon Sep 17 00:00:00 2001 From: baidwwy <313738139@qq.com> Date: Sat, 8 May 2021 02:31:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E6=B8=B2=E6=9F=93?= =?UTF-8?q?=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GGELUA/Release64/lua/SDL/渲染.lua | 8 ++------ GGELUA/Release64/lua/SDL/纹理.lua | 13 ++++++++++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/GGELUA/Release64/lua/SDL/渲染.lua b/GGELUA/Release64/lua/SDL/渲染.lua index d9fb08e..3ee8656 100644 --- a/GGELUA/Release64/lua/SDL/渲染.lua +++ b/GGELUA/Release64/lua/SDL/渲染.lua @@ -1,7 +1,7 @@ --[[ @Author : baidwwy @Date : 2021-02-11 11:49:09 - @LastEditTime : 2021-05-06 16:42:43 + @LastEditTime : 2021-05-08 02:20:11 --]] local SDL = require("SDL") @@ -113,15 +113,11 @@ function SDL渲染:置渲染区(tex) self._tg = tex return self._rd:SetRenderTarget(tex:取对象()) end + self._rd:SetRenderTarget() end function SDL渲染:渲染结束() if self._rd then - if self._tg then - self._rd:SetRenderTarget() - self._rd:RenderCopy(self._tg:取对象()); - self._tg = nil - end self._rd:RenderPresent() else self._win:UpdateWindowSurface() diff --git a/GGELUA/Release64/lua/SDL/纹理.lua b/GGELUA/Release64/lua/SDL/纹理.lua index f33d120..64b5be1 100644 --- a/GGELUA/Release64/lua/SDL/纹理.lua +++ b/GGELUA/Release64/lua/SDL/纹理.lua @@ -1,7 +1,7 @@ --[[ @Author : GGELUA @Date : 2020-01-08 21:52:58 - @LastEditTime : 2021-05-03 10:45:15 + @LastEditTime : 2021-05-08 02:20:23 --]] local _ENV = require("SDL") IMG_Init() @@ -92,4 +92,15 @@ end function SDL纹理:到精灵() return require("SDL.精灵")(self) end + +function SDL纹理:渲染清除(r,g,b,a) + if self._access==TEXTUREACCESS_TARGET then + self._win:置渲染区(self._tex) + return self._win:渲染清除(r,g,b,a) + end +end + +function SDL纹理:渲染结束() + self._win:置渲染区() +end return SDL纹理 \ No newline at end of file