<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Accessing contents of ALLEGRO_VERTEX_BUFFER</title>
		<link>http://www.allegro.cc/forums/view/617962</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sun, 20 Oct 2019 00:12:33 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hey,</p><p>So after I create a vertex buffer with al_create_vertex_buffer(), assuming I&#39;ve locked the buffer first, can I just access the verts in the buffer as if it was just an array of ALLEGRO_VERTEXs?</p><p><b>EDIT #1:</b><br />Thinking about it, since al_lock_vertex_buffer() would return void*, I would have to cast that to ALLEGRO_VERTEX*... Can this be safely done?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (BitCruncher)</author>
		<pubDate>Fri, 18 Oct 2019 21:57:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I would think so (on both accounts), if you look at the example <a href="https://github.com/liballeg/allegro5/blob/master/examples/ex_vertex_buffer.c">https://github.com/liballeg/allegro5/blob/master/examples/ex_vertex_buffer.c</a><br />, line 55 does access the VBO memory and copies from ALLEGRO_VERTEX *vertices to it. The copy itself is done using standard memcpy function (as opposed to using some low level graphics driver call) so I think it is safe to assume that poking the VBO memory directly by addressing it using ALLEGRO_VERTEX pointer will work just fine too.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (MikiZX)</author>
		<pubDate>Sat, 19 Oct 2019 11:43:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yep, casting the return value of <span class="source-code">al_lock_vertex_buffer</span> is correct.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Sat, 19 Oct 2019 19:17:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks, guys.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (BitCruncher)</author>
		<pubDate>Sun, 20 Oct 2019 00:12:33 +0000</pubDate>
	</item>
</rss>
