Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


dll design question for game library

This topic is 6478 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I''m implementing my BasicEngine (which mostly just handles doing 2d stuff with 3d hardware using OpenGL or Direct3D) This is what I''m hoping to accomplish, but not even SURE if it''s possible in c++!! 1. Pure Virtual Base Class in BasicEngine.lib called ICanvas. Within ICanvas it has a pure virtual function - InitScene() 2. DLL #1: D3DCanvas.dll - implements the ICanvas class for direct3d8 - Only defines InitScene as a virtual function 3. DLL #2: OGLCanvas.dll - implements the ICanvas class for OpenGL -Only defines InitScene as a virtual function.. I''ve got the library working now, where I can instantiate the DLL I want at runtime through interface pointers. QUESTION: CAN I derive ANOTHER class from D3DCanvas (remember it''s a DLL) which THEN implements the InitScene function()?? ie. joe coder dl''s the library, and wants to make his game. Since I''ve left the InitScene function blank (as I want as many as possible to use the engine), joe coder derives a class from D3DCanvas - MyD3DCanvas. In this one, he defines InitScene with a swak load of initialization code. Then during runtime, when the engine calls InitScene() - It loads up the D3DCanvas.dll then uses joe coder''s InitScene function...) is this possible??? thanks, Wazoo

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!