Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. If you have time could you give me your opinion of my dx code / fixes

If you have time could you give me your opinion of my dx code / fixes

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialannouncement
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tom_dx
    wrote on last edited by
    #1

    #define WIN32_LEAN_AND_MEAN // no to MFC /////////////////////////////////////////////////////////////////////////////////////////// // INCLUDE DIRECTIVES ///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////// #include #include #pragma warning( disable : 4996 ) // disable deprecated warning #include #pragma warning( default : 4996 ) /////////////////////////////////////////////////////////////////////////////////////////// // DEFINES //////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////// // for D3D objects that don't have an explicit release function #define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } } // free up anything allocated with "new" #define SAFE_DELETE(p) { if(p) { delete (p); (p)=NULL; } } // anything allocated with new [] #define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p)=NULL; } } // The window caption. #define WINDOW_CAPTION L"D3D Tutorial 01: CreateDevice" // The window class. #define WINDOW_CLASS L"D3D Tutorial" /////////////////////////////////////////////////////////////////////////////////////////// // FUNCTION PROTOTYPES //////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////// HRESULT InitD3D( HWND hWnd ); VOID Cleanup(); VOID Render(); /////////////////////////////////////////////////////////////////////////////////////////// // GLOBAL VARIABLES /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////// LPDIRECT3D9 g_pD3D = NULL; // Used to create the D3DDevice LPDIRECT3DDEVICE9 g_pd3dDevice = NULL; // Our rendering device /////////////////////////////////////////////////////////////////////////////////////////// // FUNCTION DEFINITIONS /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////// HRESULT InitD3D( HWND hWnd ) { // Create the D3D object, which is needed to create the D3DDevice. if( ( g_pD3D = Direct3DCreate9( D3D_SDK_VERSION ) ) == NULL ) { return E_FAIL; } // Set up the structure used to create

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups