<?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; Tag: external - Recent Topics</title>
		<link>http://www.cocos2d-iphone.org/forum/tags/external</link>
		<description>A fast, easy to use, free, and community supported 2D game engine</description>
		<language>en-US</language>
		<pubDate>Fri, 10 Feb 2012 04:10:26 +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/tags/external/topics" rel="self" type="application/rss+xml" />

		<item>
			<title>deeje on "video out + retina display devices + iOS 5 = not displaying"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/21914#post-121793</link>
			<pubDate>Tue, 18 Oct 2011 01:28:14 +0000</pubDate>
			<dc:creator>deeje</dc:creator>
			<guid isPermaLink="false">121793@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi All,</p>
<p>I have an app in the store that uses Cocos2D and supports video out, but video out appears to be broken on Retinal Display devices running iOS 5.</p>
<p>The app is tappr.tv (v3), and was released back in March.  Video out was working on my iPhone 4 as well as an iPod 4th Gen under iOS 4.x.  When I updated to iOS 5 on each of these devices, video out stopped displaying.  I'm using a standard Apple component video out cable.</p>
<p>This is occurring both in the shipping version of the app, as well as a recent build of a new version.  I can confirm that the EAGLView itself is being added to the external UIScreen window because the window background is gray and the EAGLView clears to black.  Furthermore, when I capture an OpenGL ES Frame in XCode 4.2, I can see that the rendering is taking place.  Its just not being displayed on the external screen.</p>
<p>Also note that video out continues to work on both an iPad running iOS 4.x and an iPad 2 running iOS 5.  It seems to be limited to Retina Display iDevices.</p>
<p>I can confirm that other apps, such as Video from Apple, still display video out under IOS 5, so it must be related to my app somehow?</p>
<p>Here is the gist of my code handling video out, all fairly standard stuff…</p>
<pre><code>- (void)setupCocos2D
{
	[CCDirector setDirectorType:kCCDirectorTypeNSTimer];

	CCDirector	*director = [CCDirector sharedDirector];

	EAGLView	*glView = [EAGLView viewWithFrame:CGRectZero
                                   pixelFormat:kEAGLColorFormatRGBA8
                                   depthFormat:GL_DEPTH_COMPONENT16_OES
                            preserveBackbuffer:NO
                                    sharegroup:nil
                                 multiSampling:NO
                               numberOfSamples:0];
	glView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin &#124;
								UIViewAutoresizingFlexibleRightMargin &#124;
								UIViewAutoresizingFlexibleTopMargin &#124;
								UIViewAutoresizingFlexibleBottomMargin &#124;
								UIViewAutoresizingFlexibleWidth &#124;
								UIViewAutoresizingFlexibleHeight;
	[director setOpenGLView:glView];
	[director setDeviceOrientation:kCCDeviceOrientationPortrait];
        [director enableRetinaDisplay:YES];

	[CCTexture2D setDefaultAlphaPixelFormat:kCCTexture2DPixelFormat_RGBA8888];
}

- (void) startTVOut
{
        // is there more than one screen?
	NSArray* screens = [UIScreen screens];
	if ([screens count] &#60;= 1)
	{
		return;
	}

	UIScreen        *external = [[UIScreen screens] objectAtIndex: 1];
        CGSize          maxSize = CGSizeMake(0, 0);
	UIScreenMode    *maxScreenMode = nil;
	for(int i = 0; i &#60; [[external availableModes] count]; i++)
	{
		UIScreenMode *current = [[[[UIScreen screens] objectAtIndex:1] availableModes] objectAtIndex: i];
		if (current.size.width &#62; maxSize.width)
		{
			maxSize = current.size;
			maxScreenMode = current;
		}
	}
	external.currentMode = maxScreenMode;
        CGRect          aFrame = CGRectMake(0,0, maxScreenMode.size.width, maxScreenMode.size.height);

	tvoutWindow_ = [[UIWindow alloc] initWithFrame:aFrame];
	tvoutWindow_.userInteractionEnabled = NO;
	tvoutWindow_.screen = external;
	tvoutWindow_.hidden = NO;
	tvoutWindow_.backgroundColor = [UIColor darkGrayColor];

	EAGLView	*glView = [[CCDirector sharedDirector] openGLView];
	glView.frame = tvoutWindow_.bounds;
	[tvoutWindow_ addSubview:glView];

        tvoutWindow_.hidden = NO;
}</code></pre>
<p>Wondering if anyone else is seeing issues in their Cocos2D apps and video out?  Anyone have a Cocos2D app that supports video out that IS working on a Retina Display iDevice?</p>
<p>peace</p>
<p>deeje
</p></description>
		</item>
		<item>
			<title>julesv on "Filling 2D array."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/5136#post-30733</link>
			<pubDate>Thu, 18 Mar 2010 22:09:17 +0000</pubDate>
			<dc:creator>julesv</dc:creator>
			<guid isPermaLink="false">30733@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello! I'm implementing this (<a href="http://www.puzzle-light-up.com/" rel="nofollow">http://www.puzzle-light-up.com/</a>) game. I've started by making a 120x120 grid placed in centre of my screen. I also created a 2D array. My idea was to make seperate files with lots of puzzles. In the files there would be a notation like this:<br />
0=empty/unlit<br />
1 = lit<br />
2=filled in block with nothing in it<br />
3=filled in block with 1 in it etc.<br />
6 = has light bulb in it</p>
<p>Could you teach me a way to fill this 2D array with a seperate/external file. I was thinking of a loop which fills board[x][y]. Also, if you have any tips on how to represent the array visually after it's loaded please tell me.</p>
<p>Thank you :D
</p></description>
		</item>

	</channel>
</rss>

