   Issue with my d3d Class
  how come the fallowing code does not make the window go green?class Draw{private:LPDIRECT3D9 d3d;LPDIRECT3DSURFACE9 backbuffer;LPD3DXSPRITE spriteobj;LPDIRECT3DDEVICE9 d3ddev;public:Draw(){d3d = NULL;d3ddev = NULL;backbuffer = NULL;spriteobj = NULL;}  Draw(HWND hwnd,int width,int height,bool fullscreen){if(!Direct3D_Init(hwnd,width,height,fullscreen)){ MessageBox(hwnd, "Program int", "Failed", MB_OK);}}bool Direct3D_Init(HWND,int,int,bool);LPDIRECT3DDEVICE9 get_device(){return d3ddev;}LPD3DXSPRITE get_sprObj(){ return spriteobj;}};bool Draw::Direct3D_Init(HWND window, int width, int height, bool fullscreen){MessageBox(window, "Game_Init", "BREAKPOINT", 0);    //initialize Direct3D    d3d = Direct3DCreate9(D3D_SDK_VERSION);if (d3d == NULL)    {   MessageBox(window, "Error initializing Direct3D", "Error", MB_OK);   return 0;    }    //set Direct3D presentation parameters    D3DPRESENT_PARAMETERS d3dpp;ZeroMemory(&d3dpp, sizeof(d3dpp));    d3dpp.hDeviceWindow = window;    d3dpp.Windowed = (!fullscreen);    d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;    d3dpp.EnableAutoDepthStencil = 1;    d3dpp.AutoDepthStencilFormat = D3DFMT_D24S8;    d3dpp.Flags = D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL;    d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;    d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;    d3dpp.BackBufferCount = 1;    d3dpp.BackBufferWidth = width;    d3dpp.BackBufferHeight = height;    //create Direct3D device   d3d->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window,   D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &d3ddev);    if (d3ddev == NULL)    {   MessageBox(window, "Error creating Direct3D device", "Error", MB_OK);   return 0;    }    //get a pointer to the back buffer surface   d3ddev->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &backbuffer);    //create sprite object    D3DXCreateSprite(d3ddev, &spriteobj);    return true;}and the main game loopconst int SCREENW = 1024;const int SCREENH = 768;const string APPTITLE = "Anti-Virus Game";Draw NewGame(window,SCREENW,SCREENH,false);bool Game_Init(HWND window){return true;}void Game_Run(HWND window){if(!NewGame.get_device()) {  MessageBox(window, "Device", "Failed", MB_OK);return;}NewGame.get_device()->Clear(0, NULL, D3DCLEAR_TARGET| D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0,255,0), 1.0f, 0);if(NewGame.get_device()->BeginScene()){NewGame.get_device()->EndScene();NewGame.get_device()->Present(NULL,NULL,NULL,NULL);}}All I get is a white window and I have ran debug and I dont see any errors   
  Try moving the call to Clear between BeginScene and EndScene.   ;  It is still white after moving it.;  Try to check the Result of Clear. Maybe it returns an errorcode.Then try to only clear the target without zbuffer.   