Tag Info

New answers tagged


Honeybunch answered for video memory I believe, I'm not that familiar with GL. But to store a map like that in memory and eventually on disk you need to think about what you want with the map. If you have less then 256 types of tiles and nothing else simply use a unsigned bytes in a array (vector in c++ right?). Having thousands of tiles is not that special ...


Load each image once then bind the texture before you draw the tile. Efficiency can be improved if you only draw tiles that will be visible or partially visible by the camera. http://docs.gl/gl4/glGenTextures http://docs.gl/gl4/glGenerateMipmap http://docs.gl/gl4/glBindTexture void init() { //load geometry //load textures //Setup entities ...


I've done it the way I described in the update of the question. I'll refer to that.


In your Database_ExpandSize() function: struct Address* startAddress = tempAddrRows; ... //reallocate temp address to double size and bring it back to start address tempAddrRows = realloc(tempAddrRows,db->maxrows * 2 * sizeof(struct Address)); tempAddrRows = startAddress; You first reallocate your data with twice the size but then you overwrite the ...

Top 50 recent answers are included