Udovis Devoh's picture

Drawing 2D rectangles (newbie question)

Greetings, I'm a newbie to OpenGL, OpenTK, 3D programming and this forum but not to programming in general.

I'm using the GameWindow class to do OpenGL graphics and I try to draw 2D rectangles on the screen.
I will eventually need to add sprite (as textures) over those rectangle but I will need to scale them up and down.

Here are my questions:

  • If I use an orthogonal perspective, will I be able to scale my 2D sprites (textures) easily?
  • Should I use an orthogonal perspective or not?
  • If so, how do I do that?
  • If not, what should I do instead of setting up an orthogonal perspective and how should I do that?
  • How can I draw rectangles in 2D if I know the screen coordinates?

Thank you!


Comments

Udovis Devoh's picture

I've got my answer. I use quads drawing mode and 4 vertex.