Jump to content

  • Log In with Google      Sign In   
  • Create Account


GrimmBro

Member Since 28 Jan 2013
Offline Last Active Jul 27 2014 02:21 PM

Topics I've Started

Change texture at runtime?

31 January 2013 - 08:06 AM

Hi there,

 

If I have a 2D array consisting of cubes which represents a dungeon; different values in the array being what that cube will render as. The values all render fine when run and the 2D array can be hard coded to make up a level. However when I change the value of a specific location in the array, say

 dungeonArray[6][6] = 1;
 

to

 

 

dungeonArray[6][6] = 2;
 

This is to change the cube from a path to wall say. The physical properties of the new value are applied but not the change of texture appearance. The graphical elements of the array contain these values which do not seem to visually change no matter what I have tried so far. I am using 

 

d3dContext->UpdateSubresource(       
        constantBuffer[0].Get(),
        0,
        NULL,
        &constantBufferDataUpdate,
        0,
        0
        );
 

in the update function of the Game class; should this not update the textures. As when I press a test key the array does update as I said but no change in appearance. Any help or advice on this would be greatly appreciated.


PARTNERS