<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>VPU/GPU video in a texture</title>
		<link>http://www.allegro.cc/forums/view/616967</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 12 Jul 2017 03:05:27 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hi,</p><p>I&#39;m currently messing around with (rpi) OPENGLES and Allegro 5 in order to display video.</p><p>Problem I have (not really a problem but would be a &#39;nice to have&#39;) is that I have an OPENGL texture id for the video buffer that is filled by the VPU and I can display it directly using OPENGL glDrawArrays() call and it&#39;s working ok.</p><p>However, what would be nice is to create an ALLEGRO_BITMAP linked to the existing OPENGL texture id for the buffer (already created using eglCreateImageKHR()).</p><p>Is there any simple way to create an ALLEGRO_BITMAP directly linked to an existing texture?<br />I know I could create an ALLEGRO_BITMAP and then copy one to the other but I would like a more optimal setup..</p><p>Kev
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kev Callahan)</author>
		<pubDate>Wed, 05 Jul 2017 20:39:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It&#39;s not possible to do it this way directly, I think. <br />However, you could do it the other way round: Just create an Allegro bitmap at the start and use its texture id to render into. <br />You can retrieve its texture id via <a href="http://liballeg.org/a5docs/trunk/opengl.html#al_get_opengl_texture">al_get_opengl_texture</a>. Also see the functions below that.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Polybios)</author>
		<pubDate>Wed, 05 Jul 2017 21:34:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Unfortunately I think I need to use eglCreateImageKHR() directly to create the texture available to the VPU, other methods I tried failed (ie using al_create_bitmap( )and using al_get_opengl_texture()).</p><p>I could very well be wrong though and if anyone has any insight I&#39;m keen to listen if they&#39;ve had success in this area.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kev Callahan)</author>
		<pubDate>Wed, 05 Jul 2017 21:37:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ok, I see how much I don&#39;t know. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /><br />From reading a bit it seems that this stuff uses its own OpenGL texture target GL_TEXTURE_EXTERNAL_OES, so I&#39;d say it&#39;s not really compatible. However, I don&#39;t really know.<br />You could probably use FBOs for copying, though.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Polybios)</author>
		<pubDate>Wed, 05 Jul 2017 23:46:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><img src="http://www.allegro.cc/forums/smileys/cheesy.gif" alt=";D" border="0" />,.. Thanks <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /><br />I&#39;ll look into how quickly I can copy from one to another but think it&#39;s not optimal.<br />Maybe I&#39;ll do what I&#39;ve done elsewhere and try to combine my allegro 5 2d stuff with the opengl 3d stuff is there&#39;s not any other way...</p><p>EDIT:<br />Out of interest I tried adding<br />al_set_opengl_texture(ALLEGRO_BITMAP *, GLuint)<br />to my Allegro build (ogl_bitmap.c)</p><p>It sort of works although the texture is upside down and starts halfway through..<br />So more work/investigation required..</p><p>The ALLEGRO_BITMAP size is 1920x1080 but the OPENGL bitmap is (obviously) rounded up to 2048x2048, so maybe I have to work around that...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kev Callahan)</author>
		<pubDate>Tue, 11 Jul 2017 20:55:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That&#39;s cool. Interested to see your progress. <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Wed, 12 Jul 2017 01:38:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>once I get things going properly I&#39;ll share it all as per usual <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kev Callahan)</author>
		<pubDate>Wed, 12 Jul 2017 03:05:27 +0000</pubDate>
	</item>
</rss>
