I’m building a DLL that links to OpenGL. But I get a problem when calling some functions such as glGenBuffers, because apparently __glewGenBuffers (and other glew buffer functions) are null. Everything compiles properly, and the same code works in the executable, but not in my DLL. I’m using VS 2010. Any ideas about linking to OpenGL from a DLL?
Edit: I forgot to mention, I’m actually trying to link an engine (static library) to the DLL, and the exe file uses it too (it does almost everything, except a small part that I want to put in my DLL). I would definitely be fine with using just OpenGL calls from the DLL though, instead of linking the engine, if I could get it to work better.
GLEW must do some tricks in order to deal with the context dependent function pointers on some plattforms. One of these plattforms is Windows. A foolproof way to make things working is to
everytime a function in the DLL is called that uses extended OpenGL functionality. I.e.