Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Hey! Decided to purchase this and it's pretty neat. Made some adjustments and it turned out pretty much perfectly.

However, GM almost explodes when closing the project and I keep getting the error "Trying to set texture that is also bound as depth buffer - bailing...". Any way to fix this?

I tried it out in the latest version and I can't reproduce it, no errors neither when closing the game window, nor when loading a different project or closing GM. Did it happen before you made those modifications?

Did some research on that error message and it seems to happen if you attempt to make a loop between two surfaces, like drawing a surface while it's set as the render target (and a common way to trigger it is having old surface IDs that aren't cleaned up, so that they later refer to new surfaces due to ID reuse). I think a good starting point for debugging what's happening is adding

show_debug_message(view_surface_id[0])
show_debug_message(view_surface_id[1])
show_debug_message(view_surface_id[2])
show_debug_message(view_surface_id[3])

to the Post-Draw event of obj_viewcontrol. If you see multiples of the same surface index here (other than -1 which means "not in use") it means something goes wrong.


If the problem only happens when you terminate the game, I think you could hack your way around it using draw_enable_drawevent(false) triggered in the event that closes the game, but before you do the actual closing procedure - if you aren't going to draw anything anyway, you can turn off all the draw events before you start freeing up surfaces and weird things happen with the IDs.