Alright I am getting these errors
directxplease.obj : error LNK2001: unresolved external symbol _DirectDrawCreateEx@16
directxplease.obj : error LNK2001: unresolved external symbol _IID_IDirectDraw7
Debug/directxone.exe : fatal error LNK1120: 2 unresolved externals
with this code
#include <windows.h>
#include <ddraw.h>
LPDIRECTDRAW7 g_DD = NULL;
LPDIRECTDRAWSURFACE7 g_DDSPrimary = NULL;
LPDIRECTDRAWSURFACE7 g_DDSBack = NULL;
HWND g_hwnd;
LRESULT CALLBACK WndProc(HWND hwnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam)
{
switch(Msg)
{
case WM_DESTROY :
PostQuitMessage(0);
return 0;
case WM_SETCURSOR:
SetCursor(NULL);
return 0;
}
return DefWindowProc(hwnd, Msg, wParam, lParam);
}
static int InitApp(HINSTANCE hInstance, int nCmdShow)
{
WNDCLASS wc;
DDSURFACEDESC2 sd;
DDSCAPS ddsc;
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hbrBackground =(HBRUSH) GetStockObject(BLACK_BRUSH);
wc.hCursor =LoadCursor((HINSTANCE)NULL, IDC_ARROW);
wc.hIcon =LoadIcon((HINSTANCE)NULL, IDI_APPLICATION);
wc.hInstance =hInstance;
wc.lpfnWndProc =WndProc;
wc.lpszClassName ="MainWndClass";
wc.lpszMenuName =NULL;
if(!RegisterClass(&wc))
{
return FALSE;
}
g_hwnd = CreateWindow(wc.lpszClassName,
"DirectDraw Sample 1",
WS_POPUPWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
(HWND) NULL,
(HMENU) NULL,
hInstance,
(LPVOID) NULL);
if(!g_hwnd)
{
return TRUE;
}
ShowWindow(g_hwnd,nCmdShow);
UpdateWindow(g_hwnd);
if FAILED(DirectDrawCreateEx(NULL,
(void **)&g_DD,
IID_IDirectDraw7,
NULL))
{
return TRUE;
}
if FAILED(g_DD->SetCooperativeLevel(g_hwnd,
DDSCL_EXCLUSIVE |
DDSCL_FULLSCREEN))
{
return TRUE;
}
ZeroMemory(&sd, sizeof(sd));
sd.dwSize =sizeof(sd);
sd.dwFlags =DDSD_CAPS | DDSD_BACKBUFFERCOUNT;
sd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE |
DDSCAPS_FLIP |
DDSCAPS_COMPLEX;
sd.dwBackBufferCount=1;
if (FAILED(g_DD->CreateSurface(&sd,&g_DDSPrimary, NULL)))
{
return TRUE;
}
return TRUE;
}
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
MSG msg;
InitApp(hInstance, nCmdShow);
MessageBox(g_hwnd, "Press ALT+F4 TO QUIT....." , "MESSAGE", MB_OK);
while(GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return TRUE;
}
Thanks for any help