home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue4 / SDL / gcc346 / !SDL / man / SDL_GL_GetProcAddress.3 < prev    next >
Encoding:
Text File  |  2006-09-20  |  1.9 KB  |  75 lines

  1. <!-- manual page source format generated by PolyglotMan v3.0.8+X.Org, -->
  2. <!-- available at http://polyglotman.sourceforge.net/ -->
  3.  
  4. <html>
  5. <head>
  6. <title>"SDL_GL_GetProcAddress"("3") manual page</title>
  7. </head>
  8. <body bgcolor='#efefef' text='black' link='blue' vlink='#551A8B' alink='red'>
  9. <a href='#toc'>Table of Contents</a><p>
  10.  
  11. <h2><a name='sect0' href='#toc0'>Name</a></h2>
  12. SDL_GL_GetProcAddress- Get the address of a GL function 
  13. <h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
  14. <p>
  15. <b>#include
  16. "SDL.h" <p>
  17. </b><b>void *<b>SDL_GL_GetProcAddress</b></b>(<b>const char* proc</b>); 
  18. <h2><a name='sect2' href='#toc2'>Description</a></h2>
  19. <p>
  20. Returns
  21. the address of the GL function <b>proc</b>, or <b>NULL</b> if the function is not found.
  22. If the GL library is loaded at runtime, with <i><b>SDL_GL_LoadLibrary</b></i>, then <i>all</i>
  23. GL functions must be retrieved this way. Usually this is used to retrieve
  24. function pointers to OpenGL extensions. 
  25. <h2><a name='sect3' href='#toc3'>Example</a></h2>
  26. <p>
  27. <br>
  28. <pre>CWtypedef void (*GL_ActiveTextureARB_Func)(unsigned int);
  29. GL_ActiveTextureARB_Func glActiveTextureARB_ptr = 0;
  30. int has_multitexture=1;
  31. .
  32. .
  33. .
  34. /* Get function pointer */
  35. glActiveTextureARB_ptr=(GL_ActiveTextureARB_Func) SDL_GL_GetProcAddress("glActiveTextureARB");
  36. /* Check for a valid function ptr */
  37. if(!glActiveTextureARB_ptr){
  38.   fprintf(stderr, "Multitexture Extensions not present.
  39. ");
  40.   has_multitexture=0;
  41. }
  42. .
  43. .
  44. .
  45. .
  46. if(has_multitexture){
  47.   glActiveTextureARB_ptr(GL_TEXTURE0_ARB);
  48.   .
  49.   .
  50. }
  51. else{
  52.   .
  53.   .
  54. }
  55. </pre><p>
  56.  
  57. <h2><a name='sect4' href='#toc4'>See Also</a></h2>
  58. <p>
  59. <i><b>SDL_GL_LoadLibrary</b></i> 
  60. <!--
  61.   
  62.  <p>
  63.  
  64. <hr><p>
  65. <a name='toc'><b>Table of Contents</b></a><p>
  66. <ul>
  67. <li><a name='toc0' href='#sect0'>Name</a></li>
  68. <li><a name='toc1' href='#sect1'>Synopsis</a></li>
  69. <li><a name='toc2' href='#sect2'>Description</a></li>
  70. <li><a name='toc3' href='#sect3'>Example</a></li>
  71. <li><a name='toc4' href='#sect4'>See Also</a></li>
  72. </ul>
  73. </body>
  74. </html>
  75.