Hello again, I'm back with what seems to be a bug with DarkGDK but might just be with my code.
Here's some memblock manipulation code I've written:
_ews_imgID=1001;
dbLoadImage("media\\test\\ews_test.dds",_ews_imgID);
dbMakeMemblockFromImage(_ews_imgID,_ews_imgID);
dbTextureObject(_ews_objID,_ews_imgID);
//Going to try to make a straight line in the image(black)
int memImgWidth=dbMemblockDword(_ews_imgID,0);
int memImgHeight=dbMemblockDword(_ews_imgID,4);
int memColorDepth=dbMemblockDword(_ews_imgID,8);
int memSize=dbGetMemblockSize(_ews_imgID);
int memExist=dbMemblockExist(_ews_imgID);
//needs to start at pos 12(4th DWORD)
//formula for position in memblock
//DWORD pos=3+(memWidth*y)+offset
//offset is x-coord in one row of the image
for(int i=0;i<memImgHeight;++i)
{
int pos=3+(memImgWidth*i)+2;
pos*=4; //so it's in bytes
DWORD pixel=dbMemblockDword(_ews_imgID,pos); //pixel in BGRA format
unsigned char iB,iG,iR,iA;
iB=dbMemblockByte(_ews_imgID,pos);
iG=dbMemblockByte(_ews_imgID,pos+1);
iR=dbMemblockByte(_ews_imgID,pos+2);
iA=dbMemblockByte(_ews_imgID,pos+3);
dbWriteMemblockDword(_ews_imgID,pos,0);
//c = (a and 0xff) << 24 or ((r and 0xff) << 16) or ((g and 0xff) << 8) or (b and 0xff)
DWORD newPixel=(iA && 0xff) << 24 || ((iR && 0xff) << 16) || ((iG && 0xff) << 8) || (iB && 0xff); //just checking to see if it works
int randomAssign=i;//just so the debugger stops after the DWORD assignment.
}
dbDeleteImage(_ews_imgID);
dbMakeImageFromMemblock(_ews_imgID,_ews_imgID);
dbDeleteMemblock(_ews_imgID);
And whenever I use a break point within the function(all of the code is in a setup function for one of my classes) the variable memExist always equals 0. I've tried using .png instead of .dds and I've loaded it as a pixel-perfect image instead of a texture. DarkGDK will not make the memblock.
Any idea why? I've attached "ews_test.dds" if you need it.