🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
Moving the background map right and left. How ?
Hi,
all newer graphics-cards support surfaces bigger than the screen, so you could simply have a screen-res of 640x480 and put a 800x600-bitmap into an offscreen-surface. Now you can just blit from where you want, just be sure you don''t blit anything beside the offscreen-surface.
You could simply increase x when hitting ''->'', decrease it when hitting ''<-'', etc.
CU
Graphix Coding @
Skullpture Entertainment
all newer graphics-cards support surfaces bigger than the screen, so you could simply have a screen-res of 640x480 and put a 800x600-bitmap into an offscreen-surface. Now you can just blit from where you want, just be sure you don''t blit anything beside the offscreen-surface.
// You already created your primary surface & backbufferZeroMemory(&ddsd, sizeof(ddsd));ddsd.dwSize = sizeof(ddsd);ddsd.dwFlags = DDSD_CAPS / DDSD_WIDTH / DDSD_HEIGHT;ddsd.dwHeight = 600;ddsd.dwWidth = 800;ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;lpDD->CreateSurface(&ddsd, &lpDDSOffscreen, NULL);DDReLoadBitmap(lpDDSOffscreen, "myBigMap.bmp");RECT rect;rect.top = y;rect.bottom = y + 480;rect.left = x;rect.right = x + 640;lpDDSBack->BltFast(0, 0, lpDDSOffscreen, ▭, NULL);lpDDSPrimary->Flip(lpDDSBack, NULL);
You could simply increase x when hitting ''->'', decrease it when hitting ''<-'', etc.
CU
Graphix Coding @
Skullpture Entertainment
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement