_real_ dynamic linking of DLL's

Started by
1 comment, last by katakombi 22 years, 7 months ago
hello guys, i''m working on an app, which shall render some crap using different API (currently OpenGL/DirectX). Users should be able to switch during runtime, but obviously my prog tries to locate directX dll, although it uses OpenGL by default. _no_ dx specific call is done so far! it must be possible to force the loading of direct dll at any time, hereupon checking, whether loading suceeded or not. did just anybody have a similar problem? i''m happy about any respone! thanks in advance katakombi >8^)
Advertisement
I think you have to make a seperate dll to contain your rendering interface - one for OGL and one for D3D, and load those dynamically.

Adding the .h & .lib''s probably statically link to some proxy Dx dll''s.

Magmai Kai Holmlor
- Not For Rent
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
I would put my rendering code in a seperate DLL that would be loaded at runtime, too. But you could try the following:
- Don''t link against d3d8.lib.
- load the library at runtime using LoadLibrary ().
- get the function pointer to Direct3DCreate8 () by using GetProcAddress () and use it to setup the Direct3D interface.

Don''t know if it works and would never use it for my code.

By the way doing the same for OpenGL must be a real fun, since the DLL exports some more functions !

This topic is closed to new replies.

Advertisement