I'm looking for someone who might have wrote code or knows of a lib function within direct draw (8.0) that will rotate a bitmap. I am trying to get an arrow bitmap to rotate in 360 degree circle.
I'm looking for someone who might have wrote code or knows of a lib function within direct draw (8.0) that will rotate a bitmap. I am trying to get an arrow bitmap to rotate in 360 degree circle.
I thought that there wasn't DirectDraw in 8.0...?
If you're doing it with D3D, you can use the world matrix to do it.
Away.
ok i've got this started..
DirectDraw has a datastructure with a number of effects stored which is passed into the function blt
i am having trouble getting the structure init'ed.
assuming the printf fucntion sends the text to a text file, it doesn't reach that point before the program crashes.Code:LPDDBLTFX rotation; ZeroMemory(&rotation,sizeof(rotation)); rotation->dwSize = sizeof(rotation); rotation->dwRotationAngle = 90; Sys_Printf("rotation int.");
btw, DirectDraw was last updated in DX7, but all verisions of DX are backward compatable (meaning 8.0 has it).
Well you can rotate it in hardware but it is not widely supported on older video cards. Make sure you check the hardware caps and see if it is supported and if it is not just do it in software.
As far as you not getting to the printf, just step through it in the debugger. Make sure you are in windowed mode though.
"...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers
ok i was using the wrong type of structure now I am using DDBLTFX as a structure for the rotation variable, it init's fine, but now the blt is failing.
Code:HRESULT h; RECT rc = *pRect; RECT rc2 = *pRect; DDBLTFX rotation; IDirectDrawSurface7 *holder; DDSURFACEDESC2 ddsd; ZeroMemory(&rotation,sizeof(rotation)); rotation.dwSize = sizeof(rotation); rotation.dwRotationAngle = 180; Sys_Printf("rotation int."); ZeroMemory(&ddsd, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH; ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; ddsd.dwWidth = width; ddsd.dwHeight = height; if (g_pDD->CreateSurface(&ddsd, &holder, NULL) != DD_OK) Sys_Printf("CreateSurface, holder failed"); h = holder->Blt(NULL, lpSurf, &rc2, dwFlags | DDBLT_ROTATIONANGLE, &rotation);
OMFG, ok after killing myself I have found out that my hardware does not support rotations for direct draw and that DirectX which is suppost to emulate things, does emulate things, all things BUT rotation.
You can do it with D3D... (just don't ever do anything with the Z coordinates...)
Away.