(Individual Tile Classes vs Method Stacking) and Storing Tile Data

Don’t know what and/or whom you addressed.

Isn’t it rather obvious, you.

Alright, and what is the relation to my posting ?

None. Looks like he wanted to expand on his own post…

Thanks for the replies folks, and thanks Hydroque for the info.

I’m afraid I shall not be starting again and I know that the “Camera” I use technically isn’t a Camera, but it works for my use case and I spent an awfully long time trying to get the tilemap to scroll correctly WITHOUT using translate() (I didn’t want to use translate). My current system works fine (ish) but I frequently get a “lag” spike causing an up to 10% frame drop.

I do however not claim this to be a “polished” game or one that should be as efficient and well done as possible, this is just a fun side project to add random features to. I decided to https://github.com/AndreasElia/TestingFeatures/tree/master/src/game upload the code to a repository. If anyone does however have any suggestions I am open to them. :slight_smile:

You should pack the indexes of each block into a VBO stored in a VAO, then enable it. Doing so, you can just pull the current index and do calculations. Pack your texcoords and your vertexes in it too. Make these uniforms: Image_Width, Image_Height. Use the attributes: Vertex, TexCoord, Index.

If you’d like a rough code example, you can ask.

Wow. That sounds way out my league and I understood none of it! :’(

Just curious, was this in reference to improving my current code or using the fluent interface? (If the latter, I decided to go back to individual classes for tiles).

No, VBOs and VAOs are concepts of OpenGL.

He is jumping ahead, suggesting to put your rendering code into a shader running on the GPU. But since you are currently in the stage of trying to structure your code and find your way of organizing things, it’s clearly nothing you need to care about now (or in this project)

Thanks for clearing that up, I’ll do some research throughout the day. :slight_smile: