istereo

changeset 17:4c20f10a7183

fixed the texture bug
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 07 Sep 2011 09:35:20 +0300
parents 20a9d3db38cb
children 6851489e70c2
files istereo.xcodeproj/project.pbxproj src/istereo.c src/tex.c
diffstat 3 files changed, 12 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/istereo.xcodeproj/project.pbxproj	Wed Sep 07 09:19:47 2011 +0300
     1.2 +++ b/istereo.xcodeproj/project.pbxproj	Wed Sep 07 09:35:20 2011 +0300
     1.3 @@ -18,6 +18,8 @@
     1.4  		062A12AB1416E9A00070199C /* test.p.glsl in Resources */ = {isa = PBXBuildFile; fileRef = 062A12A91416E9A00070199C /* test.p.glsl */; };
     1.5  		062A12AC1416E9A00070199C /* test.v.glsl in Resources */ = {isa = PBXBuildFile; fileRef = 062A12AA1416E9A00070199C /* test.v.glsl */; };
     1.6  		0649A5BF14171BCF00AB62D4 /* respath.c in Sources */ = {isa = PBXBuildFile; fileRef = 0649A5BD14171BCF00AB62D4 /* respath.c */; };
     1.7 +		0649A6A1141740FA00AB62D4 /* tiles.ppm in Resources */ = {isa = PBXBuildFile; fileRef = 0649A6A0141740FA00AB62D4 /* tiles.ppm */; };
     1.8 +		0649A6A91417411600AB62D4 /* tex.c in Sources */ = {isa = PBXBuildFile; fileRef = 0649A6A71417411600AB62D4 /* tex.c */; };
     1.9  		1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
    1.10  		1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
    1.11  		28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; };
    1.12 @@ -47,6 +49,9 @@
    1.13  		062A12AA1416E9A00070199C /* test.v.glsl */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = text; name = test.v.glsl; path = sdr/test.v.glsl; sourceTree = "<group>"; };
    1.14  		0649A5BD14171BCF00AB62D4 /* respath.c */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.c; name = respath.c; path = src/respath.c; sourceTree = "<group>"; };
    1.15  		0649A5BE14171BCF00AB62D4 /* respath.h */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.h; name = respath.h; path = src/respath.h; sourceTree = "<group>"; };
    1.16 +		0649A6A0141740FA00AB62D4 /* tiles.ppm */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = text; path = tiles.ppm; sourceTree = "<group>"; };
    1.17 +		0649A6A71417411600AB62D4 /* tex.c */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.c; name = tex.c; path = src/tex.c; sourceTree = "<group>"; };
    1.18 +		0649A6A81417411600AB62D4 /* tex.h */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.h; name = tex.h; path = src/tex.h; sourceTree = "<group>"; };
    1.19  		1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
    1.20  		1D6058910D05DD3D006BFB54 /* istereo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = istereo.app; sourceTree = BUILT_PRODUCTS_DIR; };
    1.21  		1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
    1.22 @@ -75,6 +80,8 @@
    1.23  		062A128D1416E9400070199C /* src */ = {
    1.24  			isa = PBXGroup;
    1.25  			children = (
    1.26 +				0649A6A71417411600AB62D4 /* tex.c */,
    1.27 +				0649A6A81417411600AB62D4 /* tex.h */,
    1.28  				0649A5BD14171BCF00AB62D4 /* respath.c */,
    1.29  				0649A5BE14171BCF00AB62D4 /* respath.h */,
    1.30  				062A129D1416E9920070199C /* istereo.c */,
    1.31 @@ -147,6 +154,7 @@
    1.32  		29B97317FDCFA39411CA2CEA /* Resources */ = {
    1.33  			isa = PBXGroup;
    1.34  			children = (
    1.35 +				0649A6A0141740FA00AB62D4 /* tiles.ppm */,
    1.36  				28AD733E0D9D9553002E5188 /* MainWindow.xib */,
    1.37  				8D1107310486CEB800E47090 /* istereo-Info.plist */,
    1.38  			);
    1.39 @@ -209,6 +217,7 @@
    1.40  				28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */,
    1.41  				062A12AB1416E9A00070199C /* test.p.glsl in Resources */,
    1.42  				062A12AC1416E9A00070199C /* test.v.glsl in Resources */,
    1.43 +				0649A6A1141740FA00AB62D4 /* tiles.ppm in Resources */,
    1.44  			);
    1.45  			runOnlyForDeploymentPostprocessing = 0;
    1.46  		};
    1.47 @@ -228,6 +237,7 @@
    1.48  				062A12A71416E9920070199C /* sanegl.c in Sources */,
    1.49  				062A12A81416E9920070199C /* sdr.c in Sources */,
    1.50  				0649A5BF14171BCF00AB62D4 /* respath.c in Sources */,
    1.51 +				0649A6A91417411600AB62D4 /* tex.c in Sources */,
    1.52  			);
    1.53  			runOnlyForDeploymentPostprocessing = 0;
    1.54  		};
     2.1 --- a/src/istereo.c	Wed Sep 07 09:19:47 2011 +0300
     2.2 +++ b/src/istereo.c	Wed Sep 07 09:35:20 2011 +0300
     2.3 @@ -48,6 +48,7 @@
     2.4  	gl_translatef(0, 0, -8);
     2.5  
     2.6  	bind_texture(tex, 0);
     2.7 +	set_uniform_int(prog, "tex", 0);
     2.8  
     2.9  	gl_begin(GL_QUADS);
    2.10  	gl_texcoord2f(0, 0);
     3.1 --- a/src/tex.c	Wed Sep 07 09:19:47 2011 +0300
     3.2 +++ b/src/tex.c	Wed Sep 07 09:35:20 2011 +0300
     3.3 @@ -51,7 +51,7 @@
     3.4  	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
     3.5  	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
     3.6  	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
     3.7 -	glTexImage2D(GL_TEXTURE_2D, 0, 4, xsz, ysz, 0, GL_RGB, GL_UNSIGNED_BYTE, pixels);
     3.8 +	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, xsz, ysz, 0, GL_RGB, GL_UNSIGNED_BYTE, pixels);
     3.9  	free(pixels);
    3.10  
    3.11  	return tex;