How to load background pic/texture in OpenGl?

This is a discussion on How to load background pic/texture in OpenGl? within the Windows Programming forums, part of the Platform Specific Boards category; Hey guys, Does anyone know how can i load a background picture for my OpenGL program or a texture? By ...

  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, 12:04 PM
  2. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 11:17 AM
  3. Load Bitmap as Window Background
    By Epo in forum Windows Programming
    Replies: 6
    Last Post: 07-19-2005, 10:37 AM
  4. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 01:34 PM
  5. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 11:14 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21