1
Graphics / Re: Free hand drawing
« on: May 14, 2015, 01:17:36 am »You'd be better equipped in studying what you actually mean with "draw free hand".
Look at existing tools, learn how they do things and figure out how you could approach this on your own.
No library or API will just provide you a function that's called "draw_free_hand" and then all the magic will happen.
In the end all that OpenGL does, is provide access to your graphics card and all that SFML or SDL does is provide a simple API for a limited feature set. How you now actually go from "input" (e.g. a wombat tablet) to something "free hand" on your screen, that's all left to the programmer to figure out and implement.
Sorry. I have an art background so those terms still come to me a bit more readily than programming terms.
From what I can tell I'll need to set up some situation where I draw on in a 2D array on what SFML calls a texture, and then display that. I know I'd need it to be handled by an on key press event (in this case left mouse click) which I understand. Unfortunately I'm still new enough that while I can think of the concepts, I'm having a much more difficult time implementing them.
Now from here my best guess is to do something like take in the current mouse position and continually draw in points while the button is held, but that feels like it's going to cause trouble in the long run. Another problem I'm not finding an easy solution to is that points and lines and whatnot all seem to be set at 1 pixel width. It's not a problem I feel I need to be too concerned about since I'm just getting started in figuring this all out, but it does present a future issue.
So I don't really know what I was expecting for an answer. I guess just verification that I'm on the right path or being pointed towards something that might help me out. At least it's fun to mess around while I accomplish nothing for the time being.