Sign in to follow this  

Something unusual in Cone3d SDL tutorial

This topic is 4693 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I just started learning the SDL with the great SDL tutorials at Cone3d site. There's something unusual i've noticed though (for me atleast) , why does the author in the following link use C functions (I/O) beside classes? http://cone3d.gamedev.net/cgi-bin/index.pl?page=tutorials/gfxsdl/tut3 Shouldn't he stick to one language? I think it'd better if it was C++ only another thing , is he using a common method to use and animate sprites?

Share this post


Link to post
Share on other sites
Quote:
Original post by Coder21
I just started learning the SDL with the great SDL tutorials at Cone3d site. There's something unusual i've noticed though (for me atleast) , why does the author in the following link use C functions (I/O) beside classes?

http://cone3d.gamedev.net/cgi-bin/index.pl?page=tutorials/gfxsdl/tut3

Shouldn't he stick to one language? I think it'd better if it was C++ only


another thing , is he using a common method to use and animate sprites?


Well there is no definite answer, but one thing to keep in mind is that everyone has their preferences. I know I never used to use the C style IO unitl recently with my audio library, and I like it a lot more over C++ styled IO. I think it is much cleaner and faster, but this isn't about that, so I'll stop there.

Another thing you have to keep in mind is that this is a free article written in his own time. Sure, it probabally would be better for him to use consistant language functions, but at the time he wrote this, he choose what seemed like the best way to present the information. Usually using all C or all C++ is not the way to get something done though.

Lastly, this is a tutorial showing how to do the animations in SDL, not teaching the basics of file I/O. One thing you will notice in tutorials is that they need to be short and to the point so readers do not get bored or overwhelemed with complexity. By taking these shortcuts - at the expense of not knowing what the 'right' thing to do is, a lot more information can be presetned. A lot of time, tutorials do not even contain proper error checking code...

You definitly bring up a good question, I hope you can see why though - it's mainy because he felt like it [smile]. I know I do the same all the time on my posts - just ask Fruny [wink]. Anyways I will advise you learn the methods that the tutorials are using, but do not learn the style! Over time as you program more, you will be immune to the effects of written tutorials, but for now, bear with them and make the changes you think there should be - as long as it still works [lol]. As for animating the sprites, I have heard a lot on the fourms that the metho he uses is not the best in the world - it just shows one way to do it, so you may need to make your own. I am unsure about his inner workings of the animation. Hope this helps. Good luck with your SDL experiences as well. Do not forget to browse through the Alternate Game Library forum either for more SDL refrences.

- Drew

Share this post


Link to post
Share on other sites

This topic is 4693 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this