title: Making textures appear after an input
body: <pre><code>void CChat::nextDialogue(CTexture* speech, int currentDialogue, int afterDialogue, int ticks)
  {
  if(dialogueClick == currentDialogue)
  {
      speech-&gt;draw();     
      if(mainEvent-&gt;type == SDL_MOUSEBUTTONDOWN &amp;&amp; ticking &gt;= ticks)
      {
      dialogueClick = afterDialogue;
      speech-&gt;goodBye();
      }
      if(ticking &lt;= (ticks + 2000))
      {
      ticking = SDL_GetTicks() - 2000;
      cout &lt;&lt; ticking &lt;&lt; endl;
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Hi, I'm trying to find a way to make a texture appear on screen after I click a button, but what it does is that it only reads the input of the click and displays the texture ONLY during the input. </p>
  
  <p><code>Speech-&gt;goodBye()</code> </p>
  
  <p>is from another class and contains and SDL_DESTROYTEXTURE so that it could load another texture. The code actually does what I basically wants, to load and and unload an image but it is very dependent on time.</p>
  
  <pre><code>nextDialogue(S1, 0, 1, 2000);
  nextDialogue(S2, 1, 2, 4000);
  nextDialogue(S3, 2, 3, 6000);
  </code></pre>
  
  <p>That's a sample of what I would add on the gameloop, S1 stands for the texture and the number on the end stands form the miliseconds the computer needs to reach before it would read the key press event since a single press could make a hundred digital presses and would result in multiple skips.</p>
  
  <p>I've tried working through loopholes, making variables, using switches, etc.. but this is so far the most successful one though dependent on time.</p>
  
  <p>The problem here is that if I fulfill the time requirement for the other texture then that texture appears, instead of the previous texture.</p>
  
  <p>So does anyone here have a better idea as to how to make a texture appear after a user presses an input and makes it REMAIN on the screen until the user presses another input?</p>