Those of you who had been following my articles at BeNews last year, you probably remember the France-based RealTech-VR and their effort to bring a Direct3D-to-OpenGL wrapper to the BeOS. The company paused most of that effort when was clear that BeOS was stopped being developed, but after pressure from the community, they have now open sourced their D3D-2-GL implementation and work has already started to port the wrapper to MacOS and Linux in an effort to bring Direct 3D to more alternative operating systems. Today we feature a mini-interview with Stephane Denis of RealTech-VR about the implementation.1. Which operating systems the open sourced version at Sourceforge supports as of now?
Stephane Denis: Actually, the sources are designed for Win32 but they will be compatible for Linux and Mac OS soon.
The ENSEIRB (a french engineer school in Bordeaux) are currently porting it for Linux and will probably speed up a lot the developement of the interface.
2. If the wrapper only supports Windows and BeOS, how easy/difficult a port to Linux or Mac OS would be?
Stephane Denis: Personally, I continue the win32 emulation/wrapper to validate the wrapper compatibility and then I will do the Mac OS version. For Linux, there is already a crew on it working. For the BeOS version, well I probably adapt it later.
A test D3D-2-GL program loading under Windows XP. Click for larger version.
3. How far down the line the wrapper is? What has to be done yet?
Stephane Denis: Actually the Direct3D 8.0 part (only immediate mode) seems to works more or less, but not sufficiently enough to support really complex programs for the moment. But I expect that more people will look on other parts too, like DirectInput and DirectSound (since they are completly separated modules).
4. How fast/slow the implementation is when compared to a “native” GL app?
Stephane Denis: The speed or efficiency of the wrapper depends mainly of the OpenGL extensions supported. Since most of the time is consumed on rendering and not on API calls, this should be as fast as the original Direct3D code.
But you know, the goal is to get the DirectX API available on non-Win32 platform in order developers be able to create or port actual Direct3D 8 code. For Win32, some video cards like 3DLabs Wildcat or professional SGI video cards do not support Direct3d or Directdraw at all, but they have an excellent Opengl implementation. So the wrapper would be especially useful for theses adapters. A solution already exists, but we want to add Direct3D8 support.
I truly hope that more developers will join this interesting project now so we get things going in a faster pace.
A Direct3D application running in GL mode with the help of the wrapper.
What license is this under, dare I ask.
Excellent question, I’m eager to know too. Because if it’s under GPL, I considere it a sad (partial) waste. Still good for open-source games, that would close all door for any viable commercial use…
In fact, is it possible that the source is “open” without any license ? Like no restriction, here’s the code, do what you want !
Ummm…GLDirect by SciTech actually emulates OpenGL using the
DirectX drivers, while this seems to be the other way round. So
his comment that “…a solution already exists” seems untrue
to me.
Or am I missing something here?
Once you know how to take the API one way its a simple reversal to perform the DX to GL calls.
Maybe Transgaming could use this in a future release of WineX…. Thoughts?
Hey Steve,
If it’s under the GPL, commercial game vendors could still buy a non-GPL license from the authors. No problems there.
“If it’s under the GPL, commercial game vendors could still buy a non-GPL license from the authors. No problems there.”
Ok, great, thanks for the info ! That make sense…
here’s the code, do what you want ! Looks like the BSD license, no ?
Please make it a part of the GameKit!
If the license is right?
/Konrad
it would be nice to see some group other than Transgaming Working with this code in an effort to use it in wine.
/********************************************************************* *******
; *
; * File : d3dx.cpp
; *
; * Description : Direct3D 8 Wrapper
; *
; * Copyright © Realtech VR 2001
; *
; * Permission to use, copy, modify, distribute and sell this software
; * and its documentation for any purpose is hereby granted without fee,
; * provided that the above copyright notice appear in all copies and
; * that both that copyright notice and this permission notice appear
; * in supporting documentation. Realtech makes no representations
; * about the suitability of this software for any purpose.
; * It is provided “as is” without express or implied warranty.
; *
; ********************************************************************** *****/
“Please make it a part of the GameKit! If the license is right? ”
That’s definitley something I will propose. For sure it will not be included in R1 (we aim for a complete R5 clone) but for R2 we start adding new things.
that people can now play windows games on a non-windows system? or does it just make the porting simpler?
Just the porting. That help to be source compatible, but not binary compatible.
I personnaly like DirectX as a game API. Programming using this interface under others OS may be fun.
My only concern: DirectX is more than an API, but a kind of direct interface upon hardware drivers that need to be DirectX compliant (espacially video cards drivers) to be really powerfull and usefull.
Having the same API will not give the power of it, unless other OS drivers start to support DX, which I really doubt.
So, the more I think about it, the less I found it of real use except for a quick & dirty port of a Windows game.
Is that make sense ?
it does
Umm, it is not just a reversal to map from one API to another. APIs don’t map to each other cleanly. Writing a mapping from GL -> DX is much harder than writing one from GL -> DX because DX incorporates a lot more features, plus it is object based, which makes it harder to map to a C API.
“Writing a mapping from GL -> DX is much harder than writing one from GL -> DX because DX incorporates a lot more features,…”
I agree that DX is more complex due to its object nature, but once you understand the DX object functions and data structures and their relationships to the OpenGL framework it becomes a lot simpler to do the API conversion.
Issues like sound, input etc are a totally different ballgame tho…
I prefer SDL+GL and its companion libs.
For simple use you can use it plain and for complex uses you can just use the addon lib.
Who cares about DX?
(surely that wrapper wil make easier have quick and dirty conversion but for starting projects SDL+GL is a better choice IMHO complexity wise and portability wise(including Ps2 HW;))
“Who cares about DX?”
About 99% of every game studio/publishers 🙂
“surely that wrapper wil make easier have quick and dirty conversion but for starting projects SDL+GL is a better choice IMHO complexity wise and portability wise(including Ps2 HW”
Never underestimate the power of the market share 🙂
Windows + XBox = DirectX. Which is way sufficient at the eyes of game publishers management …