Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I would like to flip the whole fullscreen directX output horizontally so that the final output is presented mirror inverted.

Is there a way to create a IDirect3DDevice9 instance which produces mirrored output? Or even better: is there a way I can mirror the output just before the final call to the Present(...) method of the IDirect3DDevice9?

Update/Clarification: The underlying objective is to be able to use a projector which needs vertically flipped input. The software I am currently using allows to register callbacks and hands over a handle to the IDirect3DDevice9 instance. After my method is called and returns, the directx output is presented. This repeats after each frame.

I would like to flip the presented output horizontally.

I tried the following:

  • Use settings of the projector to flip the image (not supported)
  • Find a setting in the Operating System (windows7 doesn't support flipping of the image)
  • Find a setting in the graphics driver (AMD Catalyst) but only rotation is supported, not horizontal flipping

I have only little experience with directx so please bear with me (this is also why I would appreciate sample code or at least pointers to the right direction).

Update2: I found out that I should be able to call SetTransform on the Direct3DDevice9 handle to change the D3DTS_PROJECTION with a proper Matrix. However this does not work in my example application.

share|improve this question
add comment

1 Answer

You could either adjust your projection matrix appropriately, or else do a render-to-texture and draw that texture as a fullscreen quad with flipped l and r values in an off-center ortho projection. Depends really on what you're trying to achieve with this, i.e. what's your underlying objective here? Is this for a mirrored view? Etc?

share|improve this answer
    
I added some information. TL;DR: it is for a mirrored view / not a cloned view but a horizontally flipped view. –  tobsen Apr 24 '13 at 16:26
    
I wonder what a the "adjusted projection matrix" looks like to flip the whole scene... –  tobsen Apr 25 '13 at 6:57
    
At this stage you need some basic tutorial material more than you need a specific answer to this question. Sorry to be blunt about that, but I do believe it would be of more benefit to you in the longer term as this is fairly basic stuff that you don't seem to understand. –  Jimmy Shelter Apr 25 '13 at 8:10
1  
You have to be careful when flipping using the projection matrix. All your triangles will be inverted, so if you're using backface culling, you will end up seeing your scene inside out. One could of course change the culling settings, but if you're doing more complex things, like volumetric shadows, it gets tricky. I would recommend rendering to a texture and then render that in a quad that fills the entire screen. You can then safely flip it all you want. –  Panda Pajama Apr 25 '13 at 12:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.