Loading a bitmap in OpenGL

Started by
20 comments, last by Gandalf 23 years, 9 months ago
But why is the colors not right? It seems to be something wrong with the yellow colors. I think that red and blue colors if swiched.

Here is how I set up the structure for a 24 bits 256x256 bitmap:

                    HBITMAP bitmap = LoadBitmap(GetModuleHandle(NULL),MAKEINTRESOURC (IDB_BITMAP7));unsigned char data[256*256*3];            BITMAPINFO info;   BITMAPINFOHEADER header;   header.biSize = sizeof(BITMAPINFOHEADER);        header.biWidth = 256;        header.biHeight = 256;    header.biPlanes = 1;        header.biBitCount = 24;        header.biCompression = BI_RGB;   header.biSizeImage = 0;        header.biClrUsed = 0;        header.biClrImportant = 0;    info.bmiHeader = header;   info.bmiColors->rgbRed    = NULL;   info.bmiColors->rgbGreen  = NULL;   info.bmiColors->rgbBlue   = NULL;	info.bmiColors->rgbReserved = NULL;   HDC hdc = GetDC(g_App.m_hWndRender);   GetDIBits(hdc, bitmap, 0, 256, &data, &info, DIB_RGB_COLORS);   ReleaseDC(g_App.m_hWndRender, hdc);            


Gandalf the White



Edited by - Gandalf on June 22, 2000 4:47:40 AM

Edited by - Gandalf on June 22, 2000 4:48:30 AM

Edited by - Gandalf on June 22, 2000 5:20:05 AM
Gandalf the Black
Advertisement
Fixed it.

(it was the red/blue colors )

Gandalf the White

Gandalf the Black

This topic is closed to new replies.

Advertisement