Well, I havent compiled a dll and linked it to a library, so, hopefully it will work :P
In your header, do this
extern const int NumberOfLights;
In your cpp, define it
const int NumberOfLights = 10;
Then compile your dll, link it to your project, and see if it works.
Moving graphics engine to DLL project
That seems more complicated than having to copy the header to a constant shader string because I add values more than I change them.
Can I reach the same header as both a Visual Studio resource and a regular header?
Can I reach the same header as both a Visual Studio resource and a regular header?
If you are inclined to put everything into a dll, then you must compile it each time something within it changes. So, if you want to "hide" information from people who use your dll, then you will have to recompile it each time to add/change/remove something.
If your code is in a header, everyone can see it or modify it. If its in a cpp file, then you can compile it into your dll. That is really the end of it. Decide what you want to do. If its not convenient to recompile the dll for each change you make, then don't put it into a dll.
It is unnecessary to think you need to rebuild the dll for every little change you make . . . Just build everything using the full source code, and build your dll only when you want to release a build.
If your code is in a header, everyone can see it or modify it. If its in a cpp file, then you can compile it into your dll. That is really the end of it. Decide what you want to do. If its not convenient to recompile the dll for each change you make, then don't put it into a dll.
It is unnecessary to think you need to rebuild the dll for every little change you make . . . Just build everything using the full source code, and build your dll only when you want to release a build.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement