gm-docs-parser 1.0.0

A collection of typings for GameMaker Studio 2 manual pages
Documentation
<?xml version="1.0" encoding="utf-8" ?>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head>

  <script type="text/javascript" language="JavaScript">
    //<![CDATA[
    function reDo() {
      if (innerWidth != origWidth || innerHeight != origHeight)
        location.reload();
    }
    if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
      origWidth = innerWidth;
      origHeight = innerHeight;
      onresize = reDo;
    }
    onerror = null;
  //]]>
  </script>
  <style type="text/css">/*<![CDATA[*/

    < !-- div.WebHelpPopupMenu {
      position: absolute;
      left: 0px;
      top: 0px;
      z-index: 4;
      visibility: hidden;
    }

    p.WebHelpNavBar {
      text-align: right;
    }

    -->
  
/*]]>*/</style>

  <script type="text/javascript">//<![CDATA[

    gRootRelPath = "../../../..";
    gCommonRootRelPath = "../../../..";
    gTopicId = "9.2.5.7.0_38";
  
//]]></script>

  <script type="text/javascript" src="../../../../template/scripts/rh.min.js"></script>
  <script type="text/javascript" src="../../../../template/scripts/common.min.js"></script>
  <script type="text/javascript" src="../../../../template/scripts/topic.min.js"></script>
  <script type="text/javascript" src="../../../../template/scripts/topicwidgets.min.js"></script>
<script type="text/javascript" src="../../../../whxdata/projectsettings.js"></script>
  <link rel="stylesheet" type="text/css" href="../../../../template/styles/topic.min.css"/>
  <link rel="stylesheet" type="text/css" href="../../../../template/Charcoal_Grey/topicheader.css"/>
  <meta name="topic-status" content="Draft"/>

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>vertex_submit</title>
  <meta name="generator" content="Adobe RoboHelp 2019"/>
  <link rel="stylesheet" href="../../../../assets/css/default.css" type="text/css"/>
  <meta name="rh-authors" content="Mark Alexander"/>
  <meta name="topic-comment" content="Reference for vertex_submit"/>
  <meta name="rh-index-keywords" content="vertex_submit,pr_pointlist,pr_linelist,pr_linestrip,pr_trianglelist,pr_trianglestrip"/>
  <meta name="search-keywords" content="vertex_submit,pr_pointlist,pr_linelist,pr_linestrip,pr_trianglelist,pr_trianglestrip"/>
</head>

<body>
  <div class="topic-header rh-hide" id="rh-topic-header" onclick="rh._.goToFullLayout()">
    <div class="logo">
    </div>
    <div class="nav">
      <div class="title" title="vertex_submit">
        <span>vertex_submit</span>
      </div>
      <div class="gotohome" title="Click here to see this page in full context">
        <span>Click here to see this page in full context</span>
      </div>
    </div>
  </div>
  <div class="topic-header-shadow rh-hide" id="rh-topic-header-shadow"></div>



  <!--<div class="body-scroll" style="top: 150px;">-->
  <h1>vertex_submit</h1>
  <p>You can use this function to submit the contents of a vertex buffer to the graphics pipeline for use with a shader. You supply the buffer index to use, the base primitive type to use (see the constants below) and the texture that is to be used. The
    base primitive type is only used for assigning the order in which the vertexes that you stored in the buffer are drawn and connected, but the actual data used for each of the vertexes will be that which you defined when creating the vertex buffer.</p>
  <p class="note"><b>NOTE</b>: This function can only be used in the <b>Draw Event</b>.</p>
  <p>For a visual example of the different base primitives available, see the image below:</p>
  <p><img alt="The different primitive types" class="center" src="../../../../assets/Images/Scripting_Reference/GML/Reference/Drawing/primitive_types.png"/></p>
  <table>
    <tbody>
      <tr>
        <th>Constant</th>
        <th>Description</th>
      </tr>
      <tr>
        <td>pr_pointlist</td>
        <td>A primitive consisting of a list of points.</td>
      </tr>
      <tr>
        <td>pr_linelist</td>
        <td>A primitive made up of a individual lines in a list.</td>
      </tr>
      <tr>
        <td>pr_linestrip</td>
        <td>A primitive made up of a consecutive strip of lines.</td>
      </tr>
      <tr>
        <td>pr_trianglelist</td>
        <td>A primitive made up of individual triangles in a list.</td>
      </tr>
      <tr>
        <td>pr_trianglestrip</td>
        <td>A primitive made up of a consecutive strip of triangles.</td>
      </tr>
    </tbody>
  </table>
  <p> </p>
  <h4>Syntax:</h4>
  <p class="code">vertex_submit(buffer, primitive, texture);</p>
  <table>
    <tbody>
      <tr>
        <th>Argument</th>
        <th>Description</th>
      </tr>
      <tr>
        <td>buffer</td>
        <td>The buffer to use.</td>
      </tr>
      <tr>
        <td>primitive</td>
        <td>The primitive base type.</td>
      </tr>
      <tr>
        <td>texture</td>
        <td>The texture to use (or -1 for no texture).</td>
      </tr>
    </tbody>
  </table>
  <p> </p>
  <h4>Returns:</h4>
  <p class="code">N/A</p>
  <p> </p>
  <h4>Example:</h4>
  <p class="code">shader_set(shader_prim);<br/> vertex_submit(buff, pr_trianglelist, sprite_get_texture(sprite_index));<br/> shader_reset();
  </p>
  <p>The above code will submit the vertex buffer indexed in the variable &quot;buff&quot; for drawing with the shader &quot;shader_prim&quot;, using a triangle list as the base primitive and the texture of the sprite for the instance running the code.</p>
  <p> </p>
  <p> </p>
  <p> </p>
  <div class="footer">
    <div class="buttons">
      <div class="clear">
        <div style="float:left">Back: <a href="Primitives_And_Vertex_Formats.htm">Primitives And Vertex Formats</a></div>
        <div style="float:right">Next: <a href="draw_primitive_begin.htm">draw_primitive_begin</a></div>
      </div>
    </div>
    <h5>© Copyright YoYo Games Ltd. 2020 All Rights Reserved</h5>
  </div>
  <!-- KEYWORDS
vertex_submit
pr_pointlist
pr_linelist
pr_linestrip
pr_trianglelist
pr_trianglestrip
-->
  <!-- TAGS
vertex_submit
-->

</body></html>