i just want the complete Desktop in a SDL_Surface…
As anyone any helpful suggestions for me…
im trying to do it myself but im not getting any further than this…
void Create_TextureDesktop(void) {
HDC DeskDc;
HDC TempDC, PaintDC;
HBITMAP MyBitmap;
HGDIOBJ hobj;
BITMAPINFOHEADER bih;
bih.biSize=sizeof(bih);
bih.biWidth=256;
bih.biHeight=256;
bih.biPlanes=1;
bih.biBitCount=16;
bih.biCompression=BI_RGB;
bih.biSizeImage=0;
bih.biXPelsPerMeter=2000;
bih.biYPelsPerMeter=2000;
bih.biClrUsed=0;
bih.biClrImportant=0;
DeskDc = GetDC(GetDesktopWindow());
MyBitmap = CreateDIBitmap(DeskDc,&bih,CBM_INIT
NULL,NULL,DIB_RGB_COLORS );
/* MyBitmap = CreateCompatibleBitmap(DeskDc,256,256);/
/ hobj = SelectObject(DeskDc,MyBitmap);/
/ PaintDC = GetDC(MyBitmap);
BitBlt(PaintDC, 0, 0, 256,256, DeskDc 0, 0, SRCCopy);/
GetObject(hobj,sizeof(myb),&myb );
/ ReleaseDC(GetDesktopWindow(), DeskDc);*/
}
than im trying to generate an opengl texture with
glBindTexture(GL_TEXTURE_2D, texture[0]); // 2d texture (x and y size)
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); // cheap
scaling when image bigger than texture
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); // cheap
scaling when image smalled than texture
glTexImage2D(GL_TEXTURE_2D, 0, 3, 256, 256, 0, GL_RGB, GL_UNSIGNED_BYTE,
myb.bmBits);
any help would be great…
Zeeya
PeZ2001