Windowing Plugin System + SDL2 plugin

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
User avatar
holocronweaver
Google Summer of Code Student
Google Summer of Code Student
Posts: 273
Joined: Mon Oct 29, 2012 8:52 pm
Location: Princeton, NJ
x 47

Re: Windowing Plugin System + SDL2 plugin

Post by holocronweaver »

...doh. Sorry for missing the above post. :oops:

Well, if it helps any, I have finally uploaded my first draft of the window system to my GL3+ bleeding edge repo. API is not final, but close and somewhat documented. Here is my commit summary:

* Window system API has a few rough edges, but is almost as intended.
Doxygen documentation needs more work, but is partially complete.
* Use of the expression 'config' in OGRE source has been replaced with
'option' wherever it is more accurate.
* Render system and window system now have separate options.
* The SampleBrowser has been nearly fully ported to SDL2. Only mobile
sections still need to be ported. Having little 3D mobile
experience, I leave this to more capable hands.
* Samples have been ported to SDL2. They appear to work.
* A new window system folder is created in root to store
window systems. This is meant to encourage implementing
window systems which can be shared across multiple render systems,
though OS and render system specific windowing goes here too.
* Only the SDL2 window system has been implemented. GLX will be
next. The remaining window systems are left for others to port as
needed.

I haven't tested some of the more recent changes in Windows or Mac.

First I want to apologize first to anyone who tries to review my code. It is all one humongous commit from Hades because most of the changes could not be done incrementally in a useful way.

Second I want to apologize for taking so many centuries to push this. I won't make any excuses, though I have plenty. Instead, I am going to try and make up for it by getting this window system finalized and ready for inclusion upstream posthaste.
TheSHEEEP
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 972
Joined: Mon Jun 02, 2008 6:52 pm
Location: Berlin
x 65

Re: Windowing Plugin System + SDL2 plugin

Post by TheSHEEEP »

Awesome!
How easy/hard will this be to integrate the SDL2-windowing into an existing Ogre version?

We use a slightly older version of 1.9 with some custom code, so we might not want to switch to a new version.
However, we also want to use SDL2 for input & windowing, so if we could use your code for that it would be awesome.
My site! - Have a look :)
Also on Twitter - extra fluffy
User avatar
holocronweaver
Google Summer of Code Student
Google Summer of Code Student
Posts: 273
Joined: Mon Oct 29, 2012 8:52 pm
Location: Princeton, NJ
x 47

Re: Windowing Plugin System + SDL2 plugin

Post by holocronweaver »

Hard to judge without knowing what changes you have made, but it certainly could be done with no more than a days effort.

So far, 1.10 mostly has small changes, except the GSoC merges (D3D11, GL3+, and geometry decomp). The window system will likely be the largest change of all since it affects so many files.

Mercurial can be your friend. My suggestion is to create your own private OGRE branch, which you based on 1.9 and made changes to, then merge in upstream changes. I personally would bite the bullet and merge in all upstream 1.10 changes, but you could cherry pick as well. This will make the integration process semi-automated, though it could take about an hour or so depending on the changes you made to 1.10. Be sure to use a good diff tool like kdiff3 or this will be more painful than it need be.
TheSHEEEP
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 972
Joined: Mon Jun 02, 2008 6:52 pm
Location: Berlin
x 65

Re: Windowing Plugin System + SDL2 plugin

Post by TheSHEEEP »

Our changes are only minor stuff not affecting the windowing at all.
I use kdiff3 for such tasks most of the time anyway.

Do you have a list of files that were affected by the SDL2 changes?
Would make cherry picking easier than browsing the repository commits :D

But we may switch to Ogre 1.10 for our project (depending on its status and how fast we need to decide on an Ogre version), so if SDL2 is in there, that would certainly be very helpful.
We're currently trying to figure out the path of least resistance.
My site! - Have a look :)
Also on Twitter - extra fluffy
User avatar
holocronweaver
Google Summer of Code Student
Google Summer of Code Student
Posts: 273
Joined: Mon Oct 29, 2012 8:52 pm
Location: Princeton, NJ
x 47

Re: Windowing Plugin System + SDL2 plugin

Post by holocronweaver »

There is essentially one massive commit for the first window system draft since I don't like to commit changes that don't compile. You will need almost all the changes in that commit to make the new window system work, though I still have some work to do to get this working in Window and Mac.

In my GL3+ repo, using hg log -v -r 6298 lists these files (which is most of the changes) in SSV format. Keep in mind many files only have one or two lines changed.
paroj
OGRE Team Member
OGRE Team Member
Posts: 2204
Joined: Sun Mar 30, 2014 2:51 pm
x 1188

Re: Windowing Plugin System + SDL2 plugin

Post by paroj »

what is the status of your work? is everything available in your repository? I would be interested in continuing the WindowSystem work..
User avatar
holocronweaver
Google Summer of Code Student
Google Summer of Code Student
Posts: 273
Joined: Mon Oct 29, 2012 8:52 pm
Location: Princeton, NJ
x 47

Re: Windowing Plugin System + SDL2 plugin

Post by holocronweaver »

No, the past six months or so of work are not in the repository. I will try to clean up and push my changes over Christmas break, which completes the windowing system API and its SDL2 implementation for Linux, Mac, and Win. I haven't pushed sooner because I am simultaneously trying to graduate (late spring, early summer) and publish my first game (alpha due in the first half of 2015), leaving no time for polishing my code to be publication-worthy. If it compensates at all for my tardiness, my game uses the new windowing system, and I plan to continue contributing to the window system and OGRE as a whole as the game progresses.
paroj
OGRE Team Member
OGRE Team Member
Posts: 2204
Joined: Sun Mar 30, 2014 2:51 pm
x 1188

Re: Windowing Plugin System + SDL2 plugin

Post by paroj »

great to hear that it is almost ready. However you should consider also publishing unpolished code. This way it is easier to track how far your code is and to contribute patches as needed. This would follow the release early release often philosophy[2] and is also mentioned in [1]. I mean the real judgement is only when you try to push your stuff into sindbad/ogre/default.

[1] https://about.gitlab.com/2014/09/29/gitlab-flow/ (merge/ pull request part)
[2] http://en.wikipedia.org/wiki/Release_ea ... ease_often

As a side note: I really think it would help if people would create "dangling" pull-requests (like [1]) so it is easier to keep track of ongoing work like this, but also AZDO HLMS etc..
scrawl
OGRE Expert User
OGRE Expert User
Posts: 1119
Joined: Sat Jan 01, 2011 7:57 pm
x 220

Re: Windowing Plugin System + SDL2 plugin

Post by scrawl »

I agree with you, opening a pull request (even if it's not 100% ready for merging yet) would be a great way to get more feedback, more people on board and perhaps even get others to fill in the missing parts (I think you mentioned, that the Android part still needs to be written).
User avatar
holocronweaver
Google Summer of Code Student
Google Summer of Code Student
Posts: 273
Joined: Mon Oct 29, 2012 8:52 pm
Location: Princeton, NJ
x 47

Re: Windowing Plugin System + SDL2 plugin

Post by holocronweaver »

Quick update: I did get a chance to work on this during Christmas break and will be pushing my work in the coming week. I will create a pull request and keep it updated once I finish merging in upstream.

As scrawl mentioned, I have not included mobile support. I will leave that for others, but it should not be hard. The dead mobile code in SampleBrowser will need to be updated with the appropriate SDL2 calls, and there may need to be a change here or there in the SDL2 window system itself. I don't believe mobile devices have renderer config dialogs like desktop OS do, so I think that is a non-issue for mobile.

I also have not made a windowing system for DirectX. Again, I will leave this for others. Porting the existing windowing code from DX renderers may be tricky since those renderers seem to poorly separate out the windowing code, but a little refactoring should do the trick.
User avatar
holocronweaver
Google Summer of Code Student
Google Summer of Code Student
Posts: 273
Joined: Mon Oct 29, 2012 8:52 pm
Location: Princeton, NJ
x 47

Re: Windowing Plugin System + SDL2 plugin

Post by holocronweaver »