Results 1 to 5 of 5

Thread: how to view a background Image (.jpg or gif)

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2003
    Location
    Norfolk, VA, USA
    Posts
    2

    how to view a background Image (.jpg or gif)

    Hi...

    I am a new opengl user... I am tring to figure out how to view a background image such as .jpg or .gif into the main window that we are creating...

    Is there a uniqe command to do that ?
    or should we just use the old AUX library ??
    I found a DevIL package but it WAS too complicated.... is there a DIRECT command to load such thing ?

    Thank you in advance...

    (( I am a student at ODU, VA .. and this is NOT a homework question ))

  2. #2
    Member Contributor
    Join Date
    Sep 2002
    Location
    Edmonton Canada
    Posts
    76

    Re: how to view a background Image (.jpg or gif)

    There is no direct command to load a jpg or gif.

    You need a file loader. I have never used Devil, but I am sure it has loaders for these file types. It has some pretty good documentation and tutorials..so if you read those, it might not be as complicated as it seems.

    You could write your own file loader..you can get the file format specs from the net... www.wotsit.org ...look under the graphics files button.

    Once you have the image loaded, you can use the array of bytes (or whatever) as a texture, or write them directly to the buffer (using glDrawPixels). the texture way is faster.

    [This message has been edited by bumby (edited 10-08-2003).]

  3. #3
    Guest

    Re: how to view a background Image (.jpg or gif)

    I have written a function that can load a 24-bit BMP file and put it in a texture object. If you need the function then mail me.

    mehedi_b@yahoo.com

  4. #4
    Junior Member Newbie
    Join Date
    Oct 2003
    Location
    Norfolk, VA, USA
    Posts
    2

    Re: how to view a background Image (.jpg or gif)

    Well.. thanks to both of you...

    I tried to view ANY background (such as .ppm or .RGB ) instead of those jpeg or GIF.. but i am still confused.. !! (

    Is there a (small) code to view a .ppm or a .ras image ?

    ((( i used an opengl book to view the .ppm but every image is different to be viewed.. )))))

    thanks again...

  5. #5
    Senior Member Regular Contributor
    Join Date
    Jul 2000
    Location
    Arlon, Belgium
    Posts
    477

    Re: how to view a background Image (.jpg or gif)

    I've a simple demo who display a texture as splash screen.

    http://www.slug-production.be.tf/

Similar Threads

  1. Replies: 1
    Last Post: 07-09-2017, 07:07 AM
  2. Background image
    By aga2678 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-19-2005, 09:09 AM
  3. view desktop instead of a black background
    By Gevin in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 10-22-2002, 06:13 AM
  4. cut off background of image
    By dan-leech in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 03-07-2001, 01:29 AM
  5. an image as the background?
    By in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 12-29-2000, 10:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean