Is there a way to set an OpenGL Backround to an Image?

This is a discussion on Is there a way to set an OpenGL Backround to an Image? within the Game Programming forums, part of the General Programming Boards category; instead of having glClearColor (which you can only set colors with) is there something that you can set an image ...

  1. #1
    Registered User jimboob's Avatar
    Join Date
    Jun 2004
    Posts
    40

    Question Is there a way to set an OpenGL Backround to an Image?

    instead of having glClearColor (which you can only set colors with)
    is there something that you can set an image with?
    TIA.

  2. #2
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    kind of....
    assuming your image is stored in "display" as unsigned bytes (or whatever you want to specify) and the screen res/image res are given by "width" and "height"....

    Code:
            glClear(GL_COLOR_BUFFER_BIT);
    	glRasterPos2d(-1, -1);
    	glDrawPixels(width, height, GL_RGB, GL_UNSIGNED_BYTE, (unsigned char*)display);
    	glFlush();

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 05-27-2009, 01:46 PM
  2. image analysis theory: mapping a network
    By elninio in forum C++ Programming
    Replies: 5
    Last Post: 10-30-2008, 02:23 PM
  3. Just starting Windows Programming, School me!
    By Shamino in forum Windows Programming
    Replies: 17
    Last Post: 02-22-2008, 08:14 AM
  4. Loading an image into memory using OpenGL
    By Kaelin in forum C++ Programming
    Replies: 3
    Last Post: 02-08-2005, 12:03 PM
  5. OpenGL .dll vs video card dll
    By Silvercord in forum Game Programming
    Replies: 14
    Last Post: 02-12-2003, 07:57 PM

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