[UWP] (C++) How to add the MoveLookController class from msdn to my app (D3D/DX 11)

Fay Wang - MSFT 5,196 Reputation points
2019-12-12T08:12:25.027+00:00

Source Link: MSDN

----------

Hi,

How to add the following class to a new DirectX 11 App (Universal Windows) in C++:

https://learn.microsoft.com/en-us/windows/uwp/gaming/tutorial--adding-controls

I am new to C++ and I wanted to add the MoveLookController Class to my new DX11 App but I don't know how to call functions of it. I can add it to my Project but in the App.cpp InteliSense says: "Identifier 'MoveLookController' is undefined".

The projectname is Sample3DGameDX.

Right now I know how I can Change the direction where the camera is Looking from which Point and I can tilt it zoom in but I now want to make the controls for it but I cant access the MoveLookController class without defining it... And I don't know how to make itin C++.

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Fay Wang - MSFT 5,196 Reputation points
    2019-12-12T08:15:13.427+00:00

    Hi,

    Welcome to our Microsoft Q&A platform!

    When you tried to use MoveLookController Class, did you include the .h file of MoveLookController? If you didn't include it, it can't directly find MoveLookController. For example, I added the .h and .cpp files under Content folder in my project. So I include the .h file like below:

    #include "Content/MoveLookController.h"  
    

    And after including the file, if you want to initialize the MoveLookController class:

    MoveLookController^ m_controller = ref new MoveLookController(CoreWindow::GetForCurrentThread());  
    

    For more details about how to use MoveLookController class, you can refer to this official sample.

    Thanks.

    0 comments No comments

  2. valaki2K18ban 21 Reputation points
    2020-09-11T02:03:22.143+00:00

    Sorry for my instant responding... 😬 I put this project aside and tried to get more familiar with basic C++ instead of making a game at first try... This worked thanks!

    0 comments No comments