diff options
author | alokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-03 17:02:27 +0000 |
---|---|---|
committer | alokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-03 17:02:27 +0000 |
commit | 84352455e708fc771809f34476d4db9ca79e4bc9 (patch) | |
tree | b47b875ea7ade05db1d924ddc48f1c8f3c6f97ea /third_party | |
parent | 882f0ccbf250af3ff242da94706f26bb2f09c5b0 (diff) | |
download | chromium_src-84352455e708fc771809f34476d4db9ca79e4bc9.zip chromium_src-84352455e708fc771809f34476d4db9ca79e4bc9.tar.gz chromium_src-84352455e708fc771809f34476d4db9ca79e4bc9.tar.bz2 |
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: svn://svn.chromium.org/chrome/trunk/src@37977 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/gles2_book/Common/Include/esUtil.h | 10 | ||||
-rw-r--r-- | third_party/gles2_book/Common/Include/esUtil_win.h | 33 | ||||
-rw-r--r-- | third_party/gles2_book/Common/Source/Win32/esUtil_TGA.c | 126 | ||||
-rw-r--r-- | third_party/gles2_book/Common/Source/esUtil.c | 19 | ||||
-rw-r--r-- | third_party/gles2_book/README.chromium | 7 | ||||
-rw-r--r-- | third_party/gles2_book/gles2_book.gyp | 1 |
6 files changed, 8 insertions, 188 deletions
diff --git a/third_party/gles2_book/Common/Include/esUtil.h b/third_party/gles2_book/Common/Include/esUtil.h index 9897e1b..d00ac8f 100644 --- a/third_party/gles2_book/Common/Include/esUtil.h +++ b/third_party/gles2_book/Common/Include/esUtil.h @@ -112,16 +112,6 @@ extern int esGenCube ( float scale, GLfloat **vertices, GLfloat **normals, 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/third_party/gles2_book/Common/Include/esUtil_win.h b/third_party/gles2_book/Common/Include/esUtil_win.h deleted file mode 100644 index d7e4104..0000000 --- a/third_party/gles2_book/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/third_party/gles2_book/Common/Source/Win32/esUtil_TGA.c b/third_party/gles2_book/Common/Source/Win32/esUtil_TGA.c deleted file mode 100644 index 86a1f320..0000000 --- a/third_party/gles2_book/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/third_party/gles2_book/Common/Source/esUtil.c b/third_party/gles2_book/Common/Source/esUtil.c index 7a9c9c5..cb64a29 100644 --- a/third_party/gles2_book/Common/Source/esUtil.c +++ b/third_party/gles2_book/Common/Source/esUtil.c @@ -26,7 +26,6 @@ #include <GLES2/gl2.h> #include "esUtil.h" -#include "esUtil_win.h" /// // esInitContext() @@ -53,26 +52,10 @@ void esLogMessage ( const char *formatStr, ... ) 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/third_party/gles2_book/README.chromium b/third_party/gles2_book/README.chromium index 38aaad8..6f7858aa 100644 --- a/third_party/gles2_book/README.chromium +++ b/third_party/gles2_book/README.chromium @@ -18,6 +18,7 @@ Local Modifications: - Common/Include/KD/* - Common/Lib/* - Common/Source/esUtil_win32.c + - Common/Source/Win32/esUtil_TGA.c - Lib/* - *.vcproj, *.sln @@ -25,3 +26,9 @@ Local Modifications: 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/third_party/gles2_book/gles2_book.gyp b/third_party/gles2_book/gles2_book.gyp index 97b351f..6baff32 100644 --- a/third_party/gles2_book/gles2_book.gyp +++ b/third_party/gles2_book/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', ], }, { |