ForceRift - Force applications to run on your Rift

Post Reply
psyqo
One Eyed Hopeful
Posts: 3
Joined: Sat Aug 10, 2013 11:04 am

ForceRift - Force applications to run on your Rift

Post by psyqo »

Hey all,

Ever since receiving my Rift (yay!) I've found myself struggling with configuration files/hotkeys to get some applications to run on my Rift instead of my primary display. Things like RiftCoaster, MineCrift, HL2 etc. detect the Rift and render to its display, but some others do not.

It seems that most of you just clone your displays to get around this issue. This is easy to do as 1920x1080 and 1920x1200 displays are very common these days.
My primary display is a 30" running at 2560x1600 though. For me, cloning would mean running at the highest 16:10 resolution supported by the Rift, which is 1920x1200. As this is not a native resolution for my primary, things look fuzzy etc.
Using the Rift as primary is kinda irritating as new windows will automatically appear there etc.
Others are using an application to change their settings before/after launching a Rift app. I've tried it and did not like it, not one bit.

So I wrote a simple application launcher which hides all displays except for the Rift and it seems to work for the titles I've tried:
- Unity3d with OpenGL rendering, which does not honor the -adapter setting
- Unity3d with Direct3D 11 rendering, same as above
- RiftQuake by Dominic Szablewski

Usage is simple: ForceRift.exe <command line for Rift app>

It works by hooking some WinAPI calls to hide other displays as the Rift. This method is often employed by malware and may cause an alert by your anti-virus. You can trust me, but if you don't you can compile it yourself as the source code is included in the zip file :)

I would appreciate it very much if you guys tried it out to see if it makes your life a bit easier. Hopefully we will not need things like this anymore once all Rift-ready software detects it correctly :)

Thanks!

Some Warnings:
- This is very much ALPHA software and will very likely contain all sorts of interesting bugs. I've posted this to get bug reports (or better, patches fixing them!) so I can improve ForceRift.
- I would not recommend using ForceRift with games that employ anti-cheat features such as PunkBuster as they may flag you as a cheater for injecting a DLL.
- Programmers that enjoy tidy code may start crying uncontrollably, just by looking at the source code. I enjoy tidy code too, but this is a bit of a PoC, so the code is still a mess.

Version History:
0.1 - Initial public ALPHA release.

Thanks To:
- Gil Dabah for diStorm, the ultimate disassembler library.
- Jan Newger for NInjectLib (http://newgre.net/ninjectlib) and NCodeHook (http://newgre.net/ncodehook)
You do not have the required permissions to view the files attached to this post.
shole
One Eyed Hopeful
Posts: 32
Joined: Fri Nov 09, 2012 3:24 pm

Re: ForceRift - Force applications to run on your Rift

Post by shole »

interesting.
this should be integrated with something like desktope.
then you wouldn't have to take off the rift at all.
Xemakon
One Eyed Hopeful
Posts: 42
Joined: Sat Jan 05, 2013 6:46 pm

Re: ForceRift - Force applications to run on your Rift

Post by Xemakon »

I will try this. Some games, like DungeonmaVR for example, do not use the - adapter n in unity. This would be helpful for those situations.
psyqo
One Eyed Hopeful
Posts: 3
Joined: Sat Aug 10, 2013 11:04 am

Re: ForceRift - Force applications to run on your Rift

Post by psyqo »

Xemakon wrote:I will try this. Some games, like DungeonmaVR for example, do not use the - adapter n in unity. This would be helpful for those situations.
Thank you for trying! It could be that DungeonmaVR uses Direct3D 11 or OpenGL for rendering, that would explain the behavior.
Please let me know if you encounter any issues.
Mattijs
Cross Eyed!
Posts: 108
Joined: Thu May 30, 2013 5:46 am

Re: ForceRift - Force applications to run on your Rift

Post by Mattijs »

FANTASTIC!!
Post Reply

Return to “Oculus VR”