![]() |
|
C++ exception handling - Printable Version +- MFGG Forums (https://forums.mfgg.net) +-- Forum: MFGG (https://forums.mfgg.net/forumdisplay.php?fid=4) +--- Forum: Developer Discussion (https://forums.mfgg.net/forumdisplay.php?fid=10) +--- Thread: C++ exception handling (/showthread.php?tid=3511) |
C++ exception handling - GeneSu730 - 03-15-2026 I have a question. I am creating a new Zelda game engine. It will use bits and pieces of my Mario engine but I will have to change a lot of code. I am using an old version of Visual C++ and Direct X. It does not have smart pointers. However, I was thinking about adding standard exception handling (try-catch-throw). I have been researching several websites and the advice I have been getting is to avoid it because it slows down performance and can make a mess of other things. In particular, game consoles (especially those from Nintendo) don't support exceptions while others (XBox) take a massive performance hit. Do any of you have any thoughts about it? RE: C++ exception handling - PaulineGamer - 03-31-2026 ive run into this problem with gamedev before. not in C++ but in C#, but im sure the experience will be similar basically, yes the performance hit will be huge. i did something silly that caught exceptions when you were changing levels. the game locked up for like an entire half-second from catching a few exceptions. i figured it would be instant, but no, it is very very costly. especially if you're planning on throwing / catching exceptions on a per-frame basis, this will totally not work. id recommend avoiding them entirely for games |