Results 1 to 3 of 3

Thread: wglGetProcAddress & Extentions

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2001
    Location
    Bristol, Englend
    Posts
    19

    wglGetProcAddress & Extentions

    I am trying to use the GL_KTX_buffer_region extention but I'm having trouble defining the functions, below are a few examples of how I have tried to define them and the error messages I have received. This is for Win98 and I have a Geforce 2 MX so it should support it.

    extern GLuint APIENTRY glNewBufferRegion (GLenum);
    typedef GLuint (APIENTRY * PFNGLNEWBUFFERREGIONPROC) (GLenum type);


    if (strstr((const char*)glGetString(GL_EXTENSIONS), "GL_KTX_buffer_region") != NULL)
    {
    glNewBufferRegion = (GLuint(*)(GLenum))wglGetProcAddress ("glNewBufferRegion");
    }

    error C2659: '=' : overloaded function as left operand

    OR

    PROC glNewBufferRegion;


    if (strstr((const char*)glGetString(GL_EXTENSIONS), "GL_KTX_buffer_region") != NULL)
    {
    glNewBufferRegion = wglGetProcAddress("glNewBufferRegion");
    }

    (*glNewBufferRegion)(GL_KTX_Z_REGION);

    error C2197: 'int (__stdcall *)(void)' : too many actual parameters

    Any help would be greatly appreciated!!!

    Also the gfx.h header that comes with the 3D Studio Max 3.1 SDK is meant to define the constants but doesn't, anyone know why.

  2. #2
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,450

    Re: wglGetProcAddress & Extentions

    What about
    typedef GLuint (APIENTRY * PFNGLNEWBUFFERREGIONPROC) (GLenum type);
    PFNGLNEWBUFFERREGIONPROC glNewBufferRegion = NULL;
    ...
    glNewBufferRegion = (PFNGLNEWBUFFERREGIONPROC) wglGetProcAddress("glNewBufferRegion");

    PS: Forgot the brackets in the cast.

    [This message has been edited by Relic (edited 03-20-2001).]

  3. #3
    Junior Member Newbie
    Join Date
    Mar 2001
    Location
    Bristol, Englend
    Posts
    19

    Re: wglGetProcAddress & Extentions

    Cheers, worked a treat!!!

Similar Threads

  1. ATI extentions
    By zhelyo in forum OpenGL ES
    Replies: 0
    Last Post: 11-12-2010, 10:07 AM
  2. crossplatform & extentions
    By azertykk in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 04-09-2010, 08:53 AM
  3. OpenGL 1.5+ & ARB extentions
    By Maverick_75 in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 12-16-2004, 03:47 AM
  4. GL2 Generic Extentions
    By zom in forum OpenGL: General
    Replies: 0
    Last Post: 02-26-2002, 03:51 AM
  5. Extentions?
    By TB-Rex in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 11-03-2000, 02: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