Disassemble the existing OpenGL DLL and Render DLL to understand how they interact with the game engine. Use dependency walkers (like Dependency Walker or Ghidra) to inspect function calls and dependencies.
If available, check the engine’s documentation or modding community for insights into how rendering works.
If the engine is closed-source, you may need to reverse-engineer the DLLs using IDA Pro, Ghidra, or similar tools. Identify function calls related to rendering (e.g., glBegin, glEnd, glDrawArrays). Map the function signatures to their equivalent in modern OpenGL or another rendering API.
A common approach is to create a wrapper DLL that mimics the original DLL’s exported functions but redirects calls to a modern renderer. This way, the engine still believes it is calling the original OpenGL functions, but your wrapper handles rendering differently. Use tools like Detours (for Windows) or LD_PRELOAD (for Linux) to intercept and replace function calls.
Develop a New Render DLL Once you understand the rendering flow, you can develop a new Render DLL that directly communicates with a newer API like Vulkan, DirectX, or Modern OpenGL (Core Profile). Implement an abstraction layer that translates old OpenGL calls to newer equivalents.
Inject and Test
Replace the old DLLs with your new ones and test for compatibility. Use debugging tools like RenderDoc or apitrace to check if rendering commands are working correctly. Expect crashes initially—use logs and debugging tools to diagnose issues.
Once you have the basics working, you can introduce performance improvements, new shaders, and modern rendering techniques. Alternative Approach: Use an Existing Wrapper Some projects already provide OpenGL wrappers that modernize older versions. Check:
GLShim (translates OpenGL 1.x calls to OpenGL ES). Mesa3D’s llvmpipe (a software OpenGL renderer). Let me know if you need specific guidance on implementation.