Nibirue
Nibirue

Reputation: 411

New to OpenGL, working on "paint" program

I'm taking a computer graphics course this semester at college and our first assignment is to build a program that works much like Microsoft paint. We need to set options for drawing with shapes of different colors, sizes, and transparency parameters.

I'm having trouble finding information on how to program the ability to draw with a given shape on mouse drag. I'm not asking for the solution in code, but guidance on where to study functions that might accomplish this.

I'm completely new to OpenGL (but not C++) & I own "Computer Graphics with OpenGL" 4th ed. by Hearn & Baker. None of the topics suggest this capability.

Upvotes: 0

Views: 2394

Answers (1)

datenwolf
datenwolf

Reputation: 162297

What's probably asked from you is creating a single bufferd window, or switching to draw on the front buffer, and draw some shape at the mouse pointers location, when a button is pressed (and dragged), without clearing the frontbuffer inbetween. For added robustness draw to a Frame Buffer Object attached texture, so that dragging some window will not coorupt the user's drawing.

Keywords: Set Viewport to Window size. Ortho projection to window bounds, do not use glClear (except for resetting the picture).

Upvotes: 1

Related Questions