<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>cocos2d for iPhone &#187; Topic: Fast set/getPixel for an opengl texture?</title>
		<link>http://www.cocos2d-iphone.org/forum/topic/2449</link>
		<description>A fast, easy to use, free, and community supported 2D game engine</description>
		<language>en-US</language>
		<pubDate>Fri, 10 Feb 2012 01:49:43 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.cocos2d-iphone.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.cocos2d-iphone.org/forum/rss/topic/2449" rel="self" type="application/rss+xml" />

		<item>
			<title>JanuszNSG on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/3#post-121085</link>
			<pubDate>Thu, 13 Oct 2011 15:42:22 +0000</pubDate>
			<dc:creator>JanuszNSG</dc:creator>
			<guid isPermaLink="false">121085@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>you right! I was blind or something... Thx a loot!!!But error reather strange...
</p></description>
		</item>
		<item>
			<title>araker on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/3#post-121073</link>
			<pubDate>Thu, 13 Oct 2011 13:59:48 +0000</pubDate>
			<dc:creator>araker</dc:creator>
			<guid isPermaLink="false">121073@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I'm using the version of the Gaussian blur topic in my 1.0 project without any compile problems. </p>
<p>I see what causes the problem, Lam uses _ as affix, while CCTexture2D uses it as suffix, _size or size_.
</p></description>
		</item>
		<item>
			<title>JanuszNSG on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/3#post-121062</link>
			<pubDate>Thu, 13 Oct 2011 12:37:13 +0000</pubDate>
			<dc:creator>JanuszNSG</dc:creator>
			<guid isPermaLink="false">121062@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Yes, I looked at this tread. But for me problem is (right now;) not related to image data, but for variables with image parameters inherited from CCTexture2D:</p>
<p>GLuint         name_;<br />
CGSize        size_;<br />
NSUInteger    width_,<br />
              height_;<br />
CCTexture2DPixelFormat   format_;<br />
GLfloat       maxS_,<br />
              maxT_;<br />
BOOL          hasPremultipliedAlpha_;</p>
<p>All those are "invisible" in CCMutableTexture2D - so I'm unable to even compile example.
</p></description>
		</item>
		<item>
			<title>araker on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/3#post-121052</link>
			<pubDate>Thu, 13 Oct 2011 11:01:43 +0000</pubDate>
			<dc:creator>araker</dc:creator>
			<guid isPermaLink="false">121052@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I see I remembered <a href="http://www.cocos2d-iphone.org/forum/topic/6315">incorrectly</a>, the changes made to CCTexture2D were to keep the pixelData around. </p>
<p>@<a href='http://www.cocos2d-iphone.org/forum/profile/62364'>JanuszNSG</a>, Have you looked at the <a href="http://www.cocos2d-iphone.org/forum/topic/6315">Gaussian blur thread</a> as well?
</p></description>
		</item>
		<item>
			<title>JanuszNSG on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/3#post-121046</link>
			<pubDate>Thu, 13 Oct 2011 10:44:50 +0000</pubDate>
			<dc:creator>JanuszNSG</dc:creator>
			<guid isPermaLink="false">121046@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Any Ideas? Please!<br />
I found some description with same problem on net. But solutions simply don't work or are some kind of workaround (eg. redeclaration CCTexture2D variables in CCMutableTexture2D). Right now my mutable object can't "see" variables form Texture2D (tested on cocos2d 0.99.5, 1.0.0 rc and 1.0.1), on new project etc. Maybe my environment is a problem, I'll still use Xcode 3.2.6 and iOS 4.3...
</p></description>
		</item>
		<item>
			<title>JanuszNSG on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/3#post-120897</link>
			<pubDate>Wed, 12 Oct 2011 16:54:49 +0000</pubDate>
			<dc:creator>JanuszNSG</dc:creator>
			<guid isPermaLink="false">120897@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I'm starting thinking about some curse over my head, as far as I can see, in CCTexure2D between versions 0.99.5, 1.0.0rc and 1.0.1 is no any differences. Making those variables public manually don't changes a thing:(<br />
Additional as far as i know, to variables in base class can be even private to access them form form inheriting class.
</p></description>
		</item>
		<item>
			<title>araker on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/3#post-120889</link>
			<pubDate>Wed, 12 Oct 2011 16:28:27 +0000</pubDate>
			<dc:creator>araker</dc:creator>
			<guid isPermaLink="false">120889@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>In version 1.0 CCTexture2D was changed to make a few variables public that CCMutable2DTexture needed to access. If you don't know what to change, try to replace your CCTexture2D with the one of 1.0 or a higher version of cocos.
</p></description>
		</item>
		<item>
			<title>JanuszNSG on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/3#post-120864</link>
			<pubDate>Wed, 12 Oct 2011 14:57:49 +0000</pubDate>
			<dc:creator>JanuszNSG</dc:creator>
			<guid isPermaLink="false">120864@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Any idea why CCMutable2DTexture can't "see" CCTexxture2D inherited variables?
</p></description>
		</item>
		<item>
			<title>JanuszNSG on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/3#post-120701</link>
			<pubDate>Tue, 11 Oct 2011 20:38:55 +0000</pubDate>
			<dc:creator>JanuszNSG</dc:creator>
			<guid isPermaLink="false">120701@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>All "undeclared" variables are from CCTexture2D, but class CCMutableTexture inherits form CCTesxture2D, all looks ok, but don't working:(<br />
sorry about "post after post":( but I'm little confussed:(
</p></description>
		</item>
		<item>
			<title>JanuszNSG on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/3#post-120685</link>
			<pubDate>Tue, 11 Oct 2011 19:32:40 +0000</pubDate>
			<dc:creator>JanuszNSG</dc:creator>
			<guid isPermaLink="false">120685@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>ok, problem with Texture2DPixelFormat solved, sholud be CCTexture2DPixelFormat, but variables still causing errors:(
</p></description>
		</item>
		<item>
			<title>JanuszNSG on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/3#post-120683</link>
			<pubDate>Tue, 11 Oct 2011 19:24:51 +0000</pubDate>
			<dc:creator>JanuszNSG</dc:creator>
			<guid isPermaLink="false">120683@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@<a href='http://www.cocos2d-iphone.org/forum/profile/49249'>geertjan88</a> - check coordinates simply Loging them, see where is a 0,0 in both systems, you will quiclky see where is a problem.
</p></description>
		</item>
		<item>
			<title>JanuszNSG on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/3#post-120681</link>
			<pubDate>Tue, 11 Oct 2011 19:21:42 +0000</pubDate>
			<dc:creator>JanuszNSG</dc:creator>
			<guid isPermaLink="false">120681@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Still not working, after creating brand new project on cocos 1.0.1, only adding CCMutableTexture as an #<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> to HelloWorldLayer I recieve 33 errors. Still missiong definition of "Texture2DPixelFormat" and a loot of variables (_foramt, _siez, _width etc). As far as I can see, those veriables have no declarations in code. What I'm doing wrong?
</p></description>
		</item>
		<item>
			<title>geertjan88 on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/3#post-120593</link>
			<pubDate>Tue, 11 Oct 2011 08:11:05 +0000</pubDate>
			<dc:creator>geertjan88</dc:creator>
			<guid isPermaLink="false">120593@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I am having trouble with the location when using ccmutabletexture2d. If i use </p>
<p>	CGPoint location = [touch locationInView:[touch view]];</p>
<p>or</p>
<p>	touchStart = [[CCDirector sharedDirector] convertToGL:location];</p>
<p>the pixel doesn't change were i press. How come? I am programming on ipad in landscape and the texture is exactly 1024x768 and in the center of the screen.
</p></description>
		</item>
		<item>
			<title>JanuszNSG on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/3#post-120471</link>
			<pubDate>Mon, 10 Oct 2011 17:31:51 +0000</pubDate>
			<dc:creator>JanuszNSG</dc:creator>
			<guid isPermaLink="false">120471@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Yes, but I use those version, due to limitation of my mac. And as far as I know this is a stable version (only older), additionaly CCMutableTexture2D which I use is dedicated to this version (or slighty older 0.99)<br />
But will try anyway:D
</p></description>
		</item>
		<item>
			<title>slembcke on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/3#post-120470</link>
			<pubDate>Mon, 10 Oct 2011 17:28:13 +0000</pubDate>
			<dc:creator>slembcke</dc:creator>
			<guid isPermaLink="false">120470@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Nope. The latest stable is 1.0.1. 0.99.5 is nearly a year old now.
</p></description>
		</item>
		<item>
			<title>JanuszNSG on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/3#post-120468</link>
			<pubDate>Mon, 10 Oct 2011 17:12:15 +0000</pubDate>
			<dc:creator>JanuszNSG</dc:creator>
			<guid isPermaLink="false">120468@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>As I wrote, done this. Brand new project with cocos2d 0.99.5 (all ok), adding only CCMutableTexture2D and AsyncObject and only import CCMutableTexture2D causes those errors.
</p></description>
		</item>
		<item>
			<title>slembcke on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/3#post-120467</link>
			<pubDate>Mon, 10 Oct 2011 17:02:47 +0000</pubDate>
			<dc:creator>slembcke</dc:creator>
			<guid isPermaLink="false">120467@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Why start an empty project with anything other than the latest stable version? I would try that first to see if it was just written against some new feature.
</p></description>
		</item>
		<item>
			<title>JanuszNSG on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/2#post-120465</link>
			<pubDate>Mon, 10 Oct 2011 16:37:21 +0000</pubDate>
			<dc:creator>JanuszNSG</dc:creator>
			<guid isPermaLink="false">120465@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello to all:)<br />
I have strange problem with compiling CCMutableTexture, even in empty cocos2d project, is I add both files recieve 41 errors.<br />
Eg.<br />
 - Not known Texture2DPixelFormat<br />
 - a lot of undeclared variables (_size, _width ...)</p>
<p>I'm using cocos 0.99.5 and XCode 3.2.6 - meybe there is a problem?
</p></description>
		</item>
		<item>
			<title>zaaroth on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/2#post-117817</link>
			<pubDate>Sat, 24 Sep 2011 03:12:34 +0000</pubDate>
			<dc:creator>zaaroth</dc:creator>
			<guid isPermaLink="false">117817@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@<a href='http://www.cocos2d-iphone.org/forum/profile/1700'>Lam</a> will know for sure, but, as far as I know, the mutable texture is a rather untested class. Even though lots of people make use of it one way or another, it is not guaranteed to work through automated tests of the framework, so it might break during an upgrade.</p>
<p>Since 2.0 is really in its early stages it is not unexpected that it does not work.
</p></description>
		</item>
		<item>
			<title>seecah.khing on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/2#post-117815</link>
			<pubDate>Sat, 24 Sep 2011 02:25:52 +0000</pubDate>
			<dc:creator>seecah.khing</dc:creator>
			<guid isPermaLink="false">117815@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@<a href='http://www.cocos2d-iphone.org/forum/profile/1700'>Lam</a>: I have already tried everything on importing you class and I forgot to tell you that I'm using the alpha release of cocos2d with versioin 2.0 but I got a lot of errors one of those is the undeclared identifier for the variables below: </p>
<pre><code>case kTexture2DPixelFormat_RGBA8888:	bytesPerPixel_ = 4; break;
			case kTexture2DPixelFormat_A8:			bytesPerPixel_ = 1; break;
			case kTexture2DPixelFormat_RGBA4444:
			case kTexture2DPixelFormat_RGB565:
			case kTexture2DPixelFormat_RGB5A1:</code></pre>
<p>Please advice.</p>
<p>Edited: Never mind I got it already, I've just realized that they changed these variables to eg. kTexture2DPixelFormat_A8 =&#62; kCCTexture2DPixelFormat_A8.
</p></description>
		</item>
		<item>
			<title>Lam on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/2#post-117796</link>
			<pubDate>Sat, 24 Sep 2011 00:25:27 +0000</pubDate>
			<dc:creator>Lam</dc:creator>
			<guid isPermaLink="false">117796@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@seecah.khing<br />
Yeah this should be doable with mutable texture.  Just make sure to search the forum and try out the examples to see if you figure out the basics of using the class first.
</p></description>
		</item>
		<item>
			<title>seecah.khing on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/2#post-117754</link>
			<pubDate>Fri, 23 Sep 2011 17:56:14 +0000</pubDate>
			<dc:creator>seecah.khing</dc:creator>
			<guid isPermaLink="false">117754@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@<a href='http://www.cocos2d-iphone.org/forum/profile/1700'>Lam</a>: I wonder if I can use this one for coloring a sprite. I need to like painting a sprite through the fingers just like Color Me. I'm still so very new in cocos2d and hopefully you can guide me through. Thanks
</p></description>
		</item>
		<item>
			<title>Birkemose on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/2#post-117653</link>
			<pubDate>Fri, 23 Sep 2011 06:54:28 +0000</pubDate>
			<dc:creator>Birkemose</dc:creator>
			<guid isPermaLink="false">117653@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I do extensive manipulation on full screen images ( iPhone ), and by far the fastest approach I have come up with, is copying the entire screen buffer ( in my case live video ) to a memory buffer, doing the manipulations on this buffer, and then render it, using glTexSubImage2D.</p>
<p>Copying the entire screenbuffer, is much less costly than you would think. It uses DMA and does not halt the render pipeline. Just a few glReadPixels will be just as time consuming. I have read people saying, that glTexSubImage2D is slow. I dont think that is the case, it should be just as fast as any other image rendered by OpenGL. Probably what confuses people, is, that when they use subimages, it is easy ( just like with glReadPixels ) to mess up the render pipeline, and kill performance.</p>
<p>My 2 cents anyways.</p>
<p>EDIT:<br />
Maybe I should add, that depending on needs, it might be an option to copy the entire content to an offscrren OpenGL surface. That would be quicker if you had a lot of stuff to render. I do a lot of reading data, but no offscreen rendering, so in my case I have no use of an off screen OpenGL surface.
</p></description>
		</item>
		<item>
			<title>seecah.khing on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/2#post-117610</link>
			<pubDate>Fri, 23 Sep 2011 02:49:34 +0000</pubDate>
			<dc:creator>seecah.khing</dc:creator>
			<guid isPermaLink="false">117610@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@<a href='http://www.cocos2d-iphone.org/forum/profile/1700'>Lam</a>: Thank you so much for the guidance.. I'll check this out.
</p></description>
		</item>
		<item>
			<title>Lam on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/2#post-117529</link>
			<pubDate>Thu, 22 Sep 2011 19:46:43 +0000</pubDate>
			<dc:creator>Lam</dc:creator>
			<guid isPermaLink="false">117529@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@seecah.khing<br />
Just do a forum search for "CCMutableTexture". There's quite a lot of posts of people with example code for it.</p>
<p>Here's one example of gaussian blur from manucorporat.  Maybe that'll be easy to see how the class is used.<br />
<a href="http://www.cocos2d-iphone.org/forum/topic/6315" rel="nofollow">http://www.cocos2d-iphone.org/forum/topic/6315</a>
</p></description>
		</item>
		<item>
			<title>seecah.khing on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/2#post-117479</link>
			<pubDate>Thu, 22 Sep 2011 15:55:15 +0000</pubDate>
			<dc:creator>seecah.khing</dc:creator>
			<guid isPermaLink="false">117479@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@<a href='http://www.cocos2d-iphone.org/forum/profile/1700'>Lam</a>: Any progress on this? This stuff is very useful but I can't let it work. Would you mine sharing a sample code using your API. My apology since I'm still new to Cocos2d. </p>
<p>Thanks a lot!
</p></description>
		</item>
		<item>
			<title>Lam on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/2#post-85029</link>
			<pubDate>Mon, 28 Mar 2011 15:56:30 +0000</pubDate>
			<dc:creator>Lam</dc:creator>
			<guid isPermaLink="false">85029@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>oh haha whoops sorry guys. Didn't notice the questions.</p>
<p>I wonder if mutable texture should take care of premultiplied alpha or should the decision to change blend func be on the programmers end.</p>
<p>If Apple's improved the glTexSubImage that might be an improvement over a direct call to all pixels. I have to take a look at it when I have the time (sorry not much time these days on my end) but I'd have to do some extensive testing just to make sure that the alternative is actually efficient.
</p></description>
		</item>
		<item>
			<title>iphonerider on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/2#post-85001</link>
			<pubDate>Mon, 28 Mar 2011 11:30:17 +0000</pubDate>
			<dc:creator>iphonerider</dc:creator>
			<guid isPermaLink="false">85001@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Any new solution about this?
</p></description>
		</item>
		<item>
			<title>plumenator on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/2#post-68170</link>
			<pubDate>Fri, 24 Dec 2010 07:07:19 +0000</pubDate>
			<dc:creator>plumenator</dc:creator>
			<guid isPermaLink="false">68170@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@<a href='http://www.cocos2d-iphone.org/forum/profile/1700'>Lam</a> Btw, Have you gotten around to optimizing the code with glTexSubImage? I tried a similar thing by maintaining a dirty rect and applying it on draw. Never worked. :-(
</p></description>
		</item>
		<item>
			<title>plumenator on "Fast set/getPixel for an opengl texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2449/page/2#post-68164</link>
			<pubDate>Fri, 24 Dec 2010 06:09:42 +0000</pubDate>
			<dc:creator>plumenator</dc:creator>
			<guid isPermaLink="false">68164@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Shouldn't setPixelAt:rgba: premultiply the rgb with a? Or does the method expect premultipled colors? Similarly shouldn't pixelAt: undo the premultiplication (which is unfortunately lossy, of course)?.
</p></description>
		</item>

	</channel>
</rss>

