Replacing X11 backend driver with SDL

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
rogercruz
Level 1
Level 1
Posts: 6
Joined: Sun Sep 18, 2011 6:11 pm

Replacing X11 backend driver with SDL

Post by rogercruz » Mon Sep 19, 2011 7:18 pm

I have been doing some research on Wine and have the following questions
 
1) Would it be possible to run Wine on a non-X11 system if I replace its X11 backend driver with an SDL backend? 
2) Does such a SDL driver exist or know of anyone who has worked on it but never made it into Wine?
3) Are all the X11 dependencies in Wine contained in the winex11.drv driver or are there other areas of the code where it uses X or assumes it is running on an X system? 
4) Can SDL provide all the functionality Wine requires of its X driver or are there areas that can't be reproduced with SDL?
 
 
Thank you in advance,
 
Roger R. Cruz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-us ... hment.html>

vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: Replacing X11 backend driver with SDL

Post by vitamin » Mon Sep 19, 2011 10:13 pm

rogercruz wrote:1) Would it be possible to run Wine on a non-X11 system if I replace its X11 backend driver with an SDL backend?
As-is - no, it's not possible. SDL is not X11 compatible (it's not a drop-in replacement for X11).
rogercruz wrote:2) Does such a SDL driver exist or know of anyone who has worked on it but never made it into Wine?
No, and afaik no one even tried. Wine's X11 driver is far more complex than most people think.
rogercruz wrote:3) Are all the X11 dependencies in Wine contained in the winex11.drv driver or are there other areas of the code where it uses X or assumes it is running on an X system?
For the most part yes. But there are number of parts in user32 (input, graphics), OpenGL, wined3d (both opengl, graphics), dinput (input, controls). There are few other places that I can't recall now.
rogercruz wrote:4) Can SDL provide all the functionality Wine requires of its X driver or are there areas that can't be reproduced with SDL?
This is an open ended question. How much of Wine and how well do you want to work?

Not expert in SDL can't tell you for sure. But just rewriting window handling parts of winex11drv is a nightmare. Good luck with that.

rogercruz
Level 1
Level 1
Posts: 6
Joined: Sun Sep 18, 2011 6:11 pm

Replacing X11 backend driver with SDL

Post by rogercruz » Thu Sep 22, 2011 9:29 am

My comments embedded below with >>


From: vitamin <wineforum-user@winehq.org>
To: wine-users@winehq.org
Sent: Monday, September 19, 2011 11:13 PM
Subject: [Wine] Re: Replacing X11 backend driver with SDL
I understand it won't be a drop-in replacement for X11 but my idea is to have a winesdl.drv
which provides the exact functionality Wine expects from the winex11.drv.   It may require
more coding and calls into SDL to generate the same graphics and input as X11 provides
but that will all be abstracted by the winesdl.drv.
Basically, I am looking to run Wine on a system which has no X11 subsystem but has
an SDL stack. 
rogercruz wrote:
2) Does such a SDL driver exist or know of anyone who has worked on it but never made it into Wine?
No, and afaik no one even tried. Wine's X11 driver is far more complex than most people think.
Oh yeah, I'm not minimizing the amount of work that would be required.  I am only looking
to hear if it is technically feasible or whether i am overlooking some obvious technical problem
that would prevent Wine from working with an SDL backend.. something like Wine requires
a particular shader which can't be duplicated with SDL, for example.
rogercruz wrote:
3) Are all the X11 dependencies in Wine contained in the winex11.drv driver or are there other areas of the code where it uses X or assumes it is running on an X system?
For the most part yes. But there are number of parts in user32 (input, graphics), OpenGL, wined3d (both opengl, graphics), dinput (input, controls). There are few other places that I can't recall now.
Good to know.  I was hoping it was all self contained to the winex11.drv.  I will look for other then.
rogercruz wrote:
4) Can SDL provide all the functionality Wine requires of its X driver or are there areas that can't be reproduced with SDL?
This is an open ended question. How much of Wine and how well do you want to work?

Not expert in SDL can't tell you for sure. But just rewriting window handling parts of winex11drv is a nightmare. Good luck with that.
I need to have Wine run as well as it does in Linux, that's the short answer but I will settle for
running Office 2007 and then add whatever else is needed to support other apps.
Any other thoughts/guides/links on how to port Wine to another platform (pared down linux version)
would be greatly appreciated it.





rogercruz wrote:
1) Would it be possible to run Wine on a non-X11 system if I replace its X11 backend driver with an SDL backend?
As-is - no, it's not possible. SDL is not X11 compatible (it's not a drop-in replacement for X11).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-us ... hment.html>

doh123
Level 8
Level 8
Posts: 1227
Joined: Tue Jul 14, 2009 1:21 pm

Post by doh123 » Thu Sep 22, 2011 11:56 am

I'm sure its possible... it would be a lot of work.

Transgamings Mac OS X version of Cedega they use to port with (called Cider) used to use a SDL engine... they don't any more since they wrote a new one that uses OSX's native quartz, but the SDL version ran good. Of course Transgaming is anti-open source... errr.. well i take that back, they are pro Open Source as long as they can use it for profit without giving hardly anything back... so don't expect to be able to see any of their coding to how they did it.

rogercruz
Level 1
Level 1
Posts: 6
Joined: Sun Sep 18, 2011 6:11 pm

Replacing X11 backend driver with SDL

Post by rogercruz » Thu Sep 22, 2011 12:11 pm

That's good to know that some else already used SDL. I would love to get my hands on that code but you are saying they didn't open source it?

Using SDL has the benefit of getting wine running on many more platforms since SDL has a large platform support.

Any pointers to other companies who have used an SDL backend to Wine is extremely appreciated. I don't want to duplicate efforts if it can be avoided.

Regards,

Roger R. Cruz



On Sep 22, 2011, at 12:56 PM, "doh123" <wineforum-user@winehq.org> wrote:
I'm sure its possible... it would be a lot of work.

Transgamings Mac OS X version of Cedega they use to port with (called Cider) used to use a SDL engine... they don't any more since they wrote a new one that uses OSX's native quartz, but the SDL version ran good. Of course Transgaming is anti-open source... errr.. well i take that back, they are pro Open Source as long as they can use it for profit without giving hardly anything back... so don't expect to be able to see any of their coding to how they did it.




doh123
Level 8
Level 8
Posts: 1227
Joined: Tue Jul 14, 2009 1:21 pm

Re: Replacing X11 backend driver with SDL

Post by doh123 » Thu Sep 22, 2011 3:16 pm

rogercruz wrote:That's good to know that some else already used SDL. I would love to get my hands on that code but you are saying they didn't open source it?

Using SDL has the benefit of getting wine running on many more platforms since SDL has a large platform support.

Any pointers to other companies who have used an SDL backend to Wine is extremely appreciated. I don't want to duplicate efforts if it can be avoided
they did not open source their SDL or mac quartz drivers they use, just as much of their stuff is not... but their wine fork was forked off so long ago, it might be vastly different than needed now... and it was Mac OS X only so... it might be better to start from scratch anyways. SDL has a large performance boost in graphics over X11 on Macs.

rogercruz
Level 1
Level 1
Posts: 6
Joined: Sun Sep 18, 2011 6:11 pm

Replacing X11 backend driver with SDL

Post by rogercruz » Thu Sep 22, 2011 3:37 pm

Great. Thanks for the info. I'll start a preliminary investigation of adding an SDL back engine to Wine. Being new to Wine, is there documentation that explains how to port to a new platform? If not, I'll just dive into that code and try to understand all the X dependencies.

Thanks
Roger R. Cruz



On Sep 22, 2011, at 4:16 PM, "doh123" <wineforum-user@winehq.org> wrote:
rogercruz wrote:
That's good to know that some else already used SDL. I would love to get my hands on that code but you are saying they didn't open source it?

Using SDL has the benefit of getting wine running on many more platforms since SDL has a large platform support.

Any pointers to other companies who have used an SDL backend to Wine is extremely appreciated. I don't want to duplicate efforts if it can be avoided
they did not open source their SDL or mac quartz drivers they use, just as much of their stuff is not... but their wine fork was forked off so long ago, it might be vastly different than needed now... and it was Mac OS X only so... it might be better to start from scratch anyways. SDL has a large performance boost in graphics over X11 on Macs.




doh123
Level 8
Level 8
Posts: 1227
Joined: Tue Jul 14, 2009 1:21 pm

Re: Replacing X11 backend driver with SDL

Post by doh123 » Fri Sep 23, 2011 11:06 am

rogercruz wrote:Great. Thanks for the info. I'll start a preliminary investigation of adding an SDL back engine to Wine. Being new to Wine, is there documentation that explains how to port to a new platform? If not, I'll just dive into that code and try to understand all the X dependencies.
Documentation is very inadequate... you'll pretty much have to search for what little you can find, and jump in and figure it out. This sounds like a very very difficult project, but it could be very worthwhile, so all the best of luck to you.

rogercruz
Level 1
Level 1
Posts: 6
Joined: Sun Sep 18, 2011 6:11 pm

Replacing X11 backend driver with SDL

Post by rogercruz » Fri Sep 23, 2011 11:25 am

Thanks. I don't mind digging into the code. Always something new to learn.



On Sep 23, 2011, at 12:06 PM, "doh123" <wineforum-user@winehq.org> wrote:
rogercruz wrote:
Great. Thanks for the info. I'll start a preliminary investigation of adding an SDL back engine to Wine. Being new to Wine, is there documentation that explains how to port to a new platform? If not, I'll just dive into that code and try to understand all the X dependencies.
Documentation is very inadequate... you'll pretty much have to search for what little you can find, and jump in and figure it out. This sounds like a very very difficult project, but it could be very worthwhile, so all the best of luck to you.




User avatar
André H.
Moderator
Moderator
Posts: 202
Joined: Sun Dec 07, 2008 8:33 am
Location: Germany
Contact:

Post by André H. » Sun Sep 25, 2011 2:10 pm

After it's been my idea i thought i finally jump in here :)
even if the sdl stuff from transgaming is outdated and so on, it might be worth a try asking for it. maybe they open source it

manil
Newbie
Newbie
Posts: 3
Joined: Thu Dec 08, 2011 5:30 am

Post by manil » Fri Dec 09, 2011 11:50 pm

I too had been thinking whether it was possible for me to run Wine in a system which is non X11 by replacing the X11 backend driver with an SDL backend driver. I guess not since the SDL is incompatible with the X11. However, it would be nice if someone could come up with a tweak to make it compatible.

doh123
Level 8
Level 8
Posts: 1227
Joined: Tue Jul 14, 2009 1:21 pm

Post by doh123 » Sat Dec 10, 2011 12:12 am

manil wrote:I too had been thinking whether it was possible for me to run Wine in a system which is non X11 by replacing the X11 backend driver with an SDL backend driver. I guess not since the SDL is incompatible with the X11. However, it would be nice if someone could come up with a tweak to make it compatible.
a "tweak" ??? you mean a total re-write...

PommeGolden
Level 1
Level 1
Posts: 6
Joined: Sat Oct 22, 2011 4:05 am

Post by PommeGolden » Sun Dec 11, 2011 3:20 am

X11 will be replaced by native Quartz driver in the UNforeseeable future ...

http://wiki.winehq.org/MacOSX/QuartzDriver
http://wiki.winehq.org/WineReleaseCriteria

:wink:

doh123
Level 8
Level 8
Posts: 1227
Joined: Tue Jul 14, 2009 1:21 pm

Post by doh123 » Sun Dec 11, 2011 9:11 am

PommeGolden wrote:X11 will be replaced by native Quartz driver in the UNforeseeable future ...

http://wiki.winehq.org/MacOSX/QuartzDriver
http://wiki.winehq.org/WineReleaseCriteria

:wink:
Which only would affect Mac OS X... not Linux or other OSes that can use SDL. When will a Quartz Driver happen? My guess is never. To make it really good it really needs to use some ObjC... which they won't allow... which is really odd since Quartz is only on Mac OS X, so the code being portable to other OSes shouldn't be a factor since it should be totally ignored on all other platforms.

jjmckenzie
Moderator
Moderator
Posts: 1153
Joined: Wed Apr 27, 2011 11:01 pm

Replacing X11 backend driver with SDL

Post by jjmckenzie » Sun Dec 11, 2011 9:32 pm

On Sun, Dec 11, 2011 at 7:11 AM, doh123 <wineforum-user@winehq.org> wrote:
PommeGolden wrote:
X11 will be replaced by native Quartz driver in the UNforeseeable future ...

http://wiki.winehq.org/MacOSX/QuartzDriver
http://wiki.winehq.org/WineReleaseCriteria

 [Wink]
Which only would affect Mac OS X... not Linux or other OSes that can use SDL.  When will a Quartz Driver happen?
 My guess is never.
Actually, the developers for the winequartz driver stopped when they
realized that DIB functionality was needed. When Huw Davis announces
the DIB engine is complete, then work may restart on the existing
project.
 To make it really good it really needs to use some ObjC... which they won't allow... which is really odd since Quartz is
only on Mac OS X, so the code being portable to other OSes shouldn't be a factor since it should be totally ignored on
all other platforms.
AJ will not allow any code other than 'c'. Not even C++ because some
compilers will 'choke' on it. The same for ObjectiveC. However,
there is a pure 'c' to ObjC interface and the winequartz project plans
on using it. Thus a good work-around for broken compilers and this
should make AJ happy because it is 'c' code.

James



Locked