<?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: Couple of questions regarding CCRenderTexture (iPad device)</title>
		<link>http://www.cocos2d-iphone.org/forum/topic/6560</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:37:01 +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/6560" rel="self" type="application/rss+xml" />

		<item>
			<title>araker on "Couple of questions regarding CCRenderTexture (iPad device)"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/6560#post-58262</link>
			<pubDate>Thu, 07 Oct 2010 07:38:55 +0000</pubDate>
			<dc:creator>araker</dc:creator>
			<guid isPermaLink="false">58262@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>This is already fixed since 0.99.5 beta 2 (see <a href="http://code.google.com/p/cocos2d-iphone/issues/detail?id=937">this issue</a>).
</p></description>
		</item>
		<item>
			<title>onedayitwillmake on "Couple of questions regarding CCRenderTexture (iPad device)"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/6560#post-58248</link>
			<pubDate>Thu, 07 Oct 2010 03:56:30 +0000</pubDate>
			<dc:creator>onedayitwillmake</dc:creator>
			<guid isPermaLink="false">58248@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Pretty sure this is a ghetto solution, but at the end of clear, i just put this -<br />
<pre><code>[sprite_ setBlendFunc:(ccBlendFunc){GL_ONE, GL_ONE_MINUS_SRC_ALPHA}];</code></pre></description>
		</item>
		<item>
			<title>onedayitwillmake on "Couple of questions regarding CCRenderTexture (iPad device)"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/6560#post-58247</link>
			<pubDate>Thu, 07 Oct 2010 03:54:58 +0000</pubDate>
			<dc:creator>onedayitwillmake</dc:creator>
			<guid isPermaLink="false">58247@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Any progress on this, Aaron did you implement a workaround?
</p></description>
		</item>
		<item>
			<title>Questor on "Couple of questions regarding CCRenderTexture (iPad device)"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/6560#post-40164</link>
			<pubDate>Fri, 04 Jun 2010 21:06:34 +0000</pubDate>
			<dc:creator>Questor</dc:creator>
			<guid isPermaLink="false">40164@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Done. Bug #878.</p>
<p>Bug Report Link: <a href="http://code.google.com/p/cocos2d-iphone/issues/detail?id=878" rel="nofollow">http://code.google.com/p/cocos2d-iphone/issues/detail?id=878</a>
</p></description>
		</item>
		<item>
			<title>riq on "Couple of questions regarding CCRenderTexture (iPad device)"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/6560#post-40153</link>
			<pubDate>Fri, 04 Jun 2010 19:41:33 +0000</pubDate>
			<dc:creator>riq</dc:creator>
			<guid isPermaLink="false">40153@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>It seems to be a bug. Could you open a ticket ? Thanks.
</p></description>
		</item>
		<item>
			<title>Questor on "Couple of questions regarding CCRenderTexture (iPad device)"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/6560#post-40145</link>
			<pubDate>Fri, 04 Jun 2010 18:46:28 +0000</pubDate>
			<dc:creator>Questor</dc:creator>
			<guid isPermaLink="false">40145@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I am also curious as to whether this is a bug or not?  </p>
<p>At first glance I would think that perhaps the <strong>begin</strong> and <strong>end</strong> would implicitly save/restore the alpha writing state, but not being a GL person, I am not sure.</p>
<p>Does anyone have any input?
</p></description>
		</item>
		<item>
			<title>Aaron Koolen on "Couple of questions regarding CCRenderTexture (iPad device)"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/6560#post-38382</link>
			<pubDate>Sat, 22 May 2010 03:45:11 +0000</pubDate>
			<dc:creator>Aaron Koolen</dc:creator>
			<guid isPermaLink="false">38382@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I took a look at the Cocos code and have found the culprit. Not sure if this is a bug or not but inside the clear() method it allows turning on of writing to the alpha, clears the  destination and then turns OFF writing to alpha. So from that point on if I write, everything will still contain alpha value 0, the value I cleared with.</p>
<p>If this isn't a bug, then I imagine there must be some other call elsewhere in Cocos that will enable this or something?</p>
<p>-(void)clear:(float)r g:(float)g b:(float)b a:(float)a<br />
{<br />
	[self begin];<br />
	glColorMask(TRUE, TRUE, TRUE, TRUE);<br />
	glClearColor(r, g, b, a);<br />
	glClear(GL_COLOR_BUFFER_BIT &#124; GL_DEPTH_BUFFER_BIT);<br />
	glColorMask(TRUE, TRUE, TRUE, FALSE);<br />
	[self end];<br />
}
</p></description>
		</item>
		<item>
			<title>Aaron Koolen on "Couple of questions regarding CCRenderTexture (iPad device)"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/6560#post-38319</link>
			<pubDate>Fri, 21 May 2010 11:08:47 +0000</pubDate>
			<dc:creator>Aaron Koolen</dc:creator>
			<guid isPermaLink="false">38319@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi all. I've been looking at all the new stuff in Cocos2d and have a couple of problems I'm having with  CCRenderTexture.</p>
<p>I am playing around with a simple paint program. I have one background image that I've loaded from resources, a CCRenderTexture which I draw into with either OpenGL calls or Sprite visit's.</p>
<p>The drawing works OK the first time with my drawing appearing over the background, but I also want to be able to clear the draw area. I am using  [drawSpace clear:0 g:0 b:0 a:0] to do this and while it clears the data away, leaving the background showing through, from that moment on none of my drawing works. Nothing appears. I've checked to see that the coordinates are all OK and they are. Is there anything else I need to do after or before a clear to make sure things work again?</p>
<p>Secondly. I have a question about speed. While Cocos stays at 60fps when my display is static, as I am drawing to the texture the framerate drops quite a bit until I stop drawing on it. Is there anything I can do to speed this is up? Can I selectively draw to the texture in a smaller rect to save speed? My drawing is simply:<br />
<pre><code>[drawSpace begin];
glLineWidth( 5.0f );
glColor4ub(255,0,0,255);
ccDrawLine( start, end );
[drawSpace end];</code></pre>
<p>Thanks
</p></description>
		</item>

	</channel>
</rss>

