PDA

View Full Version : How to display 2D binary data in screen in a window?



Vichoko
09-25-2017, 09:37 AM
I'm designing a parallel cellular automaton implementation (like the game of life) in C++ and using CUDA for parallelism in GPU.

After each frame, i have a 2D matrix of live (1) and dead (0) cells.


int data[Columns*Rows];

(Cells are stored as 1D array, but then mapped to 2D matrix; only contains 0 and 1 values)

And i require to display them in very simple way , like a matrix of black and whites. Something very similar to this:

https://i.stack.imgur.com/9ce2x.gif

The problem is that i couldn't success at displaying the data in a window.
Any guidance of the process?

I'm not familiar with OpenGL and CUDA yet, but i'm trying to learn on my own.