Jump to content
  • Advertisement
Sign in to follow this  
Fixxer

DDraw Help

This topic is 4439 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
here's a link that will help most of your initialization problems.
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/ddraw7/directdraw7/ddtut_0tkn.asp

Share this post


Link to post
Share on other sites
now i get this :x

------ Build started: Project: T3D Game Shell, Configuration: Debug Win32 ------
Compiling...
main.cpp
Linking...
main.obj : error LNK2019: unresolved external symbol _DirectDrawCreateEx@16 referenced in function "int __cdecl Game_Init(struct HWND__ *)" (?Game_Init@@YAHPAUHWND__@@@Z)
main.obj : error LNK2019: unresolved external symbol _IID_IDirectDraw7 referenced in function "int __cdecl Game_Init(struct HWND__ *)" (?Game_Init@@YAHPAUHWND__@@@Z)
C:\Documents and Settings\Owner\Desktop\Programming\Windows Game Programming Book\Chapter 4\T3D Game Shell\Debug\T3D Game Shell.exe : fatal error LNK1120: 2 unresolved externals
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 - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Share this post


Link to post
Share on other sites
Quote:
Original post by bakery2k1
You need to link to (IIRC) ddraw.lib and dxguid.lib.

i concur.
fixxer i already gave you directions to add .libs to your project. use them to do the same for your those two .libs [smile]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!