The year of Linux on the desktop? —

Valve releases open source Direct3D to OpenGL translator

It should aid porting Windows games to other platforms, but it won't be revolutionary.

With little fanfare, Valve has published the source to ToGL, a translation layer to support a subset of the Direct3D 9 API on OpenGL systems. ToGL is a component of the company's Source 3D engine. Valve has broken it out and slapped a permissive MIT license on it in the hope that it might be useful to other developers.

Valve first talked about ToGL last year. ToGL does not support the full Direct3D 9c API but rather an undefined "limited subset" that's presumably focused on the specific needs Source has. As well as translating the function calls from one API to the other, it can also support shader programs from Direct3D's HLSL bytecode to OpenGL's GLSL.

The project is not usable as-is. It doesn't even build, as it references files that Valve has not included. But nonetheless ToGL should serve as a basis for other developers wanting to migrate Direct3D engines to run on OpenGL.

Is this going to open the floodgates and bring a ton of Windows games to OS X, Linux, and, of course, Valve's Linux-based Steam OS?

Probably not.

Some developers say that supporting multiple platforms is not a huge overhead, in general, at least when projects are written to be cross-platform from the start.

Even for projects that weren't designed to be cross-platform, ToGL isn't the first Direct3D-on-OpenGL library out there. The WINE project, developed to enable Windows programs to run on Linux, includes a Direct3D-to-OpenGL translator that handles some proportion of Direct3D 8, 9, and 10.

This portion of WINE is available as a standalone set of libraries called WineD3D. WINE uses the Lesser GPL license, so it can be used even by proprietary software as long as the other license provisions are met. Some versions of the Parallels virtualization environment, for example, have used WineD3D to provide Direct3D support on OS X.

There are also libraries that go the other way. Google's ANGLE library provides OpenGL ES support on Direct3D 9 and Direct3D 11.

Channel Ars Technica