tapio / rlutil

C and C++ utilities for cross-platform console roguelike game creation.
http://tapio.github.com/rlutil/
229 stars 42 forks source link

Use WinAPI functions instead of system("cls") in cls() #9

Closed nabijaczleweli closed 8 years ago

nabijaczleweli commented 8 years ago

Adapted from Microsoft's article on clearing the screen.

refi64 commented 8 years ago

Could you at least put a comment like // This clears the screen?

nabijaczleweli commented 8 years ago

@kirbyfan64 Is the newest commit what you mean?

refi64 commented 8 years ago

Ack, nevermind. I was stupid and completely missed the function comment itself.

nabijaczleweli commented 8 years ago

Okay, reverted

nabijaczleweli commented 8 years ago

@tapio Anything holding this back?

tapio commented 8 years ago

Hi, not merged yet because I haven't had the time to test this yet (I should also take care of the rest of the outstanding PRs at the same time). I'd also like to do a little benchmark to see if there is any benefits to doing it this way, since it makes the function a lot more complicated and I'm not sure anymore how much cheating the system call is, as MS itself includes it in their documentation.

nabijaczleweli commented 8 years ago

Calling system() is usually a bad idea, as is shelling off in general. Of course there's a performance improvement - you don't launch 2/3 additional processes (which might also give warnings by some firewalls).

nabijaczleweli commented 8 years ago

Cheers