From ea5b1fb814b729e1166cb71f7f51512376cfb2e7 Mon Sep 17 00:00:00 2001 From: chsieh Date: Sat, 18 Dec 2010 11:02:52 -0800 Subject: [PATCH] Fixes to standard shaders compile errors. --- .../Foundation/GraphicsServices/OpenGLServices.h | 15 ++++++--------- .../Foundation/GraphicsServices/OpenGLServices.m | 2 ++ .../OSInterface/LittlestViewController.m | 4 ++-- Littlest.xcodeproj/project.pbxproj | 12 ++++++++---- Shaders/Shader.fsh | 8 -------- Shaders/Shader.vsh | 8 -------- 6 files changed, 18 insertions(+), 31 deletions(-) create mode 100644 Classes/Foundation/GraphicsServices/OpenGLServices.m diff --git a/Classes/Foundation/GraphicsServices/OpenGLServices.h b/Classes/Foundation/GraphicsServices/OpenGLServices.h index 838caca..f59fbac 100644 --- a/Classes/Foundation/GraphicsServices/OpenGLServices.h +++ b/Classes/Foundation/GraphicsServices/OpenGLServices.h @@ -1,23 +1,20 @@ -// -// OpenGLServices.h -// Littlest -// -// Created by Doris Chen on 12/11/10. -// Copyright 2010 __MyCompanyName__. All rights reserved. -// - #pragma once +#include "Foundation/Common/GlobalInclude.h" + #include #include #include #include +//typedef TextureHandle GLuint; +/* class OpenGLServices { public: bool init(); private: - + EAGLContext* mGLContext; }; +*/ diff --git a/Classes/Foundation/GraphicsServices/OpenGLServices.m b/Classes/Foundation/GraphicsServices/OpenGLServices.m new file mode 100644 index 0000000..9afa6ac --- /dev/null +++ b/Classes/Foundation/GraphicsServices/OpenGLServices.m @@ -0,0 +1,2 @@ +#include "OpenGLServices.h" + diff --git a/Classes/Foundation/OSInterface/LittlestViewController.m b/Classes/Foundation/OSInterface/LittlestViewController.m index 66fef57..b1ad024 100644 --- a/Classes/Foundation/OSInterface/LittlestViewController.m +++ b/Classes/Foundation/OSInterface/LittlestViewController.m @@ -56,8 +56,8 @@ enum { else if (![EAGLContext setCurrentContext:aContext]) NSLog(@"Failed to set ES context current"); - self.context = aContext; - [aContext release]; + self.context = aContext; + [aContext release]; [(EAGLView *)self.view setContext:context]; [(EAGLView *)self.view setFramebuffer]; diff --git a/Littlest.xcodeproj/project.pbxproj b/Littlest.xcodeproj/project.pbxproj index 76b10a4..e58de7d 100755 --- a/Littlest.xcodeproj/project.pbxproj +++ b/Littlest.xcodeproj/project.pbxproj @@ -22,8 +22,9 @@ 4B68588612BC288E005667D3 /* EAGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B68588112BC288E005667D3 /* EAGLView.m */; }; 4B68588712BC288E005667D3 /* LittlestAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B68588312BC288E005667D3 /* LittlestAppDelegate.m */; }; 4B68588812BC288E005667D3 /* LittlestViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B68588512BC288E005667D3 /* LittlestViewController.m */; }; - 4B90648412B41E6500655D84 /* Standard.vsh in Sources */ = {isa = PBXBuildFile; fileRef = 4B90648312B41E6500655D84 /* Standard.vsh */; }; - 4B90648612B426FE00655D84 /* Standard.fsh in Sources */ = {isa = PBXBuildFile; fileRef = 4B90648512B426FE00655D84 /* Standard.fsh */; }; + 4B90648412B41E6500655D84 /* Standard.vsh in Resources */ = {isa = PBXBuildFile; fileRef = 4B90648312B41E6500655D84 /* Standard.vsh */; }; + 4B90648612B426FE00655D84 /* Standard.fsh in Resources */ = {isa = PBXBuildFile; fileRef = 4B90648512B426FE00655D84 /* Standard.fsh */; }; + 4BA0CD3712BD341500EBB6F0 /* OpenGLServices.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BA0CD3612BD341500EBB6F0 /* OpenGLServices.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -72,6 +73,7 @@ 4B68588512BC288E005667D3 /* LittlestViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LittlestViewController.m; sourceTree = ""; }; 4B90648312B41E6500655D84 /* Standard.vsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = Standard.vsh; path = Shaders/Standard/Standard.vsh; sourceTree = ""; }; 4B90648512B426FE00655D84 /* Standard.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = Standard.fsh; path = Shaders/Standard/Standard.fsh; sourceTree = ""; }; + 4BA0CD3612BD341500EBB6F0 /* OpenGLServices.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OpenGLServices.m; sourceTree = ""; }; 8D1107310486CEB800E47090 /* Littlest-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Littlest-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -245,6 +247,7 @@ 4B68587312BC27FD005667D3 /* GraphicsServices */ = { isa = PBXGroup; children = ( + 4BA0CD3612BD341500EBB6F0 /* OpenGLServices.m */, 4B68587412BC27FD005667D3 /* OpenGLServices.h */, ); path = GraphicsServices; @@ -331,6 +334,8 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 4B90648412B41E6500655D84 /* Standard.vsh in Resources */, + 4B90648612B426FE00655D84 /* Standard.fsh in Resources */, 2514C27B10084DCA00A42282 /* Shader.fsh in Resources */, 2514C27C10084DCA00A42282 /* Shader.vsh in Resources */, 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */, @@ -346,14 +351,13 @@ buildActionMask = 2147483647; files = ( 1D60589B0D05DD56006BFB54 /* main.m in Sources */, - 4B90648412B41E6500655D84 /* Standard.vsh in Sources */, - 4B90648612B426FE00655D84 /* Standard.fsh in Sources */, 4B68585B12BC1E97005667D3 /* LocklessRingBuffer.cpp in Sources */, 4B68585C12BC1E97005667D3 /* MemoryBitset.cpp in Sources */, 4B68585D12BC1E97005667D3 /* MemoryHeap.cpp in Sources */, 4B68588612BC288E005667D3 /* EAGLView.m in Sources */, 4B68588712BC288E005667D3 /* LittlestAppDelegate.m in Sources */, 4B68588812BC288E005667D3 /* LittlestViewController.m in Sources */, + 4BA0CD3712BD341500EBB6F0 /* OpenGLServices.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Shaders/Shader.fsh b/Shaders/Shader.fsh index 21fa03a..14fe852 100644 --- a/Shaders/Shader.fsh +++ b/Shaders/Shader.fsh @@ -1,11 +1,3 @@ -// -// Shader.fsh -// Littlest -// -// Created by Doris Chen on 12/4/10. -// Copyright 2010 __MyCompanyName__. All rights reserved. -// - varying lowp vec4 colorVarying; void main() diff --git a/Shaders/Shader.vsh b/Shaders/Shader.vsh index d89afa7..2f42d90 100644 --- a/Shaders/Shader.vsh +++ b/Shaders/Shader.vsh @@ -1,11 +1,3 @@ -// -// Shader.vsh -// Littlest -// -// Created by Doris Chen on 12/4/10. -// Copyright 2010 __MyCompanyName__. All rights reserved. -// - attribute vec4 position; attribute vec4 color; -- 1.7.0.4