![]() |
Disable raster callback? - Printable Version +- Tilengine - The 2D retro graphics engine forum (http://tilengine.org/forum) +-- Forum: English forums (http://tilengine.org/forum/forumdisplay.php?fid=3) +--- Forum: Support (http://tilengine.org/forum/forumdisplay.php?fid=7) +--- Thread: Disable raster callback? (/showthread.php?tid=485) |
Disable raster callback? - mycats - 02-09-2020 I have set raster callback function in the first part of game, and I don't need it in the second part. How to disable it? Setting it to NULL causes rendering errors. RE: Disable raster callback? - megamarc - 02-09-2020 Passing NULL to TLN_SetRasterCallback() is the way to disable raster effects. Exactly what kind of "rendering errors" are you experiencing? Can you post some example? RE: Disable raster callback? - mycats - 02-09-2020 Using DisableBGColor() after disabling raster callback caused errors like this, using SetBGColor(0,0,0) instead fixed problem. RE: Disable raster callback? - megamarc - 02-09-2020 I'm glad you found the cause so quickly! In Tilengine you must specify a base background: either a solid color with TLN_SetBGColor() or a fixed bitmap with TLN_SetBGBitmap(). If not, pixels that are not covered by any background layer aren't cleared between frames, leaving the trace you see in the picture. This is not a bug, it's by design, to avoid unnecesary overdraw when you use a background layer that you know that it hasn't transparent pixels, so a base background is not needed. This is unrelated to raster effects. |