|
-
Jan 23rd, 2001, 11:48 AM
#1
Thread Starter
Lively Member
Okay on my home computer, my game runs just fine. But now at school, it will not run. It stops at ddsPrimary->GetAttachedSurface(&ddscaps,&ddsBuffer);
Saying that there was an access violation. Heres the DDraw Initialization sub, is there something wrong. I believe I linked to all the apporiate files, such as DDRAW.lib, by the way I am using C++ Builder 5.0
void __fastcall TfrmMain::InitDD()
{
ddbltfx.dwSize = sizeof(DDBLTFX);
DirectDrawCreate(NULL, &lpDD, NULL);
lpDD->SetCooperativeLevel(Handle, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);// | DDSCL_ALLOWREBOOT));
lpDD->SetDisplayMode(1024,768,32);
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP | DDSCAPS_COMPLEX;
ddsd.dwBackBufferCount = 1;
lpDD->CreateSurface(&ddsd, &ddsPrimary, NULL);
ddscaps.dwCaps = DDSCAPS_BACKBUFFER;
ddsPrimary->GetAttachedSurface(&ddscaps,&ddsBuffer);
ddsBitmap = DDLoadBitmap(lpDD,szBitmap,0,0);
ddsBitmap2 = DDLoadBitmap(lpDD,szBitmap2,0,0);
DDReLoadBitmap(ddsBuffer, szBoard);
DDReLoadBitmap(ddsPrimary, szBoard);
DDSetColorKey(ddsBitmap, RGB(255,0,255));
DDSetColorKey(ddsBitmap2,RGB(255,0,255));
}
THANKS
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|