Results 1 to 6 of 6

Thread: glGetFloatv dont work

  1. #1
    Guest

    glGetFloatv dont work

    Why this is'nt working?

    I want to store the current Color for later restoring:

    //save the color
    GLfloat oldcolors[4];
    glGetFloatv( GL_CURRENT_COLOR, oldcolors );

    //some something
    glColor3f( some_other_color, ... );
    ...

    //restore the old color
    glColor3f( oldcolors[0], oldcolors[1], oldcolors[2] );


    ...but something seems to be wrong with it, the getfloatv dont fill the "oldcolors" with the actuall color.

    thanx
    Phox

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jun 2000
    Location
    B.C., Canada
    Posts
    367

    Re: glGetFloatv dont work

    You need to do:

    Code :
    glGetFloatv(GL_CURRENT_COLOR, &oldcolors);
    It requires a pointer.

    j

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Jun 2000
    Location
    Shreveport, LA, USA
    Posts
    1,502

    Re: glGetFloatv dont work

    j, oldcolors is a pointer. So &oldcolors is a pointer to a pointer. Instead I think the error may be that the glGetFloatv call is being made inbetween glBegin and glEnd.

  4. #4
    Guest

    Re: glGetFloatv dont work

    Originally posted by DFrey:
    j, oldcolors is a pointer. So &oldcolors is a pointer to a pointer. Instead I think the error may be that the glGetFloatv call is being made inbetween glBegin and glEnd.
    the glGetFloatv call is not between glBegin and glEnd.

    even when I do:

    Code :
    glColor3f(1.0f,1.0f,1.0f);
    glGetFloatv( GL_CURRENT_COLOR, oldcolors );
    the oldcolor-array not contains the WHILE-color.

    Phox

  5. #5
    Guest

    Re: glGetFloatv dont work

    problem solved!

    the glGetFloatv works fine with the opengl-softwarerender. My OpenGl-Hardware-Driver seems not to support that feature (its an old alpha-driver only)

    cu
    Phox

  6. #6
    Senior Member Regular Contributor
    Join Date
    Jun 2000
    Location
    B.C., Canada
    Posts
    367

    Re: glGetFloatv dont work

    j, oldcolors is a pointer
    Sorry, missed that.

    j

Similar Threads

  1. i really dont know why the glutTimerFunc doesn't work
    By rangora in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-30-2017, 03:56 PM
  2. glGetFloatv(GL_CURRENT_COLOR, color) doesn't work
    By wwuster in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 12-31-2009, 09:13 AM
  3. About glGetFloatv(). Why it doesn't work?
    By Ilya in forum OpenGL ES
    Replies: 1
    Last Post: 07-04-2008, 04:15 AM
  4. Extensions dont work under linux!
    By in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 04-09-2003, 08:39 AM
  5. glsetup.com dont work!!!!
    By in forum OpenGL: User Software
    Replies: 1
    Last Post: 07-22-2001, 01:05 PM

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