wyozi-gmod / imgui

Immediate mode 3D2D UI for Garry's Mod
MIT License
79 stars 21 forks source link

Errorless CTD on physgun interactions and re-entering render range #33

Closed Pilotfish62873 closed 3 years ago

Pilotfish62873 commented 3 years ago

I've been getting routine CTDs when I pull out my physgun near a panel, move an entity the panel is tied to, or when I leave the rendering distance specified in imgui.Start3D2D and then return again.

This happens even when the code is just an empty context:

imgui.Start3D2D(self:GetPos() + self:GetForward () 42.5 + self:GetUp() 48.75, ang, 0.01) imgui.End3D2D()

Could be an error on my part but the lack of error messages has me stumped. This doesn't happen with regular cam.Start3D2D.

(Fantastic work by the way - this is really cool stuff)

wyozi commented 3 years ago

Interesting. Did you try wrapping the End3D2D in an if (so it only gets called when Start3D2D returns true)? Definitely sounds like something breaking with the camera context stacks

Pilotfish62873 commented 3 years ago

I think that did it - thanks! I was also not using Entity3D2D (thanks for making that - really useful!)

I'll let you know if any more issues crop up, but once again thanks for making this. I'll throw up some WIP images on your "in the wild" page.