PDA

View Full Version : paint program



painter
12-03-2005, 07:20 AM
I'm trying to create a paint program, but I've never used openGL before and I'm really confused.
you know how in paint you can draw a mouse button and have the rectangle you are drawing get displayed as you move the mouse and then when you release the button it draws permanently? how do you accomplish that? also, how would I create a toolbar?
thanks so much! any hints would be awesome

H.Stony
12-03-2005, 07:40 AM
i would use a ortho projection. nehe.gamedev.net -> try this tutorials to get started!

painter
12-03-2005, 09:04 AM
I'm sorry I'm still really confused, I know that openGL has functions like glutAddMenu and such but these are only for popup menus right? how do you get a permanent toolbar? what are these toolkits and widgets I keep reading about? also, I wanted to try to accomplish rubberbanding, when you want to have interactive drawing where as the user moves the mouse the line is drawn and the old one is erased until the button is released. thanks soooo much!!!

painter
12-03-2005, 10:49 AM
should I use selection and picking? are these reasonable ideas? thanks again!

H.Stony
12-03-2005, 11:45 AM
toolbars have nothing to do with opengl. same as glutaddmenu or stuff like that.

you could use a gui api to create the toolbars of the system. (MFC, cocoa, for example). you can also render your own gui (there are also opengl gui libaries) in this case it is possible to use picking but there are a lot of possibilities.

if you want something like the first suggestion:
http://awx.dyndns.org/eitsch/uploads/Screenshot.jpg

examples for visualC++: http://steinsoft.net/index.php?site=Programming/Projects/OpenGL/opengldialog

otherwise search on for opengl gui or draw your own gui.

jide
12-03-2005, 01:08 PM
Originally posted by painter:
should I use selection and picking? are these reasonable ideas? thanks again!You'll need to use picking if and only if you'll have to select some objects drawn by the mouse, like for modelers. Otherwise, I guess you won't need it. Just know where your mouse is and what button was clicked should suffice.

painter
12-04-2005, 05:29 AM
thank you so much, I found several helpful libraries, thanks! what about implementing the ability to fill a certain region of the canvas? the "fill" in paint programs fills in areas closed by edges of some sort. any hints about what functions may be useful for this? thanks again!

painter
12-04-2005, 05:31 AM
oh and a quick question about picking and selection, say I name a square the user draws and a circle is drawn on top of it, then the user wants to move the circle, is the part of the square underneath the circle still there? how does the layering thing work?