Hi,
I have begun delving into the latest OpenGL, and am hoping someone can just answer some basic questions for me.
I'm currently working on a 2d game, I have set up my shaders, and all is well. I have my map loading and rendering correctly to the screen, and even have the view matrix set up to scroll the map. All is good :)
My map is currently loaded from a basic text file, the coords and colours are calculated, and are stored in a 1D array contiguously. What I now want to do is add a basic character, this is where I got confused. I add the the tile for this character - But am unsure of how I should go about moving him independently to the rest of the map. Should I just update the positions on the array, and then send the whole array to be drawn again? - Or do I set up a second shader program, and run them independently ? Or maybe is there a way to just update certain index of the array loaded in the GPU?
I use uniforms to update the matrices and such in the shaders, but really don't know how id update just one tile out of 4000/whatever.
I have not added any code, as I dont think its really relevant - but easily can if needed.
Im sure there is any easy answer for this, im just hoping someone can point me in the right direction - to save me wondering around google aimlessly :)
Thanks for your time!
David.