🎉 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!
HELP!!!!!!!!!!!!!
As for speed, that really depends on when you're planning on loading bitmaps into the surfaces in your game. If you're just doing the loading during a specific loading period and not during the actual game action it should work fine as long as you're not loading too much that way.
At first glance I don't notice any problems with the code posted...
And Kill I used the DDloadbitmap ind another program I just tried to do it other way.
thanks:
_José
- does it work if you use Blt() instead of BltFast?
- where's the Flip() command? Or are you using one?
Mason McCuskey
Spin Studios
www.spin-studios.com
I need some help guys, I trying to load a bitmap to a surface but nothing happens.
I mean DD initialize (I know because the screen goes black, and when press esc escape) but the bitmap does'n show up
here is my code:
void ProcesoPrincipal()
{
secundaria->BltFast(0,0,fuera1,▭,DDBLTFAST_NOCOLORKEY);
primaria->BltFast(0,0,secundaria,▭,DDBLTFAST_WAIT | DDBLTFAST_SRCCOLORKEY);
}
IDirectDrawSurface* CreaBitmap(IDirectDraw* dd, LPCTSTR arc, int dw, int dh)
{
HBITMAP hbm;
BITMAP bm;
DDSURFACEDESC surf;
IDirectDrawSurface* superficie;
HDC hdcb;
HDC hdcs;
hbm = (HBITMAP)LoadImage(NULL,arc,IMAGE_BITMAP,dw,dh,LR_LOADFROMFILE | LR_CREATEDIBSECTION);
GetObject(hbm,sizeof(bm),&bm);
ZeroMemory(&surf,sizeof(surf));
surf.dwSize = sizeof(surf);
surf.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
surf.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
surf.dwWidth = bm.bmWidth;
surf.dwHeight = bm.bmHeight;
if (dd->CreateSurface(&surf,&superficie,NULL) !=DD_OK) return NULL;
//copia el bitmap a la superficie///
hdcb = CreateCompatibleDC(NULL);
SelectObject(hdcb,hbm);
superficie->GetDC(&hdcs);
StretchBlt(hdcs,0,0,surf.dwWidth,surf.dwHeight,hdcb,0,0,bm.bmWidth,bm.bmHeight,SRCCOPY);
superficie->ReleaseDC(hdcs);
DeleteDC(hdcb);
DeleteObject(hbm);
return superficie;
}
some of the names are in spanish, I'm spanish talking.
thanks in advance:
_José
and yes I used Flip() but in the main function.
thanks anyway guys you are the greatest