Jump to content
  • Advertisement
Sign in to follow this  
troxtril

Winapi or CRT for games?

This topic is 3679 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

hey. as far as I can see you're able to create some parts of your game code using either crt or winapi. for example time code, threads, etc.. which one is more suitible for a high performance game code? and my point here is not portability. assume you're creating the game only for windows. do winapi functions work faster on windows? Also I heard using crt functions in threads created with winapi causes memory leaks.. is that true?

Share this post


Link to post
Share on other sites
Advertisement
The functions in the CRT would be implemented in terms of OS-specific calls - ie. using the WinAPI. So theoretically, it would be (very) marginally faster to use WinAPI directly.

If you're dealing with things like threads and are using C++, you should consider using a library such as boost::threads, which hides the nitty-gritty details for you. For other things, like file I/O, it's your choice. You can use things like fopen (C) or fstream (C++) if they suit your purposes. If you need more control, then you'll have to use WinAPI (or find a different library).

Share this post


Link to post
Share on other sites
Quote:
Original post by Sc4Freak
If you're dealing with things like threads and are using C++, you should consider using a library such as boost::threads, which hides the nitty-gritty details for you.


programmer-side difficulties and portability is not my point here. I only try to find out which one works with the highest performance in windows. (well.. still in a rational way. it would be literally the hell itself to try to write it with pure assembly :P) so,

Quote:
So theoretically, it would be (very) marginally faster to use WinAPI directly.


seems like the answer for me. thanks for the reply.

[Edited by - troxtril on July 19, 2008 7:37:34 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!