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.


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?

  • \$\begingroup\$ I added some information. TL;DR: it is for a mirrored view / not a cloned view but a horizontally flipped view. \$\endgroup\$ – tobsen Apr 24 '13 at 16:26
  • \$\begingroup\$ I wonder what a the "adjusted projection matrix" looks like to flip the whole scene... \$\endgroup\$ – tobsen Apr 25 '13 at 6:57
  • \$\begingroup\$ 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. \$\endgroup\$ – Maximus Minimus Apr 25 '13 at 8:10
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – Panda Pajama Apr 25 '13 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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