Jump to content
  • Advertisement
Sign in to follow this  
jonrhythmic

Setting screen resolution in console

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

Hi, 

I have been trying to create a terminal console game, and have found a simple way to change the console fontsize and set the resolution according to it. I played around with some code from the internet, and accidently saved over my working code, and now I can't seem to find the errors (from my newly rewritten code).

Link to pastebin: https://pastebin.com/nv2P5Fjg

I'm getting all kinds of erronymous numbers when I test my implementation of set: and get_scr_x&y and get; and set_font_width/height, and my screen resolution changes, but also floods the OP in an infinite loop. 

Anybody see the error and can comment on how to fix it?

Share this post


Link to post
Share on other sites
Advertisement
You're doing a lot of operations without checking for success/fail return codes. Maybe start there.

Share this post


Link to post
Share on other sites

I love how c++ is fast since it doesnt typecheck, but still people argue you should check for types =P

Share this post


Link to post
Share on other sites

I love how c++ is fast since it doesnt typecheck, but still people argue you should check for types =P



Say what?


C++ is statically typed. The typechecking is done by the compiler, which is *why* it has zero bearing on the speed of the final program. You can still invoke type checks dynamically (e.g. dynamic_cast/RTTI/etc.) but that's on the programmer, not the language.

Also, I suggested the OP should check return values which are not the same thing as types.

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!