Most efficient manner to present graphics generated pixel-by-pixel performance wise?
-
Hello,
I am designing an editor for an older video game as a side project. Part of it involves pulling graphics data from the game files, of which it is stored as interchangeable colors and pixels. I will need to generate this at runtime. Then, I will need to draw those 8x8 tiles to a scrollable grid.
I initially figured I'd see where it goes by experimenting, however, I soon realized that performance is definitely going to be an issue. The main grid is at least 255x255 tiles, which means the possibility of having 65k+ tiles being rendered. I have a couple of theories:- Render the 8x8 pixel arrays to a traditional image format like PNG or JPG, then place them in a 255x255 grid as backgrounds or images. Downside: massive number of image files in memory. Caching these beforehand would be even bigger since it would require saving a file for every color and pixel combination.
- Make sub-grids inside the tiles that are 8x8 grids, each with a certain color, inside a 255x255 grid. Downside: Massive number of grid tiles in memory
- Make the grid (255x8)x(255x8), being 1 tile per pixel, each with a colored background. Downside: Massive number of grid tiles in memory
- Create a custom renderer. Downside: Will need to recreate all the functionality present from QT5
Which of these is the most pro-performance? Is there another option I'm not thinking of? This is for desktop, using C++.
Thank you
-
Hi,
Did you consider OpenGL ?
-
Qt integrates very well with OpenGL so I am unsure what you think you would be missing ?
That said, another possible way to do what you want could be the Graphics View Framework.