# HG changeset patch # User John Tsiombikas # Date 1315362799 -10800 # Node ID 2c5620f0670c975437e6de8d8e5c57165a9543b9 # Parent bb68fac225795576df27416b5fbe2e1c8af444d4 trying to make this piece of crap work diff -r bb68fac22579 -r 2c5620f0670c istereo.xcodeproj/project.pbxproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/istereo.xcodeproj/project.pbxproj Wed Sep 07 05:33:19 2011 +0300 @@ -0,0 +1,312 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 45; + objects = { + +/* Begin PBXBuildFile section */ + 062A12991416E9750070199C /* EAGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = 062A12911416E9750070199C /* EAGLView.m */; }; + 062A129A1416E9750070199C /* ES1Renderer.m in Sources */ = {isa = PBXBuildFile; fileRef = 062A12931416E9750070199C /* ES1Renderer.m */; }; + 062A129B1416E9750070199C /* ES2Renderer.m in Sources */ = {isa = PBXBuildFile; fileRef = 062A12951416E9750070199C /* ES2Renderer.m */; }; + 062A129C1416E9750070199C /* istereoAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 062A12981416E9750070199C /* istereoAppDelegate.m */; }; + 062A12A51416E9920070199C /* istereo.c in Sources */ = {isa = PBXBuildFile; fileRef = 062A129D1416E9920070199C /* istereo.c */; }; + 062A12A61416E9920070199C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 062A129F1416E9920070199C /* main.m */; }; + 062A12A71416E9920070199C /* sanegl.c in Sources */ = {isa = PBXBuildFile; fileRef = 062A12A11416E9920070199C /* sanegl.c */; }; + 062A12A81416E9920070199C /* sdr.c in Sources */ = {isa = PBXBuildFile; fileRef = 062A12A31416E9920070199C /* sdr.c */; }; + 062A12AB1416E9A00070199C /* test.p.glsl in Resources */ = {isa = PBXBuildFile; fileRef = 062A12A91416E9A00070199C /* test.p.glsl */; }; + 062A12AC1416E9A00070199C /* test.v.glsl in Resources */ = {isa = PBXBuildFile; fileRef = 062A12AA1416E9A00070199C /* test.v.glsl */; }; + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; }; + 28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD14FF0DC6FC520079059D /* OpenGLES.framework */; }; + 28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD15070DC6FC5B0079059D /* QuartzCore.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 062A12901416E9750070199C /* EAGLView.h */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.h; name = EAGLView.h; path = src/EAGLView.h; sourceTree = ""; }; + 062A12911416E9750070199C /* EAGLView.m */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.objc; name = EAGLView.m; path = src/EAGLView.m; sourceTree = ""; }; + 062A12921416E9750070199C /* ES1Renderer.h */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.h; name = ES1Renderer.h; path = src/ES1Renderer.h; sourceTree = ""; }; + 062A12931416E9750070199C /* ES1Renderer.m */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.objc; name = ES1Renderer.m; path = src/ES1Renderer.m; sourceTree = ""; }; + 062A12941416E9750070199C /* ES2Renderer.h */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.h; name = ES2Renderer.h; path = src/ES2Renderer.h; sourceTree = ""; }; + 062A12951416E9750070199C /* ES2Renderer.m */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.objc; name = ES2Renderer.m; path = src/ES2Renderer.m; sourceTree = ""; }; + 062A12961416E9750070199C /* ESRenderer.h */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.h; name = ESRenderer.h; path = src/ESRenderer.h; sourceTree = ""; }; + 062A12971416E9750070199C /* istereoAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.h; name = istereoAppDelegate.h; path = src/istereoAppDelegate.h; sourceTree = ""; }; + 062A12981416E9750070199C /* istereoAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.objc; name = istereoAppDelegate.m; path = src/istereoAppDelegate.m; sourceTree = ""; }; + 062A129D1416E9920070199C /* istereo.c */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.c; name = istereo.c; path = src/istereo.c; sourceTree = ""; }; + 062A129E1416E9920070199C /* istereo.h */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.h; name = istereo.h; path = src/istereo.h; sourceTree = ""; }; + 062A129F1416E9920070199C /* main.m */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.objc; name = main.m; path = src/main.m; sourceTree = ""; }; + 062A12A01416E9920070199C /* opengl.h */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.h; name = opengl.h; path = src/opengl.h; sourceTree = ""; }; + 062A12A11416E9920070199C /* sanegl.c */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.c; name = sanegl.c; path = src/sanegl.c; sourceTree = ""; }; + 062A12A21416E9920070199C /* sanegl.h */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.h; name = sanegl.h; path = src/sanegl.h; sourceTree = ""; }; + 062A12A31416E9920070199C /* sdr.c */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.c; name = sdr.c; path = src/sdr.c; sourceTree = ""; }; + 062A12A41416E9920070199C /* sdr.h */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.h; name = sdr.h; path = src/sdr.h; sourceTree = ""; }; + 062A12A91416E9A00070199C /* test.p.glsl */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = text; name = test.p.glsl; path = sdr/test.p.glsl; sourceTree = ""; }; + 062A12AA1416E9A00070199C /* test.v.glsl */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = text; name = test.v.glsl; path = sdr/test.v.glsl; sourceTree = ""; }; + 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 1D6058910D05DD3D006BFB54 /* istereo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = istereo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; + 28FD14FF0DC6FC520079059D /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + 28FD15070DC6FC5B0079059D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + 32CA4F630368D1EE00C91783 /* istereo_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = istereo_Prefix.pch; sourceTree = ""; }; + 8D1107310486CEB800E47090 /* istereo-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "istereo-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, + 28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */, + 28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 062A128D1416E9400070199C /* src */ = { + isa = PBXGroup; + children = ( + 062A129D1416E9920070199C /* istereo.c */, + 062A129E1416E9920070199C /* istereo.h */, + 062A12A01416E9920070199C /* opengl.h */, + 062A12A11416E9920070199C /* sanegl.c */, + 062A12A21416E9920070199C /* sanegl.h */, + 062A12A31416E9920070199C /* sdr.c */, + 062A12A41416E9920070199C /* sdr.h */, + 062A128F1416E94D0070199C /* gay */, + ); + name = src; + sourceTree = ""; + }; + 062A128E1416E9450070199C /* sdr */ = { + isa = PBXGroup; + children = ( + 062A12A91416E9A00070199C /* test.p.glsl */, + 062A12AA1416E9A00070199C /* test.v.glsl */, + ); + name = sdr; + sourceTree = ""; + }; + 062A128F1416E94D0070199C /* gay */ = { + isa = PBXGroup; + children = ( + 062A129F1416E9920070199C /* main.m */, + 062A12901416E9750070199C /* EAGLView.h */, + 062A12911416E9750070199C /* EAGLView.m */, + 062A12921416E9750070199C /* ES1Renderer.h */, + 062A12931416E9750070199C /* ES1Renderer.m */, + 062A12941416E9750070199C /* ES2Renderer.h */, + 062A12951416E9750070199C /* ES2Renderer.m */, + 062A12961416E9750070199C /* ESRenderer.h */, + 062A12971416E9750070199C /* istereoAppDelegate.h */, + 062A12981416E9750070199C /* istereoAppDelegate.m */, + ); + name = gay; + sourceTree = ""; + }; + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 1D6058910D05DD3D006BFB54 /* istereo.app */, + ); + name = Products; + sourceTree = ""; + }; + 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { + isa = PBXGroup; + children = ( + 062A128E1416E9450070199C /* sdr */, + 062A128D1416E9400070199C /* src */, + 29B97315FDCFA39411CA2CEA /* Other Sources */, + 29B97317FDCFA39411CA2CEA /* Resources */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + ); + name = CustomTemplate; + sourceTree = ""; + }; + 29B97315FDCFA39411CA2CEA /* Other Sources */ = { + isa = PBXGroup; + children = ( + 32CA4F630368D1EE00C91783 /* istereo_Prefix.pch */, + ); + name = "Other Sources"; + sourceTree = ""; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + 28AD733E0D9D9553002E5188 /* MainWindow.xib */, + 8D1107310486CEB800E47090 /* istereo-Info.plist */, + ); + name = Resources; + sourceTree = ""; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 28FD15070DC6FC5B0079059D /* QuartzCore.framework */, + 28FD14FF0DC6FC520079059D /* OpenGLES.framework */, + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, + 1D30AB110D05D00D00671497 /* Foundation.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 1D6058900D05DD3D006BFB54 /* istereo */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "istereo" */; + buildPhases = ( + 1D60588D0D05DD3D006BFB54 /* Resources */, + 1D60588E0D05DD3D006BFB54 /* Sources */, + 1D60588F0D05DD3D006BFB54 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = istereo; + productName = istereo; + productReference = 1D6058910D05DD3D006BFB54 /* istereo.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "istereo" */; + compatibilityVersion = "Xcode 3.1"; + hasScannedForEncodings = 1; + mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 1D6058900D05DD3D006BFB54 /* istereo */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 1D60588D0D05DD3D006BFB54 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */, + 062A12AB1416E9A00070199C /* test.p.glsl in Resources */, + 062A12AC1416E9A00070199C /* test.v.glsl in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 1D60588E0D05DD3D006BFB54 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 062A12991416E9750070199C /* EAGLView.m in Sources */, + 062A129A1416E9750070199C /* ES1Renderer.m in Sources */, + 062A129B1416E9750070199C /* ES2Renderer.m in Sources */, + 062A129C1416E9750070199C /* istereoAppDelegate.m in Sources */, + 062A12A51416E9920070199C /* istereo.c in Sources */, + 062A12A61416E9920070199C /* main.m in Sources */, + 062A12A71416E9920070199C /* sanegl.c in Sources */, + 062A12A81416E9920070199C /* sdr.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 1D6058940D05DD3E006BFB54 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = istereo_Prefix.pch; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "istereo-Info.plist"; + PRODUCT_NAME = istereo; + }; + name = Debug; + }; + 1D6058950D05DD3E006BFB54 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = istereo_Prefix.pch; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "istereo-Info.plist"; + PRODUCT_NAME = istereo; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_PREPROCESSOR_DEFINITIONS = DEBUG; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = iphoneos4.0; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + PREBINDING = NO; + SDKROOT = iphoneos4.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "istereo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1D6058940D05DD3E006BFB54 /* Debug */, + 1D6058950D05DD3E006BFB54 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "istereo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff -r bb68fac22579 -r 2c5620f0670c src/istereo.c --- a/src/istereo.c Wed Sep 07 02:48:35 2011 +0300 +++ b/src/istereo.c Wed Sep 07 05:33:19 2011 +0300 @@ -1,15 +1,20 @@ #include #include +#include #include "opengl.h" #include "istereo.h" #include "sanegl.h" #include "sdr.h" +#include "objcsucks.h" unsigned int prog; int init(void) { - if(!(prog = create_program_load("sdr/test.v.glsl", "sdr/test.p.glsl"))) { + char *path = ocs_get_path(OCS_PATH_RESOURCES); + chdir(path); + + if(!(prog = create_program_load("test.v.glsl", "test.p.glsl"))) { fprintf(stderr, "failed to load shader program\n"); return -1; } @@ -32,8 +37,6 @@ gl_load_identity(); gl_translatef(0, 0, -8); - gl_apply_xform(prog); - gl_begin(GL_QUADS); gl_color3f(1, 0, 0); gl_vertex3f(-1, -1, 0); diff -r bb68fac22579 -r 2c5620f0670c src/main.m --- a/src/main.m Wed Sep 07 02:48:35 2011 +0300 +++ b/src/main.m Wed Sep 07 05:33:19 2011 +0300 @@ -1,17 +1,9 @@ -// -// main.m -// istereo -// -// Created by nuclear on 9/6/11. -// Copyright __MyCompanyName__ 2011. All rights reserved. -// - #import -int main(int argc, char *argv[]) { - - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - int retVal = UIApplicationMain(argc, argv, nil, nil); - [pool release]; - return retVal; +int main(int argc, char *argv[]) +{ + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + int retVal = UIApplicationMain(argc, argv, nil, nil); + [pool release]; + return retVal; } diff -r bb68fac22579 -r 2c5620f0670c src/opengl.h --- a/src/opengl.h Wed Sep 07 02:48:35 2011 +0300 +++ b/src/opengl.h Wed Sep 07 05:33:19 2011 +0300 @@ -1,4 +1,4 @@ -#if TARGETIPHONESIMULATOR || TARGETOSIPHONE +#if defined(__IPHONE_3_0) || defined(__IPHONE_3_2) || defined(__IPHONE_4_0) #include #else diff -r bb68fac22579 -r 2c5620f0670c src/sanegl.c --- a/src/sanegl.c Wed Sep 07 02:48:35 2011 +0300 +++ b/src/sanegl.c Wed Sep 07 05:33:19 2011 +0300 @@ -17,6 +17,7 @@ */ #include +#include #include #include #include @@ -418,7 +419,7 @@ if(buffer_full) { gl_draw_immediate(); - glBegin(prim); /* reset everything */ + gl_begin(prim); /* reset everything */ } }