Quote Originally Posted by waldronate View Post
The best way to keep dialogs on top of the main window is to make the main window the parent window of the dialog.
done. past the trauma of first app with dialogs (and learned what topmost means explicitly!)

added the updated app in itw thread, and now it's time for me to dig into procedural territory (ha).


..question (...)

obviously using a hacked bitblt code to display, (which i presume means to everyone that i'm using a pointer to write to the image array) and i've noticed that my RGB has to be written BGR... i was quite puzzled when my water was orange..

is this correct, or am i, as i suspect, writing one byte off? i'm sure i'll be able to adjust this when i've added the routine to export the fullsize bitmap and examine the top left and bottom right pixels...




as said, copied from someone who has a deeper understanding of what they were doing..

void deinit_framebuf(void) {
SelectObject(pDC,old);
DeleteDC(pDC);
DeleteObject(framebmp);
}

void init_framebuf(void) {
HDC hdc;
BITMAPINFO bitmapinfo;
hdc = CreateCompatibleDC(NULL);
bitmapinfo.bmiHeader.biSize=sizeof(BITMAPINFOHEADE R);
bitmapinfo.bmiHeader.biWidth=1024;
bitmapinfo.bmiHeader.biHeight=-512;
bitmapinfo.bmiHeader.biPlanes=1;
bitmapinfo.bmiHeader.biBitCount=32;
bitmapinfo.bmiHeader.biCompression=BI_RGB;
bitmapinfo.bmiHeader.biSizeImage=0;
bitmapinfo.bmiHeader.biClrUsed=256;
bitmapinfo.bmiHeader.biClrImportant=256;
framebmp = CreateDIBSection(hdc, &bitmapinfo, DIB_RGB_COLORS, (void**)&framebuf, 0, 0);
pDC = CreateCompatibleDC(NULL);
old = (HBITMAP)SelectObject(pDC, framebmp);
DeleteDC(hdc);
}



for (y = 0; y < 512; y++) {
z = y << 10;
for (x = 0; x < 1024; x++) {
*(framebuf + z + x) = RGB(blah);
} }