# HG changeset patch # User John Tsiombikas # Date 1315377320 -10800 # Node ID 4c20f10a7183e0b51210d78fed07a4f527081d46 # Parent 20a9d3db38cbbff0ef10873cea5dbd989afc022c fixed the texture bug diff -r 20a9d3db38cb -r 4c20f10a7183 istereo.xcodeproj/project.pbxproj --- a/istereo.xcodeproj/project.pbxproj Wed Sep 07 09:19:47 2011 +0300 +++ b/istereo.xcodeproj/project.pbxproj Wed Sep 07 09:35:20 2011 +0300 @@ -18,6 +18,8 @@ 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 */; }; 0649A5BF14171BCF00AB62D4 /* respath.c in Sources */ = {isa = PBXBuildFile; fileRef = 0649A5BD14171BCF00AB62D4 /* respath.c */; }; + 0649A6A1141740FA00AB62D4 /* tiles.ppm in Resources */ = {isa = PBXBuildFile; fileRef = 0649A6A0141740FA00AB62D4 /* tiles.ppm */; }; + 0649A6A91417411600AB62D4 /* tex.c in Sources */ = {isa = PBXBuildFile; fileRef = 0649A6A71417411600AB62D4 /* tex.c */; }; 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 */; }; @@ -47,6 +49,9 @@ 062A12AA1416E9A00070199C /* test.v.glsl */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = text; name = test.v.glsl; path = sdr/test.v.glsl; sourceTree = ""; }; 0649A5BD14171BCF00AB62D4 /* respath.c */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.c; name = respath.c; path = src/respath.c; sourceTree = ""; }; 0649A5BE14171BCF00AB62D4 /* respath.h */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.h; name = respath.h; path = src/respath.h; sourceTree = ""; }; + 0649A6A0141740FA00AB62D4 /* tiles.ppm */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = text; path = tiles.ppm; sourceTree = ""; }; + 0649A6A71417411600AB62D4 /* tex.c */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.c; name = tex.c; path = src/tex.c; sourceTree = ""; }; + 0649A6A81417411600AB62D4 /* tex.h */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.h; name = tex.h; path = src/tex.h; 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; }; @@ -75,6 +80,8 @@ 062A128D1416E9400070199C /* src */ = { isa = PBXGroup; children = ( + 0649A6A71417411600AB62D4 /* tex.c */, + 0649A6A81417411600AB62D4 /* tex.h */, 0649A5BD14171BCF00AB62D4 /* respath.c */, 0649A5BE14171BCF00AB62D4 /* respath.h */, 062A129D1416E9920070199C /* istereo.c */, @@ -147,6 +154,7 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( + 0649A6A0141740FA00AB62D4 /* tiles.ppm */, 28AD733E0D9D9553002E5188 /* MainWindow.xib */, 8D1107310486CEB800E47090 /* istereo-Info.plist */, ); @@ -209,6 +217,7 @@ 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */, 062A12AB1416E9A00070199C /* test.p.glsl in Resources */, 062A12AC1416E9A00070199C /* test.v.glsl in Resources */, + 0649A6A1141740FA00AB62D4 /* tiles.ppm in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -228,6 +237,7 @@ 062A12A71416E9920070199C /* sanegl.c in Sources */, 062A12A81416E9920070199C /* sdr.c in Sources */, 0649A5BF14171BCF00AB62D4 /* respath.c in Sources */, + 0649A6A91417411600AB62D4 /* tex.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff -r 20a9d3db38cb -r 4c20f10a7183 src/istereo.c --- a/src/istereo.c Wed Sep 07 09:19:47 2011 +0300 +++ b/src/istereo.c Wed Sep 07 09:35:20 2011 +0300 @@ -48,6 +48,7 @@ gl_translatef(0, 0, -8); bind_texture(tex, 0); + set_uniform_int(prog, "tex", 0); gl_begin(GL_QUADS); gl_texcoord2f(0, 0); diff -r 20a9d3db38cb -r 4c20f10a7183 src/tex.c --- a/src/tex.c Wed Sep 07 09:19:47 2011 +0300 +++ b/src/tex.c Wed Sep 07 09:35:20 2011 +0300 @@ -51,7 +51,7 @@ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexImage2D(GL_TEXTURE_2D, 0, 4, xsz, ysz, 0, GL_RGB, GL_UNSIGNED_BYTE, pixels); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, xsz, ysz, 0, GL_RGB, GL_UNSIGNED_BYTE, pixels); free(pixels); return tex;