Results 1 to 2 of 2

Thread: problem with glGetFloatv

  1. #1
    Senior Member Regular Contributor
    Join Date
    Aug 2003

    problem with glGetFloatv

    Hi, I'm having a problem when calling glGetFloatv in the following code:

    GLfloat smoothLineWidth, smoothLineGran;

    glGetFloatv(GL_LINE_WIDTH_RANGE, &smoothLineWidth);
    glGetFloatv(GL_LINE_WIDTH_GRANULARITY, &smoothLineGran);

    cout << "Smooth Line: " << smoothLineWidth
    << ", Smooth Gran: " << smoothLineGran << endl;

    The program compiles fine, but when I try to run it I get the following error:

    Debug Error!

    Program: C:\Basic\Debug\Basic.exe
    File: i386\chkesp.c
    Line: 42

    The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.

    What could I do? I'm not creating a function pointer, I'm just using a standard OpenGL function. When I found it in the header gl.h the prototype is WINGDIAPI void APIENTRY glGetFloatv (GLenum pname, GLfloat *params);
    Thanks in advance.

  2. #2
    Senior Member Regular Contributor
    Join Date
    Aug 2003

    Re: problem with glGetFloatv

    I finally found the answer. The problem is that I called glGetFloatv with the wrong arguments. But probably because of all the dll and calling conventions I got the aforementioned error instead of one about wrong arguments. Anyway here is the corrected code:

    GLfloat smoothLineWidth[2], smoothLineGran[1];

    glGetFloatv(GL_LINE_WIDTH_RANGE, smoothLineWidth);
    glGetFloatv(GL_LINE_WIDTH_GRANULARITY, smoothLineGran);

    cout << "Smooth Line: " << smoothLineWidth[0] << ", " << smoothLineWidth[1]
    << ", Smooth Gran: " << smoothLineGran[0] << endl;

Similar Threads

  1. Problem with glGetFloatv
    By swethasharma in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-31-2012, 02:45 AM
  2. glGetFloatv(GL_MODELVIEW_MATRIX, mat)?
    By tgtt in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 02-22-2004, 11:34 PM
  3. problems with glGetFloatv(...)
    By helda in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-28-2003, 04:07 AM
  4. glGetFloatv??
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 05-30-2001, 12:46 AM
  5. glGetFloatv??
    By in forum OpenGL: macOS
    Replies: 1
    Last Post: 05-28-2001, 01:10 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