(GULP!) mixing OpenGL and DirectDraw

Started by
19 comments, last by Rocket05 22 years, 8 months ago
There is a right way and a wrong way to do many things. In this case the mixing of OpenGL and Direct Draw in the mannor you speak of is not "the right way". Unfortunately most people have to experiance "the wrong way" of doing things before they realize why it''s not "right". The reason integrating direct draw and openGL in the mannor you speak of is "wrong" is simple. Your creating more programming work/frustration for yourself, which could be avoided with a better design.

Example 1: Load OpenGL, and Direct Draw. Pray that no conflicts happen. (This is not how allegro works!).

Example 2:
1. Abstract Direct Draw functionality. Using your own function names/structure names.
2. Abstract OpenGL 2d functionality. Using the same names/structures as the Direct Draw ones. (Overloading functions).
3. On startup you can either ask the user which api they would like DX/OpenGL or you can search for a .dll file which contains your DX or OpenGL abstractions. You then load the .dll and it calls the correct DX or OpenGL functions for you.

Obviously example 2 looks like more work. However it''s not when you figure in the debugging time and work arounds example 1 will take.

Example 2 is exactly what Allegro does, as well as what most of the new 3d game engines like Unreal Tourney or LithTech do.
Joseph FernaldSoftware EngineerRed Storm Entertainment.------------------------The opinions expressed are that of the person postingand not that of Red Storm Entertainment.

This topic is closed to new replies.

Advertisement