Changes necessary to compile gpu demos on linux. It is not functional yet just compiling. 
BUG=26099
Review URL: http://codereview.chromium.org/552240

git-svn-id: http://src.chromium.org/svn/trunk/src/third_party/gles2_book@37977 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
diff --git a/Common/Include/esUtil.h b/Common/Include/esUtil.h
index 9897e1b..d00ac8f 100644
--- a/Common/Include/esUtil.h
+++ b/Common/Include/esUtil.h
@@ -112,16 +112,6 @@
                        GLfloat **texCoords, GLushort **indices );
 
 //
-/// \brief Loads a 24-bit TGA image from a file
-/// \param fileName Name of the file on disk
-/// \param width Width of loaded image in pixels
-/// \param height Height of loaded image in pixels
-///  \return Pointer to loaded image.  NULL on failure. 
-//
-extern char* esLoadTGA ( char *fileName, int *width, int *height );
-
-
-//
 /// \brief multiply matrix specified by result with a scaling matrix and return new matrix in result
 /// \param result Specifies the input matrix.  Scaled matrix is returned in result.
 /// \param sx, sy, sz Scale factors along the x, y and z axes respectively
diff --git a/Common/Include/esUtil_win.h b/Common/Include/esUtil_win.h
deleted file mode 100644
index d7e4104..0000000
--- a/Common/Include/esUtil_win.h
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// Book:      OpenGL(R) ES 2.0 Programming Guide
-// Authors:   Aaftab Munshi, Dan Ginsburg, Dave Shreiner
-// ISBN-10:   0321502795
-// ISBN-13:   9780321502797
-// Publisher: Addison-Wesley Professional
-// URLs:      http://safari.informit.com/9780321563835
-//            http://www.opengles-book.com
-//
-
-// esUtil_win.h
-//
-//   API-neutral interface for creating windows.  Implementation needs to be provided per-platform.
-
-#ifndef ESUTIL_WIN_H
-#define ESUTIL_WIN_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif  // __cplusplus
-
-///
-//  WinTGALoad()
-//    
-//      TGA loader win32 implementation
-//
-int WinTGALoad ( const char *fileName, char **buffer, int *width, int *height );
-
-#ifdef __cplusplus
-}
-#endif  // __cplusplus
-
-#endif // ESUTIL_WIN_H
diff --git a/Common/Source/Win32/esUtil_TGA.c b/Common/Source/Win32/esUtil_TGA.c
deleted file mode 100644
index 86a1f32..0000000
--- a/Common/Source/Win32/esUtil_TGA.c
+++ /dev/null
@@ -1,126 +0,0 @@
-//
-// Book:      OpenGL(R) ES 2.0 Programming Guide
-// Authors:   Aaftab Munshi, Dan Ginsburg, Dave Shreiner
-// ISBN-10:   0321502795
-// ISBN-13:   9780321502797
-// Publisher: Addison-Wesley Professional
-// URLs:      http://safari.informit.com/9780321563835
-//            http://www.opengles-book.com
-//
-
-// esUtil_TGA.c
-//
-//    This file contains the Win32 implementation of a TGA image loader
-
-#ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN
-#endif  // WIN32_LEAN_AND_MEAN
-
-#include <windows.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-///
-//  Macros
-//
-#define INVERTED_BIT            (1 << 5)
-
-///
-//  Types
-//
-#pragma pack(push,x1)                            // Byte alignment (8-bit)
-#pragma pack(1)
-
-typedef struct
-{
-   unsigned char  IdSize,
-                  MapType,
-                  ImageType;
-   unsigned short PaletteStart,
-                  PaletteSize;
-   unsigned char  PaletteEntryDepth;
-   unsigned short X,
-                  Y,
-                  Width,
-                  Height;
-   unsigned char  ColorDepth,
-                  Descriptor;
-         
-} TGA_HEADER;
-
-#pragma pack(pop,x1)
-
-////////////////////////////////////////////////////////////////////////////////////
-//
-//  Private Functions
-//
-
-////////////////////////////////////////////////////////////////////////////////////
-//
-//  Public Functions
-//
-//
-
-
-///
-//  WinTGALoad()
-//
-int WinTGALoad( const char *fileName, char **buffer, int *width, int *height )
-{
-   FILE        *fp;
-   TGA_HEADER   Header;
-
-   if ( fopen_s ( &fp, fileName, "rb" ) != 0 )
-   {
-      return FALSE;
-   }
-
-   if ( fp == NULL )
-   {
-      return FALSE;
-   }
-
-   fread ( &Header, sizeof(TGA_HEADER), 1, fp );
-
-   *width = Header.Width;
-   *height = Header.Height;
-   
-   if ( Header.ColorDepth == 24 )
-   {
-      RGBTRIPLE *Buffer24;
-
-      Buffer24= (RGBTRIPLE*)malloc(sizeof(RGBTRIPLE) * (*width) * (*height));
-
-      if(Buffer24)
-      {
-         int i=0;
-         int x,
-             y;
-
-         fread(Buffer24, sizeof(RGBTRIPLE), (*width) * (*height), fp);
-
-         *buffer= (LPSTR) malloc(3 * (*width) * (*height));
-
-         for ( y = 0; y < *height; y++ )
-            for( x = 0; x < *width; x++ )
-            {
-               int Index= y * (*width) + x;
-
-               if(!(Header.Descriptor & INVERTED_BIT))
-                  Index= ((*height) - 1 - y) * (*width) + x;
-
-               (*buffer)[(i * 3)]=      Buffer24[Index].rgbtRed;
-               (*buffer)[(i * 3) + 1]=  Buffer24[Index].rgbtGreen;
-               (*buffer)[(i * 3) + 2]=  Buffer24[Index].rgbtBlue;
-        
-               i++;
-            }
-         
-         fclose(fp);
-         free(Buffer24);
-         return(TRUE);
-      }		
-   }
-
-   return(FALSE);
-}
diff --git a/Common/Source/esUtil.c b/Common/Source/esUtil.c
index 7a9c9c5..cb64a29 100644
--- a/Common/Source/esUtil.c
+++ b/Common/Source/esUtil.c
@@ -26,7 +26,6 @@
 #include <GLES2/gl2.h>
 
 #include "esUtil.h"
-#include "esUtil_win.h"
 
 ///
 //  esInitContext()
@@ -53,26 +52,10 @@
     char buf[BUFSIZ];
 
     va_start ( params, formatStr );
-    vsprintf_s ( buf, sizeof(buf),  formatStr, params );
+    vsprintf ( buf, formatStr, params );
     
     printf ( "%s", buf );
     
     va_end ( params );
 }
 
-///
-// esLoadTGA()
-//
-//    Loads a 24-bit TGA image from a file
-//
-char* esLoadTGA ( char *fileName, int *width, int *height )
-{
-   char *buffer;
-
-   if ( WinTGALoad ( fileName, &buffer, width, height ) )
-   {
-      return buffer;
-   }
-
-   return NULL;
-}
diff --git a/README.chromium b/README.chromium
index 38aaad8..6f7858a 100644
--- a/README.chromium
+++ b/README.chromium
@@ -18,6 +18,7 @@
     - Common/Include/KD/*
     - Common/Lib/*
     - Common/Source/esUtil_win32.c
+    - Common/Source/Win32/esUtil_TGA.c
     - Lib/*
     - *.vcproj, *.sln
 
@@ -25,3 +26,9 @@
   static libraries:
     - Chapter_2/Hello_Triangle/Hello_Triangle.h
     - Chapter_8/Simple_VertexShader/Simple_VertexShader.h
+    - Chapter_9/MipMap2D/MipMap2D.h
+    - Chapter_9/Simple_Texture2D/Simple_Texture2D.h
+    - Chapter_9/Simple_TextureCubemap/Simple_TextureCubemap.h
+    - Chapter_9/TextureWrap/TextureWrap.h
+    - Chapter_11/Stencil_Test/Stencil_Test.h
+
diff --git a/gles2_book.gyp b/gles2_book.gyp
index 97b351f..6baff32 100644
--- a/gles2_book.gyp
+++ b/gles2_book.gyp
@@ -25,7 +25,6 @@
         'Common/Source/esShapes.c',
         'Common/Source/esTransform.c',
         'Common/Source/esUtil.c',
-        'Common/Source/Win32/esUtil_TGA.c',
       ],
     },
     {