void SGSprite::Load(char *file, LPDIRECT3DDEVICE9 device){ D3DXCreateTextureFromFile(device, (LPCWSTR)file, &texture); D3DXCreateSprite(device, &sprite);}
This right here is very,
very bad. I'm guessing when you first put in the D3DXCreateTextureFromFile, the compiler complained to you because it expected an LPCWSTR (AKA const wchar_t*, a pointer to a string of Unicode characters) rather than an LPCSTR (AKA const char*, a pointer to ANSI characters). Simply casting your pointer from one type to the other will make the compiler shut up, but is wrong because you're sending one type of data while the function is expecting something completely different. Worse yet, the function has no idea that you sent it bogus data (since all it knows is the pointer type), and will happily operate on the data as if it were Unicode characters. In this case the function is probably failing since your ANSI string probably translates to nonsense in Unicode and therefore it doesn't find a file with that name existing anywhere, but in other situations this can lead to very hard-to-find bugs (notice how your program doesn't even crash, the function just fails).
Now it's completely understandable if you're confused about how Unicode and ANSI works, since typically most programmers coming from working with simple console apps have never even heard of Unicode and are used to just working with char* and std::string. I know I was pretty confused at first when I started Windows programming and had to deal with these issues myself. My advice is to do some research either at MSDN or elsewhere on how Unicode works in the Windows API (DirectX handles it almost the exact same way in most cases), or if you want I will happily explain some if it for you here. Then, I would advise picking writing your apps to only use Unicode, which means only using wchar_t* (or WCHAR* or LPWSTR), std::wstring if you're using string classes, and prepending your string literals with an "L" to make them Unicode.
Oh and in case you missed the original point...don't use casts unless you know exactly why you should be doing that cast. And if you are using casts, use the C++ style casts (static_cast, reinterpret_cast, dynamic_cast) rather than C-style casts.