标签:blog io ar div cti log amp on line
GLuint Texture[1]; HBITMAP hBMP; BITMAP BMP; glGenTextures(1, &Texture[0]); hBMP = (HBITMAP)LoadImage(NULL, L"xxx.bmp", IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION | LR_LOADFROMFILE); if (!hBMP) return FALSE; GetObject(hBMP, sizeof(BMP), &BMP); glPixelStorei(GL_UNPACK_ALIGNMENT, 4); glBindTexture(GL_TEXTURE_2D, Texture[0]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, 3, BMP.bmWidth, BMP.bmHeight, 0, GL_BGR_EXT, GL_UNSIGNED_BYTE, BMP.bmBits); DeleteObject(hBMP);
标签:blog io ar div cti log amp on line
原文地址:http://www.cnblogs.com/idoublewei/p/3945684.html