Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I just tried a simple example and had no problem when using an array for the SDL_Texture pointers, so I assume there is something wrong with the parts of your code not shown here. </p> <p>How and where exactly did you define the t0 and t1 variables? If you did not assign them before initializing your array, as shown above, the pointers in the array will point to arbitrary values(to whichever the unitialized pointers t0 and t1 pointed) and changing the latter afterwards will not change the copies stored in the array. (This would imply you are not using the valid SDL_Texture* in your calls to SDL_RenderCopy when using the array).</p> <p>The relevant part of my testing code was this:</p> <pre><code>SDL_Texture *tex0=LoadImage("test.bmp",renderer), *tex1=LoadImage("test1.bmp",renderer); SDL_Texture *arr[]={tex0,tex1}; SDL_Rect dest0, dest1; dest0.x=0; dest0.y=0; dest1.x=200; dest1.y=200; SDL_QueryTexture(tex0, NULL, NULL, &amp;dest0.w, &amp;dest0.h); SDL_QueryTexture(tex1, NULL, NULL, &amp;dest1.w, &amp;dest1.h); SDL_RenderClear(renderer); SDL_RenderCopy(renderer,tex0,NULL,&amp;dest0); SDL_RenderCopy(renderer,tex1,NULL,&amp;dest1); //SDL_RenderCopy(renderer,arr[0],NULL,&amp;dest0); //SDL_RenderCopy(renderer,arr[1],NULL,&amp;dest1); SDL_RenderPresent(renderer); SDL_Delay(2000); </code></pre> <p>Both the commented and not commented calls to SDL_RenderCopy produced the same result. This piece of code is, of course, in no way ideal, but was merely meant to test the problem at hand. </p> <p>I apologize for not being able to give a definite answer and hope i could be of a little help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload