Original Post
Hi I hope someone can help me, I haven't been able to find anything on the net.. I have here an array of intensities I want to plot on the screen (like texturemapping just without having it as a bitmap). This is 16 bit format and a size og 512*512 pixels, I can't find any tutorials on this or examples. I have tried just to pass the values to a struct, taken from a tutorial "Vertices" from SDK homepage, but the tutorial works with 32bit and complaines about stack overflow when the arrays gets to 64K bytes. Does anyone have a good idea to how I can view this?
const static int width = 512; //image width
const static int hight = 512; //image hight
const int numPixels = width*hight; //total numbers of pixels in image
unsigned short *arrIn = new unsigned short[numPixels]; //Array containing intensities
int index = 0; //index in my array
int _x,_y; //x and y of image
unsigned short lightInt = 65535; //white
unsigned short darkInt = 0; //black
for(int row = 0; row < hight; row++){ //for-loop counting y
_y=row; //y increases 1 everytime x has gone from 0 to 511
for(int kolonne = 0; kolonne < width; kolonne++){ //for-loop counting x
_x=kolonne; //x increases 1 until 511 and starts over from 0
if(_x == _y){ //whenever x and y are the same, we make the pixel white, wich result in a white line from (0,0) to (511,511)
arrIn[index]=lightInt;
}//end if
else(arrIn[index] = darkInt); //otherwise the rest should be black
index++; //going through the array.
}//end for
}//end for