Im currently learning c++ (well ive read through 1.5 tutorials and remember everything i could use some day) and trying to learn win32 (mostly just basics)
now, can someone tell me how do i render a bitmap (a 2 dimension array) on a basic window? thats all i need... as i want to edit the bits one by one on the array and then render it...
i need this to make a simple header to display a 2 dimension array on a window... how do i convert the array to the right form, or is there a better way than array to do it (like making a Bitmap and using a function to draw a pixel on it?)
*cant find the Conver2DArrayToBitMap() function*
*sad face <;C*
*finds out that array to store enuf data for color,depth and bump would take just 12 million bytes for a 1200*1000 screen*
ok i think ive now read enough of microsoft references to be able to make something working.... wich means ill try to do it tomorrow if i have time, or after few days because im uber lazy.
I *think* colors are in the form 0xAARRGGBB so full red would be 0xFFFF0000 and full blue would be 0xFF0000FF. But you'll want to test that out. Like I said I couldn't test this code (or even compile it) because I don't have a windows machine handy.
You're probably fine leaving AA as 00, since I don't think alpha blending works with BitBlt anyway.
Also, I think WinAPI has a RGB macro for this which you might be able to use.
Example usage:
1 2 3 4 5 6 7 8 9 10
// make a 100x100 bitmap
Bitmap32 foo(100,100);
// set pixel 40,32 to be full green
foo(40,32) = 0xFF00FF00;
// blit to another dc
HDC screen = /*get the screen dc or whatever */
HDC mydc = foo.GetDC();
BitBlt( /*blit from 'mydc' to 'screen'*/ );