This is nothing to do with use of a DLL - Quake 2 used DLLs back in 1998 and didn’t suffer from this kind of problem (what’s more, OpenGL itself is implemented as a DLL). You’ve got something else different between the two sets of code, or you’ve a bad DLL implementation, that’s causing this. Whichever, the problem will be in your own code, not in use of a DLL itself, and definitely not coming from the compiler.
One example might be if you’re doing LoadLibrary/GetProcAddress/FreeLibrary for every single call into the DLL code. That would be expected to run slower, and the solution would be to LoadLibrary and GetProcAddress for each entry point one-time-only at startup. But that’s just an example; we haven’t seen any details of your DLL implementation so the best you’ll get is guesses.
Thanks for the reply. I’m exporting classes from the dll.
As far as I know, once the class is instantiated, it doesn’t matter where from the class came right?
Please take a look at the attached code and let me know your opinion.