Perhaps a hint as to what the program is meant to do, and what the error you are talking about is? I dont get any compile errors, just a couple of warnings, the resolution changes, screen clears and then it drops back to windows. I havent read your code properly yet but it doesnt look like it's supposed to do much more from it's length.
The warnings:
GameMain.cpp(26) : warning C4305: '=' : truncation from 'const long' to 'unsigned char'
GameMain.cpp(26) : warning C4309: '=' : truncation of constant value
The code:
Code:
#include "Globals.h"
int GameMain()
{
HRESULT hret;
memset(lpddsprimary,0,sizeof(LPDIRECTDRAWSURFACE4));
if(KEYDOWN(VK_ESCAPE)) { PostQuitMessage(0); }
CLEARMEM(ddsd);
hret = lpddsback->Lock(NULL, &ddsd, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR, NULL);
if(hret != DD_OK)
{
ERR(hret);
return 1;
}
UCHAR *videomem = (UCHAR*)ddsd.lpSurface;
for(int x = 0; x < 500; x++)
{
for(int y = 0; y < 500; y++)
{
videomem[x + y * ddsd.lPitch] = _RGB(50,0,0); // warnings are on this line
}
}
hret = lpddsback->Unlock(NULL);
if(hret != DD_OK)
{
ERR(hret);
return 1;
}
hret = lpddsprimary->Flip(NULL,DDFLIP_WAIT);
if(hret != DD_OK)
{
ERR(hret);
return 1;
}
return 0;
}