I keep getting a visual glitch

I keep getting a visual glitch where the texture loads with the top line of pixels at the bottom. This will flash every few frames, with the image rendering normally most of the time. I wrote code to jump automatically, and when I step through the code frame by frame, the glitches are in consistent spots. Any thoughts/help would be appreciated!

I tried the code from the class, and it does the same thing.

I noticed when I set the texture rectangle to start at y=1 as opposed to y=0, it produces the same glitched image.

It doesn’t happen when I keep the image static, only when each frame is rendered in a different spot.

You can see what the glitch looks like below:
textureWrapError

Try reducing the height of scarfy’s rec by 1, you can do this by using an offset to either scarfyRec.height or scarfyData.rec.height depending on where you are in the course.

scarfyRec.height = scarfy.height - 1 for example.

Alternatively, try updating your graphics card driver.

Thanks for the ideas! I actually saw the same glitch on a later video (screenshotted below, about 10:16 on the “Moving the Hazard” video) which made me feel better about it. I’m still not sure the cause but I’m guessing it’s something to do with raylib.
glitch on video

Glad to help! I’m not seeing the problem on mine but managed to replicate the issue with a little detective work.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms