Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: extension loading over multiple classes

  1. #1
    Guest

    extension loading over multiple classes

    Can sombody tell me what i have to do to load an extension in a global header file and not having to redefine the function pointers over and over again for every unit that needs to use this the ARB-extension

    so for example I define in that headerfile:
    PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB = NULL;

    and use an init funtion to load the wglGetProcAddress

    thx in advance Makkero

  2. #2
    Super Moderator OpenGL Guru dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    4,388

    Re: extension loading over multiple classes

    Write an initialization function that is called once at startup once that assigns this function pointer. You do not need to call getprocaddress more than once because the pointer should be global in scope if you have declared it correctly in the header.

  3. #3
    Guest

    Re: extension loading over multiple classes

    I have defined the variable functions global in my header file (hope this is global enough). And I wrote an init function. In the initfunction he was able executen the assigned funtions but when i tried it outside in an other source file he gave me nullpointer exceptions while I have included the header file in that source file.

    So i wrote the **** global like the standart way you write things global in the header file. But i think i need to do something extra. I tried to use 'extern' but it didn't resolve the problem

    Can someone tell me what i need to do to get this to work.

    thx in advance

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •