fixed memory leak from CCGLProgram.cpp

enable retina for win32
This commit is contained in:
Phenix Yu 2012-04-11 11:15:53 +08:00
parent a05757f741
commit b8e6d9c589
4 changed files with 7 additions and 5 deletions

View File

@ -49,7 +49,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\Classes;&quot;$(SolutionDir)\lua\cocos2dx_support&quot;;&quot;$(SolutionDir)\lua\CocosDenshion_support&quot;;&quot;$(SolutionDir)\lua\lua&quot;;&quot;$(SolutionDir)\lua\tolua&quot;;&quot;$(SolutionDir)\lua\src&quot;;.;&quot;$(SolutionDir)\cocos2dx&quot;;&quot;$(SolutionDir)\cocos2dx\include&quot;;&quot;$(SolutionDir)\cocos2dx\platform&quot;;&quot;$(SolutionDir)\cocos2dx\platform\third_party\win32\OGLES&quot;;&quot;$(SolutionDir)\CocosDenshion\Include&quot;" AdditionalIncludeDirectories="..\Classes;&quot;$(SolutionDir)\lua\cocos2dx_support&quot;;&quot;$(SolutionDir)\lua\CocosDenshion_support&quot;;&quot;$(SolutionDir)\lua\lua&quot;;&quot;$(SolutionDir)\lua\tolua&quot;;&quot;$(SolutionDir)\lua\src&quot;;.;&quot;$(SolutionDir)\cocos2dx&quot;;&quot;$(SolutionDir)\cocos2dx\include&quot;;&quot;$(SolutionDir)\cocos2dx\platform&quot;;&quot;$(SolutionDir)\cocos2dx\platform\third_party\win32\OGLES&quot;;&quot;$(SolutionDir)\CocosDenshion\Include&quot;;&quot;$(SolutionDir)\cocos2dx\kazmath\include&quot;"
PreprocessorDefinitions="WIN32;_WINDOWS;STRICT;_DEBUG;COCOS2D_DEBUG=1" PreprocessorDefinitions="WIN32;_WINDOWS;STRICT;_DEBUG;COCOS2D_DEBUG=1"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"

View File

@ -96,7 +96,7 @@ bool AppDelegate::applicationDidFinishLaunching() {
pDirector->setOpenGLView(&CCEGLView::sharedOpenGLView()); pDirector->setOpenGLView(&CCEGLView::sharedOpenGLView());
// enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices. // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices.
// pDirector->enableRetinaDisplay(true); pDirector->enableRetinaDisplay(true);
// turn on display FPS // turn on display FPS
pDirector->setDisplayFPS(true); pDirector->setDisplayFPS(true);

View File

@ -53,7 +53,7 @@ public:
bool canSetContentScaleFactor(); bool canSetContentScaleFactor();
void setContentScaleFactor(float contentScaleFactor); void setContentScaleFactor(float contentScaleFactor);
float getMainScreenScale() { return 1.0f; } float getMainScreenScale() { return -1.0f; }
virtual bool Create(LPCTSTR pTitle, int w, int h); virtual bool Create(LPCTSTR pTitle, int w, int h);
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);

View File

@ -114,8 +114,10 @@ bool CCGLProgram::initWithVertexShaderFilename(const char* vShaderFilename, cons
{ {
const GLchar * vertexSource = (GLchar*) CCString::stringWithContentsOfFile(CCFileUtils::fullPathFromRelativePath(vShaderFilename)); const GLchar * vertexSource = (GLchar*) CCString::stringWithContentsOfFile(CCFileUtils::fullPathFromRelativePath(vShaderFilename));
const GLchar * fragmentSource = (GLchar*) CCString::stringWithContentsOfFile(CCFileUtils::fullPathFromRelativePath(fShaderFilename)); const GLchar * fragmentSource = (GLchar*) CCString::stringWithContentsOfFile(CCFileUtils::fullPathFromRelativePath(fShaderFilename));
bool ret = initWithVertexShaderByteArray(vertexSource, fragmentSource);
return initWithVertexShaderByteArray(vertexSource, fragmentSource); CC_SAFE_DELETE_ARRAY(vertexSource);
CC_SAFE_DELETE_ARRAY(fragmentSource);
return ret;
} }
const char* CCGLProgram::description() const char* CCGLProgram::description()