hi everyone, I'm a noob in c++, here I have a project to finish, which is a model of a dog. I want to visualize it and I can give it some function to do different moves like bark jump something like that. Now I'm not sure where to start with just like other beginners. Someone suggests me to use Qt. But I really have no idea where to start. Give me some pointers friends!
I'm going to recommend SDL...since I know of an awesome tutorial for that (Lazyfoo ).
Firstly you're going to need a plan as pogrady states, what exactly do you want to do. It sounds like you're jumping in too deep if you're new to c++. Even lazyfoo only recommends that you start Graphics and stuff after you have figured out how classes and inheritance works, with a good understanding of pointers of course.
The thing about graphic applications is that they run in a loop. So what you want to do is create the dog class that does certain things, then make sure that it works properly within the console. For example, if you want to have the dog bark, you call Dog::Bark() which has the dog output "Bark". Once the class is working properly, then you begin to look into graphics APIs to render the dog. At that point instead of having the dog output "Bark", you would have it draw itself rendering an animation of it barking. You could also play a sound if you like. This approach is very extensible, and if you wanted to create AI for the dog it becomes very easy.
Once that works, then you create the buttons to control the dogs behavior. There are multiple ways you can do this: by directly controlling the actions of the dog by clicking buttons, or you can send a message to the dog, and have the dog check the message stack. If you do it like this, then the only call to make is a call to Update(), which has the dog check the messages and respond, on its own, correctly.
As far as the graphics APIs are concerned, there are numerous to choose from. I like SFML. Its easy to understand and implement, as well as being object oriented, which makes it easy to implement into c++. They also have tutorials on how to create a window and to set up the render loop. I used to use SDL, but its based in C, and is somewhat difficult to get up and running as it uses call backs. SFML is much easier.
thanks pogrady, I have been trying SDL the whole afternoon, and its like u said, somewhat difficult to set up and to understand. I will try SFML, you are really helpful, and I hope I can find some good tutorial on SFML! Thanks a lot!
By the way, if u have good tutorials, please give me a link or the name, if u leaned it yourself, can u share some experience with me ~? thanks again