Thread: How to load background pic/texture in OpenGl?

  1. #1
    Registered User
    Join Date
    Jul 2005
    Posts
    26

    How to load background pic/texture in OpenGl?

    Hey guys,

    Does anyone know how can i load a background picture for my OpenGL program or a texture? By deafult the background is black and i know i can change it by using following code:
    Code:
    glClearColor(1.0f, 0.0f, 0.0f, 0.5f);
    However, i want to load a a image and set it as background. Anyone please help me?
    Thanks in advance. Help would be really apperciated!!

  2. #2
    Dump Truck Internet valis's Avatar
    Join Date
    Jul 2005
    Posts
    357
    well, you could either do it with the windows api instead, call LoadBitmap and then BitBlt it to the window background
    Or if you want to use opengl you could create a face in your window area and slap the texture onto that, use DevIL to load the texture.

  3. #3

  4. #4
    Registered User
    Join Date
    Jul 2005
    Posts
    26
    Interesting!! Thanks eh. you seem fan of porn e-mails
    I've figured out how to do it. I simply drew a quad and then texture it with a ".bmp" file.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Using OpenGL to load a map
    By Epikhigh in forum C# Programming
    Replies: 1
    Last Post: 10-27-2008, 11:04 AM
  2. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 10:17 AM
  3. Load Bitmap as Window Background
    By Epo in forum Windows Programming
    Replies: 6
    Last Post: 07-19-2005, 09:37 AM
  4. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  5. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 10:14 PM