Commit 0270ef14 by alokp@chromium.org

Changed the default character set to be UNICODE, the same as chromium. Changes…

Changed the default character set to be UNICODE, the same as chromium. Changes to fix compile errors and warnings. Review URL: http://codereview.appspot.com/816046 git-svn-id: https://angleproject.googlecode.com/svn/trunk@103 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 777f2672
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
'msvs_configuration_attributes': { 'msvs_configuration_attributes': {
'OutputDirectory': '$(SolutionDir)$(ConfigurationName)', 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)', 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
'CharacterSet': '1', # UNICODE
}, },
'msvs_configuration_platform': 'Win32', 'msvs_configuration_platform': 'Win32',
'msvs_settings': { 'msvs_settings': {
...@@ -43,13 +44,12 @@ ...@@ -43,13 +44,12 @@
'GenerateDebugInformation': 'true', 'GenerateDebugInformation': 'true',
'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib', 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
'MapFileName': '$(OutDir)\\$(TargetName).map', 'MapFileName': '$(OutDir)\\$(TargetName).map',
# SubSystem values:
# 0 == not set
# 1 == /SUBSYSTEM:CONSOLE
# 2 == /SUBSYSTEM:WINDOWS
# Most of the executables we'll ever create are tests # Most of the executables we'll ever create are tests
# and utilities with console output. # and utilities with console output.
'SubSystem': '1', 'SubSystem': '1', # /SUBSYSTEM:CONSOLE
},
'VCResourceCompilerTool': {
'Culture': '1033',
}, },
}, },
}, # Common }, # Common
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
// //
// This file contains the Win32 implementation of a TGA image loader // This file contains the Win32 implementation of a TGA image loader
#define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -87,19 +87,18 @@ LRESULT WINAPI ESWindowProc ( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ...@@ -87,19 +87,18 @@ LRESULT WINAPI ESWindowProc ( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
// //
// Create Win32 instance and window // Create Win32 instance and window
// //
GLboolean WinCreate ( ESContext *esContext, const char *title ) GLboolean WinCreate ( ESContext *esContext, LPCTSTR title )
{ {
WNDCLASS wndclass = {0}; WNDCLASS wndclass = {0};
DWORD wStyle = 0; DWORD wStyle = 0;
RECT windowRect; RECT windowRect;
HINSTANCE hInstance = GetModuleHandle(NULL); HINSTANCE hInstance = GetModuleHandle(NULL);
wndclass.style = CS_OWNDC; wndclass.style = CS_OWNDC;
wndclass.lpfnWndProc = (WNDPROC)ESWindowProc; wndclass.lpfnWndProc = (WNDPROC)ESWindowProc;
wndclass.hInstance = hInstance; wndclass.hInstance = hInstance;
wndclass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); wndclass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
wndclass.lpszClassName = "opengles2.0"; wndclass.lpszClassName = TEXT("opengles2.0");
if (!RegisterClass (&wndclass) ) if (!RegisterClass (&wndclass) )
return FALSE; return FALSE;
...@@ -115,10 +114,8 @@ GLboolean WinCreate ( ESContext *esContext, const char *title ) ...@@ -115,10 +114,8 @@ GLboolean WinCreate ( ESContext *esContext, const char *title )
AdjustWindowRect ( &windowRect, wStyle, FALSE ); AdjustWindowRect ( &windowRect, wStyle, FALSE );
esContext->hWnd = CreateWindow( esContext->hWnd = CreateWindow(
"opengles2.0", TEXT("opengles2.0"),
title, title,
wStyle, wStyle,
0, 0,
...@@ -134,7 +131,6 @@ GLboolean WinCreate ( ESContext *esContext, const char *title ) ...@@ -134,7 +131,6 @@ GLboolean WinCreate ( ESContext *esContext, const char *title )
// ESWindowProc // ESWindowProc
SetWindowLongPtr ( esContext->hWnd, GWL_USERDATA, (LONG) (LONG_PTR) esContext ); SetWindowLongPtr ( esContext->hWnd, GWL_USERDATA, (LONG) (LONG_PTR) esContext );
if ( esContext->hWnd == NULL ) if ( esContext->hWnd == NULL )
return GL_FALSE; return GL_FALSE;
......
...@@ -129,7 +129,7 @@ void ESUTIL_API esInitContext ( ESContext *esContext ) ...@@ -129,7 +129,7 @@ void ESUTIL_API esInitContext ( ESContext *esContext )
// ES_WINDOW_STENCIL - specifies that a stencil buffer should be created // ES_WINDOW_STENCIL - specifies that a stencil buffer should be created
// ES_WINDOW_MULTISAMPLE - specifies that a multi-sample buffer should be created // ES_WINDOW_MULTISAMPLE - specifies that a multi-sample buffer should be created
// //
GLboolean ESUTIL_API esCreateWindow ( ESContext *esContext, const char* title, GLint width, GLint height, GLuint flags ) GLboolean ESUTIL_API esCreateWindow ( ESContext *esContext, LPCTSTR title, GLint width, GLint height, GLuint flags )
{ {
EGLint attribList[] = EGLint attribList[] =
{ {
......
...@@ -111,7 +111,7 @@ void ESUTIL_API esInitContext ( ESContext *esContext ); ...@@ -111,7 +111,7 @@ void ESUTIL_API esInitContext ( ESContext *esContext );
/// ES_WINDOW_STENCIL - specifies that a stencil buffer should be created /// ES_WINDOW_STENCIL - specifies that a stencil buffer should be created
/// ES_WINDOW_MULTISAMPLE - specifies that a multi-sample buffer should be created /// ES_WINDOW_MULTISAMPLE - specifies that a multi-sample buffer should be created
/// \return GL_TRUE if window creation is succesful, GL_FALSE otherwise /// \return GL_TRUE if window creation is succesful, GL_FALSE otherwise
GLboolean ESUTIL_API esCreateWindow ( ESContext *esContext, const char *title, GLint width, GLint height, GLuint flags ); GLboolean ESUTIL_API esCreateWindow ( ESContext *esContext, LPCTSTR title, GLint width, GLint height, GLuint flags );
// //
/// \brief Start the main loop for the OpenGL ES application /// \brief Start the main loop for the OpenGL ES application
......
...@@ -42,7 +42,7 @@ extern "C" { ...@@ -42,7 +42,7 @@ extern "C" {
// //
// Create Win32 instance and window // Create Win32 instance and window
// //
GLboolean WinCreate ( ESContext *esContext, const char *title ); GLboolean WinCreate ( ESContext *esContext, LPCTSTR title );
/// ///
// WinLoop() // WinLoop()
......
...@@ -183,7 +183,7 @@ int main ( int argc, char *argv[] ) ...@@ -183,7 +183,7 @@ int main ( int argc, char *argv[] )
esInitContext ( &esContext ); esInitContext ( &esContext );
esContext.userData = &userData; esContext.userData = &userData;
esCreateWindow ( &esContext, "Hello Triangle", 320, 240, ES_WINDOW_RGB ); esCreateWindow ( &esContext, TEXT("Hello Triangle"), 320, 240, ES_WINDOW_RGB );
if ( !Init ( &esContext ) ) if ( !Init ( &esContext ) )
return 0; return 0;
......
...@@ -333,7 +333,7 @@ int main ( int argc, char *argv[] ) ...@@ -333,7 +333,7 @@ int main ( int argc, char *argv[] )
esInitContext ( &esContext ); esInitContext ( &esContext );
esContext.userData = &userData; esContext.userData = &userData;
esCreateWindow ( &esContext, "MipMap 2D", 320, 240, ES_WINDOW_RGB ); esCreateWindow ( &esContext, TEXT("MipMap 2D"), 320, 240, ES_WINDOW_RGB );
if ( !Init ( &esContext ) ) if ( !Init ( &esContext ) )
return 0; return 0;
......
...@@ -200,7 +200,7 @@ int main ( int argc, char *argv[] ) ...@@ -200,7 +200,7 @@ int main ( int argc, char *argv[] )
esInitContext ( &esContext ); esInitContext ( &esContext );
esContext.userData = &userData; esContext.userData = &userData;
esCreateWindow ( &esContext, "MultiTexture", 320, 240, ES_WINDOW_RGB ); esCreateWindow ( &esContext, TEXT("MultiTexture"), 320, 240, ES_WINDOW_RGB );
if ( !Init ( &esContext ) ) if ( !Init ( &esContext ) )
return 0; return 0;
......
...@@ -280,7 +280,7 @@ int main ( int argc, char *argv[] ) ...@@ -280,7 +280,7 @@ int main ( int argc, char *argv[] )
esInitContext ( &esContext ); esInitContext ( &esContext );
esContext.userData = &userData; esContext.userData = &userData;
esCreateWindow ( &esContext, "ParticleSystem", 640, 480, ES_WINDOW_RGB ); esCreateWindow ( &esContext, TEXT("ParticleSystem"), 640, 480, ES_WINDOW_RGB );
if ( !Init ( &esContext ) ) if ( !Init ( &esContext ) )
return 0; return 0;
......
...@@ -185,7 +185,7 @@ int main ( int argc, char *argv[] ) ...@@ -185,7 +185,7 @@ int main ( int argc, char *argv[] )
esInitContext ( &esContext ); esInitContext ( &esContext );
esContext.userData = &userData; esContext.userData = &userData;
esCreateWindow ( &esContext, "Simple Texture 2D", 320, 240, ES_WINDOW_RGB ); esCreateWindow ( &esContext, TEXT("Simple Texture 2D"), 320, 240, ES_WINDOW_RGB );
if ( !Init ( &esContext ) ) if ( !Init ( &esContext ) )
return 0; return 0;
......
...@@ -216,7 +216,7 @@ int main ( int argc, char *argv[] ) ...@@ -216,7 +216,7 @@ int main ( int argc, char *argv[] )
esInitContext ( &esContext ); esInitContext ( &esContext );
esContext.userData = &userData; esContext.userData = &userData;
esCreateWindow ( &esContext, "Simple Texture Cubemap", 320, 240, ES_WINDOW_RGB ); esCreateWindow ( &esContext, TEXT("Simple Texture Cubemap"), 320, 240, ES_WINDOW_RGB );
if ( !Init ( &esContext ) ) if ( !Init ( &esContext ) )
return 0; return 0;
......
...@@ -180,7 +180,7 @@ int main ( int argc, char *argv[] ) ...@@ -180,7 +180,7 @@ int main ( int argc, char *argv[] )
esInitContext ( &esContext ); esInitContext ( &esContext );
esContext.userData = &userData; esContext.userData = &userData;
esCreateWindow ( &esContext, "Simple Vertex Shader", 320, 240, ES_WINDOW_RGB ); esCreateWindow ( &esContext, TEXT("Simple Vertex Shader"), 320, 240, ES_WINDOW_RGB );
if ( !Init ( &esContext ) ) if ( !Init ( &esContext ) )
return 0; return 0;
......
...@@ -259,7 +259,7 @@ int main ( int argc, char *argv[] ) ...@@ -259,7 +259,7 @@ int main ( int argc, char *argv[] )
esInitContext ( &esContext ); esInitContext ( &esContext );
esContext.userData = &userData; esContext.userData = &userData;
esCreateWindow ( &esContext, "Stencil Test", 320, 240, esCreateWindow ( &esContext, TEXT("Stencil Test"), 320, 240,
ES_WINDOW_RGB | ES_WINDOW_DEPTH | ES_WINDOW_STENCIL ); ES_WINDOW_RGB | ES_WINDOW_DEPTH | ES_WINDOW_STENCIL );
if ( !Init ( &esContext ) ) if ( !Init ( &esContext ) )
......
...@@ -241,7 +241,7 @@ int main ( int argc, char *argv[] ) ...@@ -241,7 +241,7 @@ int main ( int argc, char *argv[] )
esInitContext ( &esContext ); esInitContext ( &esContext );
esContext.userData = &userData; esContext.userData = &userData;
esCreateWindow ( &esContext, "Texture Wrap", 640, 480, ES_WINDOW_RGB ); esCreateWindow ( &esContext, TEXT("Texture Wrap"), 640, 480, ES_WINDOW_RGB );
if ( !Init ( &esContext ) ) if ( !Init ( &esContext ) )
return 0; return 0;
......
...@@ -17,11 +17,6 @@ void TInfoSinkBase::append(const char *s) ...@@ -17,11 +17,6 @@ void TInfoSinkBase::append(const char *s)
sink.append(s); sink.append(s);
} }
#ifdef _WIN32
if (outputStream & EDebugger)
OutputDebugString(s);
#endif
if (outputStream & EStdOut) if (outputStream & EStdOut)
fprintf(stdout, "%s", s); fprintf(stdout, "%s", s);
} }
...@@ -33,15 +28,6 @@ void TInfoSinkBase::append(int count, char c) ...@@ -33,15 +28,6 @@ void TInfoSinkBase::append(int count, char c)
sink.append(count, c); sink.append(count, c);
} }
#ifdef _WIN32
if (outputStream & EDebugger) {
char str[2];
str[0] = c;
str[1] = '\0';
OutputDebugString(str);
}
#endif
if (outputStream & EStdOut) if (outputStream & EStdOut)
fprintf(stdout, "%c", c); fprintf(stdout, "%c", c);
} }
...@@ -53,11 +39,6 @@ void TInfoSinkBase::append(const TPersistString& t) ...@@ -53,11 +39,6 @@ void TInfoSinkBase::append(const TPersistString& t)
sink.append(t); sink.append(t);
} }
#ifdef _WIN32
if (outputStream & EDebugger)
OutputDebugString(t.c_str());
#endif
if (outputStream & EStdOut) if (outputStream & EStdOut)
fprintf(stdout, "%s", t.c_str()); fprintf(stdout, "%s", t.c_str());
} }
...@@ -69,11 +50,6 @@ void TInfoSinkBase::append(const TString& t) ...@@ -69,11 +50,6 @@ void TInfoSinkBase::append(const TString& t)
sink.append(t.c_str()); sink.append(t.c_str());
} }
#ifdef _WIN32
if (outputStream & EDebugger)
OutputDebugString(t.c_str());
#endif
if (outputStream & EStdOut) if (outputStream & EStdOut)
fprintf(stdout, "%s", t.c_str()); fprintf(stdout, "%s", t.c_str());
} }
...@@ -25,9 +25,8 @@ enum TPrefixType { ...@@ -25,9 +25,8 @@ enum TPrefixType {
enum TOutputStream { enum TOutputStream {
ENull = 0, ENull = 0,
EDebugger = 0x01, EStdOut = 0x01,
EStdOut = 0x02, EString = 0x02,
EString = 0x04,
}; };
// //
// Encapsulate info logs for all objects that have them. // Encapsulate info logs for all objects that have them.
...@@ -37,7 +36,7 @@ enum TOutputStream { ...@@ -37,7 +36,7 @@ enum TOutputStream {
// //
class TInfoSinkBase { class TInfoSinkBase {
public: public:
TInfoSinkBase() : outputStream(4) {} TInfoSinkBase() : outputStream(EString) {}
void erase() { sink.erase(); } void erase() { sink.erase(); }
TInfoSinkBase& operator<<(const TPersistString& t) { append(t); return *this; } TInfoSinkBase& operator<<(const TPersistString& t) { append(t); return *this; }
TInfoSinkBase& operator<<(char c) { append(1, c); return *this; } TInfoSinkBase& operator<<(char c) { append(1, c); return *this; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment