Can not wglGetProcAddress() -- what is wrong with my code?

Hi there!

I am just trying to migrate a small OpenGL application from Unix to Windows using the Cygwin environment for development. I was able to get my code running without any significant changes.

Now I wish to apply convolution which is OpenGL 1.2 functionality. It took some time to realize that anything above version 1.1 is not directly supported by Windows but that one must obtain function pointers via wglGetProcAddress(). Unfortunately, it only returns a null pointer – why?

Here’s a minimal example to produce that behavior:

#include <stdio.h>

#include <windows.h>

#include <GL/glut.h>
#include <GL/glext.h>

void display(void)
{
PFNGLGETCONVOLUTIONPARAMETERIVPROC glGetConvolutionParameteriv;

    printf("VENDOR    : %s

", glGetString(GL_VENDOR));
printf("RENDERER : %s
", glGetString(GL_RENDERER));
printf("VERSION : %s
", glGetString(GL_VERSION));

    glGetConvolutionParameteriv = (PFNGLGETCONVOLUTIONPARAMETERIVPROC)
            wglGetProcAddress("glGetConvolutionParameteriv");

    printf("address = %p

", glGetConvolutionParameteriv);
printf("error = %d
", GetLastError());

    exit(0);

}

int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutCreateWindow(“Testwindow”);
glutDisplayFunc(display);
glutMainLoop();

    return 0;

}

The compiler is run like this:

$ gcc example.c -o example -lglut32 -lopengl32

And the output is like this:

VENDOR : ATI Technologies Inc.
RENDERER : Radeon 7500 DDR x86/SSE2
VERSION : 1.3.3038 Win2000 Release
address = 0x0
error = 127

The error code is
127 The specified procedure could not be found. ERROR_PROC_NOT_FOUND

So why doesn’t this work? The OpenGL version available is 1.3 so glGetConvolutionParameteriv() should be available!?

Bye,

Wolfgang

Convolution is part of the imaging subset which is optional, not core functionality. The Radeon doesn’t support it.

I see. I just tried a different function that definitely is supported (because it’s in GL_EXTENSIONS) and that worked.

Is there a document on the net that lists all extensions that a particular chip implements? I am very interested to have convolution supported by hardware and now would like to find out which graphic boards can do that.

Thank you for the very quick answer,

Wolfgang

Delphi 3D's hardware info database is what you’re looking for :slight_smile:
Here 's the entry for ARB_imaging btw.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.