Add pre-render method to VRViewManager in preparation for adding Oculus

Rift support. See
https://hub.jmonkeyengine.org/t/libovr-oculus-rift-support/39427
This commit is contained in:
Campbell Suter 2017-09-28 12:51:27 +13:00
parent 132b0abc50
commit 4ce05dd0ca
No known key found for this signature in database
GPG Key ID: 754A66CCF3F73C0F
3 changed files with 20 additions and 0 deletions

View File

@ -432,6 +432,16 @@ public class VRAppState extends AbstractAppState {
} }
} }
@Override
public void render(RenderManager rm) {
super.render(rm);
// update compositor
if( environment.getVRViewManager() != null ) {
environment.getVRViewManager().render();
}
}
@Override @Override
public void initialize(AppStateManager stateManager, Application app) { public void initialize(AppStateManager stateManager, Application app) {
super.initialize(stateManager, app); super.initialize(stateManager, app);

View File

@ -129,6 +129,10 @@ public abstract class AbstractVRViewManager implements VRViewManager {
return environment; return environment;
} }
@Override
public void render() {
}
/** /**
* Handles moving filters from the main view to each eye * Handles moving filters from the main view to each eye
*/ */

View File

@ -150,6 +150,12 @@ public interface VRViewManager {
*/ */
public void update(float tpf); public void update(float tpf);
/**
* Set up the scene for rendering.
* This method should be called before any rendering takes place.
*/
public void render();
/** /**
* Send the rendering result as textures to the two eyes. * Send the rendering result as textures to the two eyes.
* This method should be called after all the rendering operations * This method should be called after all the rendering operations