DIRECT2D C + + programming conventions

Source: Internet
Author: User

Referencing libraries

#include <windows.h>//  C RunTime Header Files:#include <stdlib.h><malloc.h ><memory.h><wchar.h><math.h><d2d1.h>  <d2d1helper.h><dwrite.h><wincodec.h>

Version control macros

pragma once//Modify The following definitions if you need to target a platform prior to the ones specified below.//Refer to MSDN for the latest info in corresponding values for different platforms.#ifndef WINVER//Allow use of the features specific to Windows 7 or later.#defineWINVER 0x0700//The appropriate value to target other versions of Windows.#endif#ifndef _win32_winnt//Allow use of the features specific to Windows 7 or later.#define_win32_winnt 0x0700//The appropriate value to target other versions of Windows.#endif#ifndef UNICODE#defineUnicode#endif#defineWin32_lean_and_mean//Exclude rarely-used items from Windows headers

ASSERT macro

#ifndef Assert #if defined (DEBUG) | | Defined (_DEBUG)#define Assert (b) if (! ( b) {Outputdebugstringa ("Assert:" #b "\ n");} #else #define Assert (b)#endif//DEBUG | | _debug#endif

HINSTANCE macro

#ifndef hinst_thiscomponentextern_c image_dos_header __imagebase; #define Hinst_thiscomponent ((hinstance) &__imagebase)#endif

Releasing interface methods

template<class interface>void* *ppinterfacetorelease)    { if (*ppinterfacetorelease! = NULL)    {        (*ppinterfacetorelease),Release ();        (*ppinterfacetorelease) = NULL;    }}

DIRECT2D C + + programming conventions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.