Improving DirectDraw OpenGL renderer for SoC?

Stefan Dösinger stefandoesinger at
Wed Mar 21 14:32:14 CDT 2007

Am Mittwoch 21 März 2007 20:01 schrieb Alexander Nicolaysen Sørnes:
> Greetings,
> i am thinking about participating in the Summer of Code, and thought it
> would be interesting to improve DirectDraw such that Command & Conquer
> Tiberian Sun & Red Alert 2 run faster.  Currently, they crash once the
> mouse is moved in-game when OpenGL rendering is enabled.  Thus the project
> would involve fixing that bug, and then other performance issues/crashes
> that occur. However, I don't really have much experience with C and Wine. 
> The closest I have gotten is some patches for Wine's WordPad
> implementation. Would it be feasible to acquire the necessary knowledge and
> fix the bugs before the end of summer?
I think learning those things over the summer is feasable. There is not much 
OpenGL knowledge required, it is mostly about drawing textured quads.

Unfortunately other issues are major:
The crash when moving the mouse is because those games draw the mouse from a 
different thread. My multithreaded opengl patches may fix that. But for real 
thread safety we have to implement locking of private data. For one part this 
needs a lot of patience because those patches are tricky to review for 
Alexandre, and it needs knowledge about thread synchronisation. Overall it is 
a very tricky task.

The other issue is render target locking. This is essentially something that 
is not well supported by OpenGL. There are 2 extensions which can help to 
improve that, one is the pixel buffer objects extension, the other one is a 
nvidia only extension which does exactly the same as 
IDirectDrawSurface7::Lock. If neither of those extensions is available, or if 
pbos turn out to be slow too, we can only play tricks like watching the 
application's behavior and predict the area it will modify. I have started 
toying with that, the most important fragment is this:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :

More information about the wine-devel mailing list