locked
Are these functions and parameters used in DirectX 11.2?

    Question

  • Functions and parameters like WINAPI, hPrevInstance, hInstance , PSTR etc are used in DirectX 11.2?
    Sunday, March 1, 2015 10:35 AM

Answers

  • WinMain is not used in Windows Store apps (the subject of this forum). WinMain is the entry point for desktop apps compiled either 32-bit and 64-bit (or 16-bit, which is where hPrevInstance came from). See  WinMain entry point.

    WINAPI is a calling convention wrapper which may be used in any app calling Windows API. See Obsolete Calling Conventions

    Sunday, March 1, 2015 11:52 PM
    Owner
  • This is the entry-point for a Windows desktop application (aka Win32 application) whatever the architecture it is running on (32-bit or 64-bit native).

    int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR lpCmdLine, _In_ int nCmdShow)

    This is not used for Windows Store apps or Windows phone apps which instead use:

    [Platform::MTAThread]
    int main(Platform::Array<Platform::String^>^)

    I suspect you are using this forum as it's the only one that mentions "DirectX" but you aren't writing a Windows Store app. You should take al look at the Direct3D Win32 Game Visual Studio template for VS 2013 or this tutorial for an example of how to set up a DirectX 11 device and swap chain for a Windows desktop application for 32-bit and 64-bit native.


    Monday, March 2, 2015 6:33 AM

All replies

  • What is the reason for your question exactly?

    WINAPI is a standard macro from 'minwindef.h' which ensures all the C calling convention for OS functions are using __stdcall

    PSTR is a standard type from 'ntdef.h' commonly used in Windows APIs.

    DirectX 11.2 is supported for both Win32 desktop applications and Windows Store applications. You have to use the IDXGIFactory2::CreateSwapChainForCoreWindow for setting up the swapchain for a "DirectX" app, you use IDXGIFactory2::CreateSwapChainForComposition for setting up a swapchain for a "DirectX / XAML" app, and you use IDXGIFactory2::CreateSwapChainForHwnd (or the older CreateSwapChain) for setting up a swapchain for a Win32 window.



    Sunday, March 1, 2015 7:10 PM
  • Thanks for the reply.

    I have one last question - 

    WINAPI and WinMain() function is used in Win64 applications too?

    and every time the same parameters are passed when we use WinMain() function regardless of what we are doing?

    Thanks

    Indy

    Sunday, March 1, 2015 10:48 PM
  • WinMain is not used in Windows Store apps (the subject of this forum). WinMain is the entry point for desktop apps compiled either 32-bit and 64-bit (or 16-bit, which is where hPrevInstance came from). See  WinMain entry point.

    WINAPI is a calling convention wrapper which may be used in any app calling Windows API. See Obsolete Calling Conventions

    Sunday, March 1, 2015 11:52 PM
    Owner
  • This is the entry-point for a Windows desktop application (aka Win32 application) whatever the architecture it is running on (32-bit or 64-bit native).

    int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR lpCmdLine, _In_ int nCmdShow)

    This is not used for Windows Store apps or Windows phone apps which instead use:

    [Platform::MTAThread]
    int main(Platform::Array<Platform::String^>^)

    I suspect you are using this forum as it's the only one that mentions "DirectX" but you aren't writing a Windows Store app. You should take al look at the Direct3D Win32 Game Visual Studio template for VS 2013 or this tutorial for an example of how to set up a DirectX 11 device and swap chain for a Windows desktop application for 32-bit and 64-bit native.


    Monday, March 2, 2015 6:33 AM