Jump to content

  • Log In with Google      Sign In   
  • Create Account


From Desktop to texture


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 LuchiLuchi   Members   -  Reputation: 122

Like
Likes
Like

Posted 08 October 2001 - 04:11 AM

Hi! I need texturing a cube with my desktop. That is: how could I create a texture for a quad in OGL starting width a bitmap in a hdc context ? I''ve tried copying my desktop in the clipboard and then texturing a quad, after resizing it into ^2, but nothing to do :the quad is black. I''ve tried with creating a bitmap this way (kind of...): LockWindowUpdate(hwnd=GetDesktopWindow()); hdcdesk=GetDCEx(hwnd,NULL,DCX_CACHE|DCX_LOCKWINDOWUPDATE); hdctmp=CreateCompatibleDC(hdcdesk); GetObject(hbmp,sizeof(BITMAP),&bmp); LockWindowUpdate(NULL); glGenTextures(1,&texture[0]); glBindTexture(GL_TEXTURE_2D,texture[0]); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); (GL_TEXTURE_2D,0,3,bmp.bmWidth,bmp.bmHeight,0,GL_BGRA_EXT,GL_UNSIGNED_BYTE,bmp.bmBits); The texture is very weird and it change in real time. I know the code is weird and the question may sound stupid, but i''m so tired... Thanks in advance. Write to LuchiLuchi@Hotmail.com

Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS