Original Post
I am trying to start learning direct draw, and I am coming across these errors and do not know how to fix them. ------ Build started: Project: T3D Game Shell, Configuration: Debug Win32 ------ Compiling... main.cpp .\main.cpp(192) : error C2062: type 'void' unexpected .\main.cpp(193) : error C2143: syntax error : missing ';' before '{' Build log was saved at "file://c:\Documents and Settings\Owner\Desktop\Programming\Windows Game Programming Book\Chapter 4\T3D Game Shell\T3D Game Shell\Debug\BuildLog.htm" T3D Game Shell - 2 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== here is my code
int Game_Init(HWND hwnd)
{
// this is called once after the window is created, and before the main loop
LPDIRECTDRAW7 lpdd7 = NULL; // direct draw 7 interface
if (FAILED(DirectDrawCreateEx(NULL,(**void)&lpdd7, IID_IDirectDraw7, NULL))) // line 192 ****************
{
//error
}// end if
// set cooperation level
if (FAILED(lpdd7->SetCooperativeLevel(hwnd,DDSCL_NORMAL | DDSCL_FULLSCREEN)))
{
//error
}// end if
// return success or failure
return(1);
}// end game init