[6/8] WineD3D: Return a different success value if D3D is not available

Henri Verbeet hverbeet at gmail.com
Thu Aug 6 04:54:58 CDT 2009

2009/8/6 Stefan Dösinger <stefan at codeweavers.com>:
> Am Thursday 06 August 2009 09:35:12 schrieb Henri Verbeet:
>> Aside from the fact that you can't know WineDirect3DCreate() failed
>> because of a lack of OpenGL without looking at its implementation, I
>> liked the create flags approach better.
> Well, the WINED3DOK_NO3D is intended to say "you got your d3d object, but it
> will only do 2D drawing for you", and then its up to the client to accept
> this or not(Although I just see I forgot to release the returned object in
> this case). I don't see the problem.
The problem is that wined3d without 3D capabilities really doesn't
make a whole lot of sense for anything except ddraw with the gdi
renderer. Arguably that code path shouldn't even depend on wined3d. A
wined3d object without 3D capabilities is the exception, and should be
handled as such.

> I dislike create flags as much as dxVersion checks, and we should handle as
> much as possible without them. I feel strongly against using a create flag in
> patch 4. I just think passing in a flag to call X and call Y's behavior will
> miraculously change is ugly, although sometimes we can't avoid it.
If done properly, miracles have nothing to do with it... The problem
with patch 4 is that you really want the initial value to change, but
instead you change it afterwards, and hope you caught all the cases.
Fortunately the tests should help a bit there, but I don't think it's
a good principle if you can easily avoid it.

Another advantage of the flags is that you have a reasonably
centralised overview of differences between the different wined3d
client libraries.

More information about the wine-devel mailing list