Driftwood2D / Driftwood

Driftwood 2D Tiling Game Engine and Development Suite
http://tileengine.org/
MIT License
24 stars 1 forks source link

Bizarre invalid texture issue occurring in AreaManager between __prepare_frame() and __build_frame() #79

Closed seisatsu closed 7 years ago

seisatsu commented 7 years ago

Introduced in c386c3c6b655e65b24196f19fe48d36643f730bd (though commented out.) When changing areas, prepare_frame() should be called, destroying the frame texture and creating a new texture. However, somehow if we destroy the texture here and then create a new texture for the frame, it is subsequently found invalid by SDL_SetRenderTarget() in build_frame(). This was solved temporarily by commenting out lines 128 and 129 in areamanager.py, thus creating a new texture over the same variable without destroying the existing texture, which could result in memory leaks.(?) Very strange. Maybe I'm missing something important about using SDL2.

seisatsu commented 7 years ago

This was somehow fixed as mysteriously as it appeared when rendering operations were moved into FrameManager in 34ca806e624e245d89a1d6f3835e3d7f9551f04c.