openmv/drivers/dave2d/docs/files/code/dave_rbuffer-c.html
iabdalkader daf2bb30da misc: Restructure repo.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-04-13 08:28:34 +02:00

92 lines
64 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Render Buffers</title><link rel="stylesheet" type="text/css" href="../../styles/main.css"><script language=JavaScript src="../../javascript/main.js"></script><script language=JavaScript src="../../javascript/prettify.js"></script><script language=JavaScript src="../../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad();prettyPrint();"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>
<!-- Generated by Natural Docs, version 1.52 -->
<!-- http://www.naturaldocs.org -->
<!-- saved from url=(0026)http://www.naturaldocs.org -->
<div id=Content><div class="CSection"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="Render_Buffers"></a>Render Buffers</h1><div class=CBody><p>Renderbuffers (similar in concept to OpenGL display lists) are the main interface between driver and hardware.</p><p>Issuing rendering commands to the D/AVE driver does not directly trigger a hardware activity but adds a set of commands to the currently <u>selected</u> Renderbuffer (see: <a href="#d2_selectrenderbuffer" class=LFunction id=link12 onMouseOver="ShowTip(event, 'tt3', 'link12')" onMouseOut="HideTip('tt3')">d2_selectrenderbuffer</a>).</p><p>This buffer can be executed directly by the hardware.&nbsp; For best performance and maximum parallelism there should always be one renderbuffer executing while another one is being filled (double-buffered render buffers).</p><p>The application can manage this on its own by using <a href="#d2_selectrenderbuffer" class=LFunction id=link13 onMouseOver="ShowTip(event, 'tt3', 'link13')" onMouseOut="HideTip('tt3')">d2_selectrenderbuffer</a> and <a href="#d2_executerenderbuffer" class=LFunction id=link14 onMouseOver="ShowTip(event, 'tt4', 'link14')" onMouseOut="HideTip('tt4')">d2_executerenderbuffer</a> or make use of the utility functions and internal buffers (see: <a href="#d2_startframe" class=LFunction id=link15 onMouseOver="ShowTip(event, 'tt6', 'link15')" onMouseOut="HideTip('tt6')">d2_startframe</a> and <a href="#d2_endframe" class=LFunction id=link16 onMouseOver="ShowTip(event, 'tt7', 'link16')" onMouseOut="HideTip('tt7')">d2_endframe</a>).</p><h4 class=CHeading>startframe / endframe</h4><p>The recommended method using double-buffered render buffers is to use <a href="#d2_startframe" class=LFunction id=link17 onMouseOver="ShowTip(event, 'tt6', 'link17')" onMouseOut="HideTip('tt6')">d2_startframe</a> and <a href="#d2_endframe" class=LFunction id=link18 onMouseOver="ShowTip(event, 'tt7', 'link18')" onMouseOut="HideTip('tt7')">d2_endframe</a>.&nbsp; These functions use two internal render buffers in turn.&nbsp; The internal render buffers can be accessed by <a href="#d2_getrenderbuffer" class=LFunction id=link19 onMouseOver="ShowTip(event, 'tt5', 'link19')" onMouseOut="HideTip('tt5')">d2_getrenderbuffer</a>.</p><blockquote><pre class="prettyprint">d2_startframe(handle); // --&gt; start HW rendering of the previous frame (buffer a), switch to buffer b for all following render commands
// ... now issue new render commands to buffer b while HW is rendering the previous frame from render buffer a ...
d2_endframe(handle); // --&gt; close render buffer b which has just captured all render commands, wait for HW to finish rendering of buffer a
// may now propagate the rendered frame (from buffer a) to the display controller</pre></blockquote><h4 class=CHeading>selectrenderbuffer / executerenderbuffer / flushframe</h4><p>Render buffers can also be managed by the application.&nbsp; Use <a href="#d2_newrenderbuffer" class=LFunction id=link20 onMouseOver="ShowTip(event, 'tt1', 'link20')" onMouseOut="HideTip('tt1')">d2_newrenderbuffer</a> to allocate a new render buffer.&nbsp; To issue render commands a render buffer must be selected by <a href="#d2_selectrenderbuffer" class=LFunction id=link21 onMouseOver="ShowTip(event, 'tt3', 'link21')" onMouseOut="HideTip('tt3')">d2_selectrenderbuffer</a>.&nbsp; A render buffer can then be executed by <a href="#d2_executerenderbuffer" class=LFunction id=link22 onMouseOver="ShowTip(event, 'tt4', 'link22')" onMouseOut="HideTip('tt4')">d2_executerenderbuffer</a>.&nbsp; Before <a href="#d2_executerenderbuffer" class=LFunction id=link23 onMouseOver="ShowTip(event, 'tt4', 'link23')" onMouseOut="HideTip('tt4')">d2_executerenderbuffer</a> can be called again the application has to wait for Dave to be finished by <a href="dave_driver-c.html#d2_flushframe" class=LFunction id=link24 onMouseOver="ShowTip(event, 'tt12', 'link24')" onMouseOut="HideTip('tt12')">d2_flushframe</a>.</p><blockquote><pre class="prettyprint">d2_selectrenderbuffer(handle, buffer);
// issue render commands
d2_executerenderbuffer(handle, buffer);
d2_flushframe(handle);
// propagate the rendered frame to the display controller</pre></blockquote><h4 class=CHeading>Using a single render buffer</h4><p>Please note that when using just a single render buffer (no double-buffering) the allocated buffer can not be freed as long as it is selected because the buffer will be linked for internal usage.&nbsp; This means that another call of <a href="#d2_selectrenderbuffer" class=LFunction id=link25 onMouseOver="ShowTip(event, 'tt3', 'link25')" onMouseOut="HideTip('tt3')">d2_selectrenderbuffer</a> must be issued with a second buffer to de-select the previous buffer to avoid memory leaks.</p><blockquote><pre class="prettyprint">buffer = d2_newrenderbuffer(handle, 25, 25);
d2_selectrenderbuffer(handle, buffer);
d2_executerenderbuffer(handle, buffer, d2_ef_default);
d2_flushframe(handle);
...
// select a different buffer before freeing
d2_selectrenderbuffer(handle, newbuffer);
d2_freerenderbuffer(handle, buffer);</pre></blockquote><p>If no second render buffer is available and only a single render buffer should be used the following two commands have to be called before creating any render buffer.&nbsp; This will prevent internal buffer linkage!</p><blockquote><pre class="prettyprint">// close internal render buffer 0
d2_executerenderbuffer(locD2DHandle,d2_getrenderbuffer(locD2DHandle, 0), 0);
// close internal render buffer 1
d2_executerenderbuffer(locD2DHandle,d2_getrenderbuffer(locD2DHandle, 1), 0);
...
buffer = d2_newrenderbuffer(handle, 25, 25);
d2_selectrenderbuffer(handle, buffer);
d2_executerenderbuffer(handle, buffer, d2_ef_default);
d2_flushframe(handle);
d2_freerenderbuffer(handle, buffer); // free a selected buffer</pre></blockquote><p>However, it is recommended to use at least two render buffers, e.g.&nbsp; <a href="#d2_startframe" class=LFunction id=link26 onMouseOver="ShowTip(event, 'tt6', 'link26')" onMouseOut="HideTip('tt6')">d2_startframe</a> and <a href="#d2_endframe" class=LFunction id=link27 onMouseOver="ShowTip(event, 'tt7', 'link27')" onMouseOut="HideTip('tt7')">d2_endframe</a>.</p><h4 class=CHeading>executedlist</h4><p>Instead of <a href="#d2_executerenderbuffer" class=LFunction id=link28 onMouseOver="ShowTip(event, 'tt4', 'link28')" onMouseOut="HideTip('tt4')">d2_executerenderbuffer</a> a given Dlist can be executed directly by <a href="dave_dlist-c.html#d2_executedlist" class=LFunction id=link29 onMouseOver="ShowTip(event, 'tt13', 'link29')" onMouseOut="HideTip('tt13')">d2_executedlist</a>.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#Render_Buffers" >Render Buffers</a></td><td class=SDescription>Renderbuffers (similar in concept to OpenGL display lists) are the main interface between driver and hardware.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Renderbuffer_Management" >Renderbuffer Management</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#d2_newrenderbuffer" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">d2_newrenderbuffer</a></td><td class=SDescription>Create a new renderbuffer.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#d2_freerenderbuffer" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">d2_freerenderbuffer</a></td><td class=SDescription>Destroy and free a renderbuffer.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#d2_selectrenderbuffer" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">d2_selectrenderbuffer</a></td><td class=SDescription>Choose a renderbuffer for writing. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#d2_executerenderbuffer" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">d2_executerenderbuffer</a></td><td class=SDescription>Render the content of a renderbuffer.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#d2_getrenderbuffer" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">d2_getrenderbuffer</a></td><td class=SDescription>Return internal renderbuffers.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Utility_Functions" >Utility Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#d2_startframe" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">d2_startframe</a></td><td class=SDescription>Mark the begin of a scene.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#d2_endframe" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">d2_endframe</a></td><td class=SDescription>Mark the end of a scene.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#d2_relocateframe" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">d2_relocateframe</a></td><td class=SDescription>Change framebuffer for render commands already issued.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#d2_dumprenderbuffer" id=link9 onMouseOver="ShowTip(event, 'tt9', 'link9')" onMouseOut="HideTip('tt9')">d2_dumprenderbuffer</a></td><td class=SDescription>Copy the content of a renderbuffer into user memory.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#d2_getrenderbuffersize" id=link10 onMouseOver="ShowTip(event, 'tt10', 'link10')" onMouseOut="HideTip('tt10')">d2_getrenderbuffersize</a></td><td class=SDescription>Query the number of allocated display list entries. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#d2_freedumpedbuffer" id=link11 onMouseOver="ShowTip(event, 'tt11', 'link11')" onMouseOut="HideTip('tt11')">d2_freedumpedbuffer</a></td><td class=SDescription>free a chunk of memory returned from d2_dumprenderbuffer.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Renderbuffer_Management"></a>Renderbuffer Management</h3></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="d2_newrenderbuffer"></a>d2_newrenderbuffer</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_renderbuffer * d2_newrenderbuffer(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_u32&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap></td><td class="PParameter prettyprint " nowrap>initialsize,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_u32&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap></td><td class="PParameter prettyprint " nowrap>stepsize</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Create a new renderbuffer.</p><p>Renderbuffers are filled by the driver but read (executed) directly by the Dave hardware.&nbsp; Buffers grow on demand but only shrink slowly: If a page was not used for 60 calls of <a href="#d2_executerenderbuffer" class=LFunction id=link30 onMouseOver="ShowTip(event, 'tt4', 'link30')" onMouseOut="HideTip('tt4')">d2_executerenderbuffer</a>, the page is freed one at a time: The next page will not be freed before 60 further calls have elapsed.</p><p>A single displaylist entry requires 20bytes of memory, choosing large page sizes is potential waste of memory while too many small pages can degrade the performance of both reading and writing to the buffer.</p><p>By using <a href="#d2_getrenderbuffersize" class=LFunction id=link31 onMouseOver="ShowTip(event, 'tt10', 'link31')" onMouseOut="HideTip('tt10')">d2_getrenderbuffersize</a>, it is possible to query the number of used entries for a given application.&nbsp; This can be used to optimize the page size.</p><p>The number of used pages of the renderbuffer currently used as writebuffer can be queried using <a href="dave_driver-c.html#d2_getdlistblockcount" class=LFunction id=link32 onMouseOver="ShowTip(event, 'tt14', 'link32')" onMouseOut="HideTip('tt14')">d2_getdlistblockcount</a>.</p><h4 class=CHeading>parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>handle</td><td class=CDLDescription>device pointer (see: <a href="dave_driver-c.html#d2_opendevice" class=LFunction id=link33 onMouseOver="ShowTip(event, 'tt15', 'link33')" onMouseOut="HideTip('tt15')">d2_opendevice</a>)</td></tr><tr><td class=CDLEntry>initialsize</td><td class=CDLDescription>number of displaylist entries in the first page (minimum is 3)</td></tr><tr><td class=CDLEntry>stepsize</td><td class=CDLDescription>number of displaylist entries in following pages (minimum is 3)</td></tr></table><h4 class=CHeading>returns</h4><p>pointer to internal renderbuffer (or NULL if failed)</p><h4 class=CHeading>see also</h4><p><a href="#d2_getrenderbuffer" class=LFunction id=link34 onMouseOver="ShowTip(event, 'tt5', 'link34')" onMouseOut="HideTip('tt5')">d2_getrenderbuffer</a>, <a href="dave_driver-c.html#d2_setdlistblocksize" class=LFunction id=link35 onMouseOver="ShowTip(event, 'tt16', 'link35')" onMouseOut="HideTip('tt16')">d2_setdlistblocksize</a>, <a href="#d2_freerenderbuffer" class=LFunction id=link36 onMouseOver="ShowTip(event, 'tt2', 'link36')" onMouseOut="HideTip('tt2')">d2_freerenderbuffer</a></p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="d2_freerenderbuffer"></a>d2_freerenderbuffer</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_s32 d2_freerenderbuffer(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_renderbuffer&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>buffer</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Destroy and free a renderbuffer.</p><p>You can only free buffers that were created by <a href="#d2_newrenderbuffer" class=LFunction id=link37 onMouseOver="ShowTip(event, 'tt1', 'link37')" onMouseOut="HideTip('tt1')">d2_newrenderbuffer</a> and are not currently executed.&nbsp; To make sure execution has finished the application can call <a href="dave_driver-c.html#d2_flushframe" class=LFunction id=link38 onMouseOver="ShowTip(event, 'tt12', 'link38')" onMouseOut="HideTip('tt12')">d2_flushframe</a>.</p><h4 class=CHeading>note</h4><p>Please note that when using just a single render buffer (no double buffering) the allocated buffer can not be freed as long as it is selected (see above for more details).</p><h4 class=CHeading>parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>handle</td><td class=CDLDescription>device pointer (see: <a href="dave_driver-c.html#d2_opendevice" class=LFunction id=link39 onMouseOver="ShowTip(event, 'tt15', 'link39')" onMouseOut="HideTip('tt15')">d2_opendevice</a>)</td></tr><tr><td class=CDLEntry>buffer</td><td class=CDLDescription>renderbuffer address</td></tr></table><h4 class=CHeading>returns</h4><p>errorcode (D2_OK if successfull) see list of <a href="../inc/dave_errorcodes-h.html#Errorcodes" class=LSection id=link40 onMouseOver="ShowTip(event, 'tt17', 'link40')" onMouseOut="HideTip('tt17')">Errorcodes</a> for details</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="d2_selectrenderbuffer"></a>d2_selectrenderbuffer</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_s32 d2_selectrenderbuffer(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_renderbuffer&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>buffer</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Choose a renderbuffer for writing.&nbsp; Selecting a buffer that is currently executed will cause rendering failures.</p><p>The previously selected renderbuffer is flushed.&nbsp; All subsequent <a href="dave_render-c.html#Rendering_Functions" class=LSection id=link41 onMouseOver="ShowTip(event, 'tt18', 'link41')" onMouseOut="HideTip('tt18')">Rendering Functions</a> write to the specified renderbuffer.&nbsp; The buffer is finalized when <a href="#d2_executerenderbuffer" class=LFunction id=link42 onMouseOver="ShowTip(event, 'tt4', 'link42')" onMouseOut="HideTip('tt4')">d2_executerenderbuffer</a> is called.&nbsp; The render buffer is reset for writing a new list after selection.</p><p>For the usage of render buffers see <a href="#Render_Buffers" class=LSection id=link43 onMouseOver="ShowTip(event, 'tt19', 'link43')" onMouseOut="HideTip('tt19')">Render Buffers</a>.</p><p>If buffer is 0 then the internal renderbuffer for writing will be selected, thus <a href="#d2_startframe" class=LFunction id=link44 onMouseOver="ShowTip(event, 'tt6', 'link44')" onMouseOut="HideTip('tt6')">d2_startframe</a>/<a href="#d2_endframe" class=LFunction id=link45 onMouseOver="ShowTip(event, 'tt7', 'link45')" onMouseOut="HideTip('tt7')">d2_endframe</a> can be continued to use (see also <a href="#d2_getrenderbuffer" class=LFunction id=link46 onMouseOver="ShowTip(event, 'tt5', 'link46')" onMouseOut="HideTip('tt5')">d2_getrenderbuffer</a>).</p><h4 class=CHeading>parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>handle</td><td class=CDLDescription>device pointer (see: <a href="dave_driver-c.html#d2_opendevice" class=LFunction id=link47 onMouseOver="ShowTip(event, 'tt15', 'link47')" onMouseOut="HideTip('tt15')">d2_opendevice</a>)</td></tr><tr><td class=CDLEntry>buffer</td><td class=CDLDescription>renderbuffer address or 0</td></tr></table><h4 class=CHeading>returns</h4><p>errorcode (D2_OK if successful) see list of <a href="../inc/dave_errorcodes-h.html#Errorcodes" class=LSection id=link48 onMouseOver="ShowTip(event, 'tt17', 'link48')" onMouseOut="HideTip('tt17')">Errorcodes</a> for details</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="d2_executerenderbuffer"></a>d2_executerenderbuffer</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_s32 d2_executerenderbuffer(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_renderbuffer&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>buffer,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_u32&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap></td><td class="PParameter prettyprint " nowrap>flags</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Render the content of a renderbuffer.</p><p>For the usage of render buffers see <a href="#Render_Buffers" class=LSection id=link49 onMouseOver="ShowTip(event, 'tt19', 'link49')" onMouseOut="HideTip('tt19')">Render Buffers</a>.</p><p>Before rendering is started, the renderbuffer is prepared for execution.&nbsp; This involves flushing of scratch buffers, possibly merge of layers in certain render modes (see <a href="dave_driver-c.html#d2_selectrendermode" class=LFunction id=link50 onMouseOver="ShowTip(event, 'tt20', 'link50')" onMouseOut="HideTip('tt20')">d2_selectrendermode</a>) and potentially copying the display list to a dedicated video memory or at least flushing of the CPU data caches.&nbsp; The buffer passed to d2_executerenderbuffer can be used for execution again by calling d2_executerenderbuffer again with the same buffer as argument.&nbsp; But before new render commands can be written to the buffer it must be selected by <a href="#d2_selectrenderbuffer" class=LFunction id=link51 onMouseOver="ShowTip(event, 'tt3', 'link51')" onMouseOut="HideTip('tt3')">d2_selectrenderbuffer</a>.</p><p>Note that before calling d2_executerenderbuffer, it must be made sure that no render buffer is currently executed on the hardware.&nbsp; This can be done by either waiting for the respective interrupt or by calling <a href="dave_driver-c.html#d2_flushframe" class=LFunction id=link52 onMouseOver="ShowTip(event, 'tt12', 'link52')" onMouseOut="HideTip('tt12')">d2_flushframe</a>.</p><p>Note that even when <a href="dave_driver-c.html#d2_flushframe" class=LFunction id=link53 onMouseOver="ShowTip(event, 'tt12', 'link53')" onMouseOut="HideTip('tt12')">d2_flushframe</a> is issued to wait for the rendering of the buffer to finish the buffer still has to be reselected (using <a href="#d2_selectrenderbuffer" class=LFunction id=link54 onMouseOver="ShowTip(event, 'tt3', 'link54')" onMouseOut="HideTip('tt3')">d2_selectrenderbuffer</a>) in order to use it again for rendering.</p><p>Note that calling this function from inside an interrupt service routine is not recommended, as the execution time can not be foreseen.&nbsp; If it is called from inside the D/AVE &lsquo;display list finished&rsquo; ISR anyway, it needs to be made sure that clearing the IRQ happens before the call to d2_executerenderbuffer!&nbsp; Register writes to the D/AVE core are not allowed while a display list is being executed.</p><p>Note that if d2_ef_execute_once is used a new render buffer must be selected by <a href="#d2_selectrenderbuffer" class=LFunction id=link55 onMouseOver="ShowTip(event, 'tt3', 'link55')" onMouseOut="HideTip('tt3')">d2_selectrenderbuffer</a> even if it is the same render buffer.</p><h4 class=CHeading>parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>handle</td><td class=CDLDescription>device pointer (see: <a href="dave_driver-c.html#d2_opendevice" class=LFunction id=link56 onMouseOver="ShowTip(event, 'tt15', 'link56')" onMouseOut="HideTip('tt15')">d2_opendevice</a>)</td></tr><tr><td class=CDLEntry>buffer</td><td class=CDLDescription>renderbuffer address</td></tr><tr><td class=CDLEntry>flags</td><td class=CDLDescription>(not used)</td></tr></table><h4 class=CHeading>returns</h4><p>errorcode (D2_OK if successful) see list of <a href="../inc/dave_errorcodes-h.html#Errorcodes" class=LSection id=link57 onMouseOver="ShowTip(event, 'tt17', 'link57')" onMouseOut="HideTip('tt17')">Errorcodes</a> for details</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="d2_getrenderbuffer"></a>d2_getrenderbuffer</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_renderbuffer * d2_getrenderbuffer(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_s32&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap></td><td class="PParameter prettyprint " nowrap>index</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Return internal renderbuffers.</p><p>Two renderbuffers are allocated automatically for every device.&nbsp; These cannot be freed manually (destruction is automatic) but can be used for rendering.</p><p>Note that if internal buffers are used the utility functions <a href="#d2_startframe" class=LFunction id=link58 onMouseOver="ShowTip(event, 'tt6', 'link58')" onMouseOut="HideTip('tt6')">d2_startframe</a> and <a href="#d2_endframe" class=LFunction id=link59 onMouseOver="ShowTip(event, 'tt7', 'link59')" onMouseOut="HideTip('tt7')">d2_endframe</a> might not work as expected anymore.&nbsp; These functions use both internal buffers for &lsquo;double buffering&rsquo; and rely on using <a href="#d2_selectrenderbuffer" class=LFunction id=link60 onMouseOver="ShowTip(event, 'tt3', 'link60')" onMouseOut="HideTip('tt3')">d2_selectrenderbuffer</a> exclusively.</p><h4 class=CHeading>parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>handle</td><td class=CDLDescription>device pointer (see: <a href="dave_driver-c.html#d2_opendevice" class=LFunction id=link61 onMouseOver="ShowTip(event, 'tt15', 'link61')" onMouseOut="HideTip('tt15')">d2_opendevice</a>)</td></tr><tr><td class=CDLEntry>index</td><td class=CDLDescription>renderbuffer index (only 0 and 1 are valid indices)</td></tr></table><h4 class=CHeading>returns</h4><p>pointer to internal renderbuffer (or NULL if failed)</p></div></div></div>
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Utility_Functions"></a>Utility Functions</h3></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="d2_startframe"></a>d2_startframe</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_s32 d2_startframe(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Mark the begin of a scene.</p><p>Use this function (together with <a href="#d2_endframe" class=LFunction id=link62 onMouseOver="ShowTip(event, 'tt7', 'link62')" onMouseOut="HideTip('tt7')">d2_endframe</a>) to let the driver handle render buffer execution and flipping automatically.</p><p>When startframe is called the render buffer that was filled during the last frame (between previous <a href="#d2_startframe" class=LFunction id=link63 onMouseOver="ShowTip(event, 'tt6', 'link63')" onMouseOut="HideTip('tt6')">d2_startframe</a>/<a href="#d2_endframe" class=LFunction id=link64 onMouseOver="ShowTip(event, 'tt7', 'link64')" onMouseOut="HideTip('tt7')">d2_endframe</a>) is executed on the HW.&nbsp; New render commands that are sent after this &lsquo;startframe&rsquo; are put into the other render buffer.</p><p>For the usage of render buffers see <a href="#Render_Buffers" class=LSection id=link65 onMouseOver="ShowTip(event, 'tt19', 'link65')" onMouseOut="HideTip('tt19')">Render Buffers</a>.</p><h4 class=CHeading>parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>handle</td><td class=CDLDescription>device pointer (see: <a href="dave_driver-c.html#d2_opendevice" class=LFunction id=link66 onMouseOver="ShowTip(event, 'tt15', 'link66')" onMouseOut="HideTip('tt15')">d2_opendevice</a>)</td></tr></table><h4 class=CHeading>returns</h4><p>errorcode (D2_OK if successfull) see list of <a href="../inc/dave_errorcodes-h.html#Errorcodes" class=LSection id=link67 onMouseOver="ShowTip(event, 'tt17', 'link67')" onMouseOut="HideTip('tt17')">Errorcodes</a> for details</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="d2_endframe"></a>d2_endframe</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_s32 d2_endframe(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Mark the end of a scene.</p><p>Use this function (together with <a href="#d2_startframe" class=LFunction id=link68 onMouseOver="ShowTip(event, 'tt6', 'link68')" onMouseOut="HideTip('tt6')">d2_startframe</a>) to let the driver handle render buffer execution and flipping automatically.</p><p>Endframe makes sure the previous frame (the one started on the HW by the last call of <a href="#d2_startframe" class=LFunction id=link69 onMouseOver="ShowTip(event, 'tt6', 'link69')" onMouseOut="HideTip('tt6')">d2_startframe</a>) has been rendered completely.&nbsp; A wait for the HW is done if necessary.&nbsp; The render buffer just filled with render commands (since the last <a href="#d2_startframe" class=LFunction id=link70 onMouseOver="ShowTip(event, 'tt6', 'link70')" onMouseOut="HideTip('tt6')">d2_startframe</a>) is logically closed.</p><p>For the usage of render buffers see <a href="#Render_Buffers" class=LSection id=link71 onMouseOver="ShowTip(event, 'tt19', 'link71')" onMouseOut="HideTip('tt19')">Render Buffers</a>.</p><h4 class=CHeading>parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>handle</td><td class=CDLDescription>device pointer (see: <a href="dave_driver-c.html#d2_opendevice" class=LFunction id=link72 onMouseOver="ShowTip(event, 'tt15', 'link72')" onMouseOut="HideTip('tt15')">d2_opendevice</a>)</td></tr></table><h4 class=CHeading>returns</h4><p>errorcode (D2_OK if successfull) see list of <a href="../inc/dave_errorcodes-h.html#Errorcodes" class=LSection id=link73 onMouseOver="ShowTip(event, 'tt17', 'link73')" onMouseOut="HideTip('tt17')">Errorcodes</a> for details</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="d2_relocateframe"></a>d2_relocateframe</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>extern d2_s32 d2_relocateframe(</td><td class="PTypePrefix prettyprint " nowrap></td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle,</td></tr><tr><td></td><td class="PTypePrefix prettyprint " nowrap>const&nbsp;</td><td class="PType prettyprint " nowrap>void&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>ptr</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Change framebuffer for render commands already issued.</p><p>This function can be used to change the target framebuffer of all d2 render commands that have been issued since the last <a href="#d2_startframe" class=LFunction id=link74 onMouseOver="ShowTip(event, 'tt6', 'link74')" onMouseOut="HideTip('tt6')">d2_startframe</a>.</p><p>It does only work if framebuffer format and size stay the same and only a single framebuffer has been set used <a href="dave_viewport-c.html#d2_framebuffer" class=LFunction id=link75 onMouseOver="ShowTip(event, 'tt21', 'link75')" onMouseOut="HideTip('tt21')">d2_framebuffer</a> since the frame has been started.&nbsp; The current framebuffer is <u>not</u> changed, this would require a call to <a href="dave_viewport-c.html#d2_framebuffer" class=LFunction id=link76 onMouseOver="ShowTip(event, 'tt21', 'link76')" onMouseOut="HideTip('tt21')">d2_framebuffer</a> afterwards.</p><h4 class=CHeading>parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>handle</td><td class=CDLDescription>device pointer (see: <a href="dave_driver-c.html#d2_opendevice" class=LFunction id=link77 onMouseOver="ShowTip(event, 'tt15', 'link77')" onMouseOut="HideTip('tt15')">d2_opendevice</a>)</td></tr><tr><td class=CDLEntry>ptr</td><td class=CDLDescription>new address of the top left pixel (coordinate 0,0)</td></tr></table><h4 class=CHeading>returns</h4><p>errorcode (D2_OK if successfull) see list of <a href="../inc/dave_errorcodes-h.html#Errorcodes" class=LSection id=link78 onMouseOver="ShowTip(event, 'tt17', 'link78')" onMouseOut="HideTip('tt17')">Errorcodes</a> for details</p><h4 class=CHeading>note</h4><p>Intention of this function is to support an immediate flush to a hidden framebuffer when the frame currently assembled was initially prepared for the currently displayed framebuffer.&nbsp; Use <a href="dave_driver-c.html#d2_layermerge" class=LFunction id=link79 onMouseOver="ShowTip(event, 'tt22', 'link79')" onMouseOut="HideTip('tt22')">d2_layermerge</a> to take care about outline and solid parts.</p><p>This function can only be used when double word clearing is disabled (see: <a href="dave_driver-c.html#d2_opendevice" class=LFunction id=link80 onMouseOver="ShowTip(event, 'tt15', 'link80')" onMouseOut="HideTip('tt15')">d2_opendevice</a>) and &lsquo;low localmem&rsquo; mode is not enabled (see: <a href="dave_driver-c.html#d2_lowlocalmemmode" class=LFunction id=link81 onMouseOver="ShowTip(event, 'tt23', 'link81')" onMouseOut="HideTip('tt23')">d2_lowlocalmemmode</a>)!</p><h4 class=CHeading>note</h4><p>If <a href="dave_dlist-c.html#d2_adddlist" class=LFunction id=link82 onMouseOver="ShowTip(event, 'tt24', 'link82')" onMouseOut="HideTip('tt24')">d2_adddlist</a> (d2_al_no_copy) commands have been used these added dlists are not changed.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="d2_dumprenderbuffer"></a>d2_dumprenderbuffer</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_s32 d2_dumprenderbuffer(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_renderbuffer&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>buffer,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>void&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>**</td><td class="PParameter prettyprint " nowrap>rdata,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_s32&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>rsize</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Copy the content of a renderbuffer into user memory.</p><p>The entire renderbuffer is stored as one flat dave displaylist in memory.&nbsp; Writes to the displaylist control register (display list jumps) are removed and replaced by the code following at the new address - this way the dumped list can be relocated in memory.</p><p>Note that the application has to free the memory allocated for a dumped list using <a href="#d2_freedumpedbuffer" class=LFunction id=link83 onMouseOver="ShowTip(event, 'tt11', 'link83')" onMouseOut="HideTip('tt11')">d2_freedumpedbuffer</a>.</p><p>This function can only be used when double word clearing is disabled (see: <a href="dave_driver-c.html#d2_opendevice" class=LFunction id=link84 onMouseOver="ShowTip(event, 'tt15', 'link84')" onMouseOut="HideTip('tt15')">d2_opendevice</a>) and &lsquo;low localmem&rsquo; mode is not enabled (see: <a href="dave_driver-c.html#d2_lowlocalmemmode" class=LFunction id=link85 onMouseOver="ShowTip(event, 'tt23', 'link85')" onMouseOut="HideTip('tt23')">d2_lowlocalmemmode</a>).</p><h4 class=CHeading>note</h4><p>Use <a href="dave_driver-c.html#d2_layermerge" class=LFunction id=link86 onMouseOver="ShowTip(event, 'tt22', 'link86')" onMouseOut="HideTip('tt22')">d2_layermerge</a> to take care about outline and solid parts.</p><h4 class=CHeading>note</h4><p>d2_dumprenderbuffer does not work correctly if <a href="dave_dlist-c.html#d2_adddlist" class=LFunction id=link87 onMouseOver="ShowTip(event, 'tt24', 'link87')" onMouseOut="HideTip('tt24')">d2_adddlist</a> (d2_al_no_copy) commands have been used.&nbsp; Use <a href="dave_dlist-c.html#d2_adddlist" class=LFunction id=link88 onMouseOver="ShowTip(event, 'tt24', 'link88')" onMouseOut="HideTip('tt24')">d2_adddlist</a> (d2_al_copy) instead if you want to get dlists with the desired content.</p><h4 class=CHeading>parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>handle</td><td class=CDLDescription>device pointer (see: <a href="dave_driver-c.html#d2_opendevice" class=LFunction id=link89 onMouseOver="ShowTip(event, 'tt15', 'link89')" onMouseOut="HideTip('tt15')">d2_opendevice</a>)</td></tr><tr><td class=CDLEntry>buffer</td><td class=CDLDescription>renderbuffer address</td></tr><tr><td class=CDLEntry>rdata</td><td class=CDLDescription>pointer to memory (filled by function)</td></tr><tr><td class=CDLEntry>rsize</td><td class=CDLDescription>size of memory in bytes (filled by function)</td></tr></table><h4 class=CHeading>returns</h4><p>errorcode (D2_OK if successful) see list of <a href="../inc/dave_errorcodes-h.html#Errorcodes" class=LSection id=link90 onMouseOver="ShowTip(event, 'tt17', 'link90')" onMouseOut="HideTip('tt17')">Errorcodes</a> for details</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="d2_getrenderbuffersize"></a>d2_getrenderbuffersize</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_u32 d2_getrenderbuffersize(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_renderbuffer&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>rb</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Query the number of allocated display list entries.&nbsp; Each display list entry is based on one address word and 4 data words (20 bytes).&nbsp; This function can be used to profile an application and optimize the page sizes set via <a href="dave_driver-c.html#d2_setdlistblocksize" class=LFunction id=link91 onMouseOver="ShowTip(event, 'tt16', 'link91')" onMouseOut="HideTip('tt16')">d2_setdlistblocksize</a> or <a href="#d2_newrenderbuffer" class=LFunction id=link92 onMouseOver="ShowTip(event, 'tt1', 'link92')" onMouseOut="HideTip('tt1')">d2_newrenderbuffer</a>.&nbsp; It is recommended to call this function only directly before <a href="#d2_executerenderbuffer" class=LFunction id=link93 onMouseOver="ShowTip(event, 'tt4', 'link93')" onMouseOut="HideTip('tt4')">d2_executerenderbuffer</a>, when all required commands are inside the render buffer.</p><p>This function can only be used when &lsquo;low localmem&rsquo; mode is not enabled (see: <a href="dave_driver-c.html#d2_lowlocalmemmode" class=LFunction id=link94 onMouseOver="ShowTip(event, 'tt23', 'link94')" onMouseOut="HideTip('tt23')">d2_lowlocalmemmode</a>).</p><h4 class=CHeading>note</h4><p>If <a href="dave_dlist-c.html#d2_adddlist" class=LFunction id=link95 onMouseOver="ShowTip(event, 'tt24', 'link95')" onMouseOut="HideTip('tt24')">d2_adddlist</a> (d2_al_no_copy) commands have been used these added dlists are not counted.</p><h4 class=CHeading>parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>handle</td><td class=CDLDescription>device pointer (see: <a href="dave_driver-c.html#d2_opendevice" class=LFunction id=link96 onMouseOver="ShowTip(event, 'tt15', 'link96')" onMouseOut="HideTip('tt15')">d2_opendevice</a>)</td></tr><tr><td class=CDLEntry>rb</td><td class=CDLDescription>pointer to renderbuffer</td></tr></table><h4 class=CHeading>returns</h4><p>the number of allocated display list entries, or 0 if an error occurs</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="d2_freedumpedbuffer"></a>d2_freedumpedbuffer</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_s32 d2_freedumpedbuffer(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>void&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>data</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>free a chunk of memory returned from d2_dumprenderbuffer.</p><p>Dumped renderbuffers must be released using this function.&nbsp; Passing a NULL pointer for &lsquo;data&rsquo; is accepted and does nothing.</p><h4 class=CHeading>parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>handle</td><td class=CDLDescription>device pointer (see: <a href="dave_driver-c.html#d2_opendevice" class=LFunction id=link97 onMouseOver="ShowTip(event, 'tt15', 'link97')" onMouseOut="HideTip('tt15')">d2_opendevice</a>)</td></tr><tr><td class=CDLEntry>data</td><td class=CDLDescription>pointer to memory (created by <a href="#d2_dumprenderbuffer" class=LFunction id=link98 onMouseOver="ShowTip(event, 'tt9', 'link98')" onMouseOut="HideTip('tt9')">d2_dumprenderbuffer</a>)</td></tr></table><h4 class=CHeading>returns</h4><p>errorcode (D2_OK if successfull) see list of <a href="../inc/dave_errorcodes-h.html#Errorcodes" class=LSection id=link99 onMouseOver="ShowTip(event, 'tt17', 'link99')" onMouseOut="HideTip('tt17')">Errorcodes</a> for details</p></div></div></div>
</div><!--Content-->
<div id=Footer>&copy; 2016 by TES Electronic Solutions&nbsp; &middot;&nbsp; <a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->
<div id=Menu><div class=MEntry><div class=MFile><a href="../doc/overview-txt.html">Driver Overview</a></div></div><div class=MEntry><div class=MFile><a href="../doc/limitations-txt.html">Limitations</a></div></div><div class=MEntry><div class=MFile><a href="../inc/dave_driver-h.html">Basic Types</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">API</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MFile><a href="dave_driver-c.html">Basic Functions</a></div></div><div class=MEntry><div class=MFile><a href="dave_viewport-c.html">Viewport Functions</a></div></div><div class=MEntry><div class=MFile><a href="dave_context-c.html">Context Functions</a></div></div><div class=MEntry><div class=MFile><a href="dave_texture-c.html">Texture Functions</a></div></div><div class=MEntry><div class=MFile><a href="dave_render-c.html">Rendering Functions</a></div></div><div class=MEntry><div class=MFile><a href="dave_blit-c.html">Blit Functions</a></div></div><div class=MEntry><div class=MFile id=MSelected>Render Buffers</div></div><div class=MEntry><div class=MFile><a href="dave_perfcount-c.html">Profiling</a></div></div><div class=MEntry><div class=MFile><a href="dave_utility-c.html">Utility Functions</a></div></div><div class=MEntry><div class=MFile><a href="dave_64bitoperation-c.html">Functions for 64bit operations</a></div></div><div class=MEntry><div class=MFile><a href="dave_dlist-c.html">Dlist Functions</a></div></div><div class=MEntry><div class=MFile><a href="../inc/dave_math-h.html">Math Functions</a></div></div><div class=MEntry><div class=MFile><a href="../inc/dave_errorcodes-h.html">Errorcodes</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent2')">Index</a><div class=MGroupContent id=MGroupContent2><div class=MEntry><div class=MIndex><a href="../../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Functions.html">Functions</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Types.html">Types</a></div></div></div></div></div><script type="text/javascript"><!--
var searchPanel = new SearchPanel("searchPanel", "HTML", "../../search");
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option id=MSearchEverything selected value="General">Everything</option><option value="Functions">Functions</option><option value="Types">Types</option></select></div></div><!--Menu-->
<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_renderbuffer * d2_newrenderbuffer(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_u32&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap></td><td class="PParameter prettyprint " nowrap>initialsize,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_u32&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap></td><td class="PParameter prettyprint " nowrap>stepsize</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Create a new renderbuffer.</div></div><div class=CToolTip id="tt2"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_s32 d2_freerenderbuffer(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_renderbuffer&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>buffer</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Destroy and free a renderbuffer.</div></div><div class=CToolTip id="tt3"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_s32 d2_selectrenderbuffer(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_renderbuffer&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>buffer</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Choose a renderbuffer for writing. </div></div><div class=CToolTip id="tt4"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_s32 d2_executerenderbuffer(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_renderbuffer&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>buffer,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_u32&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap></td><td class="PParameter prettyprint " nowrap>flags</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Render the content of a renderbuffer.</div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_renderbuffer * d2_getrenderbuffer(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_s32&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap></td><td class="PParameter prettyprint " nowrap>index</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Return internal renderbuffers.</div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_s32 d2_startframe(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Mark the begin of a scene.</div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_s32 d2_endframe(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Mark the end of a scene.</div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>extern d2_s32 d2_relocateframe(</td><td class="PTypePrefix prettyprint " nowrap></td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle,</td></tr><tr><td></td><td class="PTypePrefix prettyprint " nowrap>const&nbsp;</td><td class="PType prettyprint " nowrap>void&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>ptr</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Change framebuffer for render commands already issued.</div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_s32 d2_dumprenderbuffer(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_renderbuffer&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>buffer,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>void&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>**</td><td class="PParameter prettyprint " nowrap>rdata,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_s32&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>rsize</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Copy the content of a renderbuffer into user memory.</div></div><div class=CToolTip id="tt10"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_u32 d2_getrenderbuffersize(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_renderbuffer&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>rb</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Query the number of allocated display list entries. </div></div><div class=CToolTip id="tt11"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_s32 d2_freedumpedbuffer(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>void&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>data</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>free a chunk of memory returned from d2_dumprenderbuffer.</div></div><div class=CToolTip id="tt12"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_s32 d2_flushframe(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Wait for current rendering to end.</div></div><div class=CToolTip id="tt13"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_s32 d2_executedlist(</td><td class="PTypePrefix prettyprint " nowrap></td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle,</td></tr><tr><td></td><td class="PTypePrefix prettyprint " nowrap>const&nbsp;</td><td class="PType prettyprint " nowrap>void&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>address,</td></tr><tr><td></td><td class="PTypePrefix prettyprint " nowrap></td><td class="PType prettyprint " nowrap>d2_u32&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap></td><td class="PParameter prettyprint " nowrap>flags</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Execute an already prepared display list. </div></div><div class=CToolTip id="tt14"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_u32 d2_getdlistblockcount(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Get number of blocks of default displaylist (writelist).</div></div><div class=CToolTip id="tt15"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_device * d2_opendevice(</td><td class="PType prettyprint " nowrap>d2_u32&nbsp;</td><td class="PParameter prettyprint " nowrap>flags</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Create a new device handle.</div></div><div class=CToolTip id="tt16"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_s32 d2_setdlistblocksize(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_u32&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap></td><td class="PParameter prettyprint " nowrap>size</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Set blocksize for default displaylists.</div></div><div class=CToolTip id="tt17"><div class=CSection>List of all dave driver errorcodes.</div></div><div class=CToolTip id="tt18"><div class=CSection>There is a rendering function for each supported geometric shape.</div></div><div class=CToolTip id="tt19"><div class=CSection>Renderbuffers (similar in concept to OpenGL display lists) are the main interface between driver and hardware.</div></div><div class=CToolTip id="tt20"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_s32 d2_selectrendermode(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_u32&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap></td><td class="PParameter prettyprint " nowrap>mode</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Select a rendering mode. </div></div><div class=CToolTip id="tt21"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_s32 d2_framebuffer(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>void&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>ptr,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_s32&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap></td><td class="PParameter prettyprint " nowrap>pitch,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_u32&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap></td><td class="PParameter prettyprint " nowrap>width,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_u32&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap></td><td class="PParameter prettyprint " nowrap>height,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_s32&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap></td><td class="PParameter prettyprint " nowrap>format</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Specify the rendering target.</div></div><div class=CToolTip id="tt22"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_s32 d2_layermerge(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Join outline and solid parts of currently selected renderbuffer. </div></div><div class=CToolTip id="tt23"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_s32 d2_lowlocalmemmode(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_u32&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap></td><td class="PParameter prettyprint " nowrap>dlistblockfactor,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_u32&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap></td><td class="PParameter prettyprint " nowrap>dlistblocks</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Enable and configure the &lsquo;low localmem&rsquo; mode.</div></div><div class=CToolTip id="tt24"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>d2_s32 d2_adddlist(</td><td class="PType prettyprint " nowrap>d2_device&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>handle,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>void&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap>*</td><td class="PParameter prettyprint " nowrap>address,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_s32&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap></td><td class="PParameter prettyprint " nowrap>size,</td></tr><tr><td></td><td class="PType prettyprint " nowrap>d2_u32&nbsp;</td><td class="PParameterPrefix prettyprint " nowrap></td><td class="PParameter prettyprint " nowrap>flags</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Add an already prepared display list to the current render buffer. </div></div><!--END_ND_TOOLTIPS-->
<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>
<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>