In my WP8 Direct3D with XAML application, when I rotate the device the XAML elements properly rotate with orientation but not the Direct3D view. What is the recommended method to update the Direct3D view after an orientation change?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Look at this MSDN article (How to detect screen orientation from a Direct3D app for Windows Phone 8). Once you’ve detected the orientation change, I would recommend using the World Transform to rotate your Direct3D view. You will also have to re-jigger your projection matrix for this to work correctly.
You could also concatenate the new World transform with your current View and never set the View transform (always Identity) – that might get you better performance on certain platforms.
Hope this helps!