uhm is there no way to make it 8-bit O.o
without changing the whole's screen resolution =/
come on... directx/windows has for everything a function lol
DirectX in a Window(need help)
Yep. That would do it. Then you can either declare your VRam as a 16/32-bit pointer, or set the individual bytes directly through the UCHAR *. If you change your pointer declaration, you can still use same indexing you have now. If not, you will need to multiply your indices by the number of bytes per pixel.
You have VRam declared as UCHAR *. If you change that to UINT * or DWORD * (depending on 16- or 32-bit), then you can use the same indexing scheme you have now (row * width + col). If you leave it a UCHAR *, then you have to use multiply your index by 2 or 4.
bool DrawAll(){ if(!Bouncy_ClearBack())return(false); int x,y,Linewidth; UINT *VRam; DDSURFACEDESC2 ddsd; HRESULT ddrval; ZeroMemory(&ddsd,sizeof(ddsd)); ddsd.dwSize=sizeof(ddsd); lpDDSBack->Lock(NULL,&ddsd,DDLOCK_SURFACEMEMORYPTR|DDLOCK_WAIT,NULL); Linewidth=ddsd.lPitch; VRam=(UINT *)ddsd.lpSurface; for(x=0;x<400;x++){ for(y=0;y<10;y++){ VRam[x+(y*Linewidth)]=235; } } lpDDSBack->Unlock(NULL); Bouncy_Flip(); return(true);}
like this? =/
now i have some weird blue lines xD
Sorry, I didn't notice that Linewidth was set to the lPitch. lPitch is the number of bytes per row. Since you've used UINT * for your pointer, you need to divide the lPitch by 2 to get the number of UINTs per line.
Also, to get the color you want, you have to play some games. Take a look at this article. It describes how to determine the number of bits per color for your 16-bit mode and then convert individual red/green/blue values into a 16-bit color value.
Also, to get the color you want, you have to play some games. Take a look at this article. It describes how to determine the number of bits per color for your 16-bit mode and then convert individual red/green/blue values into a 16-bit color value.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement