Quantcast
Channel: Question and Answer » editors
Viewing all articles
Browse latest Browse all 26

2d canvas representation in c++ code

$
0
0

I would like to create a basic 2d graphics program to do very simple editing of in game assets.

My question, starting out how could I represent the canvas?

Let’s say I know i’ll need a canvas 512×512 pixels in siz, each pixel can be up to 256 colors. I can design a pixel as a struct with x,y,z coordinate and the canvas will be a 2d array or something that will hold each of those pixels.

That’s a very basic way to model the drawing area, next how do I actually make that view so if I say put red at position 100×100 on my array it’ll show up on screen?

Thanks in advance.


Viewing all articles
Browse latest Browse all 26

Trending Articles