glLoadGen / docs / Style_No_Load_CPP.xml

Diff from to


         initializes the extension variables, so it cannot report on the number of functions that
         failed to load.</para>
+        <title>Example</title>
+        <para>This example is for loading the OpenGL functions; it expects the OpenGL header to be
+            included. For loading WGL/GLX functions, include their headers and change the
+                <quote>gl</quote> namespaces to <quote>wgl</quote> or <quote>glx</quote> as
+            appropriate.</para>
+        <programlisting>//Create OpenGL context and make it current.</programlisting>
+        <para>That was a trick question: there is no initialization required. That is the whole
+            point of this style, after all.</para>
+        <para>However, if you want to query which extensions are around, you
+                <emphasis>need</emphasis> to initialize that:</para>
+        <programlisting>//Create OpenGL context and make it current.
+        <para>The presence of extensions can be checked as follows:</para>
+        <programlisting>if(gl::exts::var_EXT_texture_compression_s3tc)
+  gl::CompressedTexSubImage2D(gl::TEXTURE_2D, 0, 0, 0, 256, 256,
+    gl::COMPRESSED_RGBA_S3TC_DXT5_EXT, compressedSize, compressedPixels);
+  void *decompressedPixels = DecompressPixels(256, 256,
+    compressedSize, compressedPixels);
+  gl::TexSubImage2D(gl::TEXTURE_2D, 0, 0, 0, 256, 256,
+    gl::RGBA, gl::UNSIGNED_BYTE, decompressedPixels);
+  free(decompressedPixels);
+    </section>
+    <section>
         <para>When you use this system and provide a version number of OpenGL,
                 <literal>noload_cpp</literal> will assume that you are <emphasis>serious</emphasis>