home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue4 / SDL / gcc346 / !SDL / man / SDL_GL_SetAttribute.3 < prev    next >
Encoding:
Text File  |  2006-09-20  |  2.2 KB  |  69 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_SetAttribute"("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_SetAttribute- Set a special SDL/OpenGL attribute 
  13. <h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
  14. <p>
  15. <b>#include
  16. "SDL.h" <p>
  17. </b><b>int <b>SDL_GL_SetAttribute</b></b>(<b>SDL_GLattr attr, int value</b>); 
  18. <h2><a name='sect2' href='#toc2'>Description</a></h2>
  19. <p>
  20. Sets
  21. the OpenGL <i>attribute</i> <b>attr</b> to <b>value</b>. The attributes you set don't take effect
  22. until after a call to <i><b>SDL_SetVideoMode</b></i>. You should use <i><b>SDL_GL_GetAttribute</b></i>
  23. to check the values after a <b>SDL_SetVideoMode</b> call. 
  24. <h2><a name='sect3' href='#toc3'>Return Value</a></h2>
  25. <p>
  26. Returns <b>0</b>
  27. on success, or <b>-1</b> on error. 
  28. <h2><a name='sect4' href='#toc4'>Example</a></h2>
  29. <p>
  30. <br>
  31. <pre>CWSDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
  32. SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
  33. SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
  34. SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
  35. SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
  36. if ( (screen=SDL_SetVideoMode( 640, 480, 16, SDL_OPENGL )) == NULL ) {
  37.   fprintf(stderr, "Couldn't set GL mode: %s
  38. ", SDL_GetError());
  39.   SDL_Quit();
  40.   return;
  41. }
  42. </pre><p>
  43. <p>
  44. <blockquote><b>Note:   <p>
  45. The <b>SDL_DOUBLEBUF</b></b> flag is not required to enable double buffering
  46. when setting an OpenGL video mode. Double buffering is enabled or disabled
  47. using the SDL_GL_DOUBLEBUFFER attribute. </blockquote>
  48.  
  49. <h2><a name='sect5' href='#toc5'>See Also</a></h2>
  50. <p>
  51. <i><b>SDL_GL_GetAttribute</b></i>, <i>GL
  52. Attributes</i> 
  53. <!--
  54.   
  55.  <p>
  56.  
  57. <hr><p>
  58. <a name='toc'><b>Table of Contents</b></a><p>
  59. <ul>
  60. <li><a name='toc0' href='#sect0'>Name</a></li>
  61. <li><a name='toc1' href='#sect1'>Synopsis</a></li>
  62. <li><a name='toc2' href='#sect2'>Description</a></li>
  63. <li><a name='toc3' href='#sect3'>Return Value</a></li>
  64. <li><a name='toc4' href='#sect4'>Example</a></li>
  65. <li><a name='toc5' href='#sect5'>See Also</a></li>
  66. </ul>
  67. </body>
  68. </html>
  69.