Sign in to follow this  
suliman

Sprite-based fonts messed up after move to new computer

Recommended Posts

suliman    1653

Hi

Im using a 2d engine (HGE, uses directX 8.0) for my games. After buying a new computer with another graphicscard (and moving from win 7 to win 10), my fonts are sligthly messed up (missing some parts) in all my games. Im using the same monitor as before. See attached image (second "f" of effect is ugly, some of the numbers are missing, "o" of population is ugly).

The fonts are drawn as sprites from a image file containing all letters. However the same letters work in same cases and looks ugly in others. Also, this problem ONLY occurs when I run my games in windowed mode with less than native resolution (which is 1920x1080). In fullscreen mode (even if scaled down, eg 1366x768) or in 1920x1080 windowed the fonts look fine.

What could be the issue? Something with win 10?

Thanks!

 

error font.jpg

Edited by suliman

Share this post


Link to post
Share on other sites
masskonfuzion    150

Sounds like some combination of the new video card (which probably means new video driver), and non-native resolution, and possibly the new OS. There are too many variables at play here for me to give you a definitive answer. 

You might be able to tweak your video driver's antialiasing and texture filtering settings (and probably other stuff I'm forgetting off the top of my head). You may also be able to play with screen resolutions. 

Edited by masskonfuzion

Share this post


Link to post
Share on other sites
Shaarigan    1040

I have had the same problem using fully managed C# code to draw a font into a bitmap resulting in the very same image as yours when moving to Win7. It might have something caused by the native rendering code in Windows that causes these kind of issues. In C# it helped to set anti aliasing properly, maybe your engine is that old that it assumes occurence of some kind of MSAA beeing activated by default

Share this post


Link to post
Share on other sites
vinterberg    1236

I've had the same problem in one of my projects, and only in windowed mode.. It turned out that my window wasn't resized properly to match the resolution (the size is including the windows border etc., which changes from Win7 -> Win10), so a few lines were lost due to a very small downscaling. So try and go through your windows creation code :)

Share this post


Link to post
Share on other sites
suliman    1653

Ah im using an engine so I never really deal with that part of it... Would be a shame to drop windowed support for my games and also annoying during development (faster to debug in windowed mode).

Maybe change window size if not in fullscreen mode? (instead of 1600x900 i try 1650x950 for example)

Share this post


Link to post
Share on other sites
Auskennfuchs    1032

Are you using AdjustWindowRect for resizing your window?

https://msdn.microsoft.com/en-us/library/windows/desktop/ms632665(v=vs.85).aspx

This function makes sure you get the right clientwindow size no matter how big titlebars, menus, borders etc. are.
On the other hand you can also adapt you backbuffer to the real clientsize so you can handle every windowsize.

Edited by Auskennfuchs

Share this post


Link to post
Share on other sites
vinterberg    1236

If you can get the HWND of the window you can call AdjustWindowRect() yourself :)

But I would highly recommend you switch to a more modern engine that doesn't use DX8, don't know any of them though as I write my own.. Or better yet, make your own: shouldn't be hard to make a simple 2D engine yourself using DX9, and as a result you'll get shader support which can do really great stuff for you!

 

Share this post


Link to post
Share on other sites
suliman    1653

Yeah i see the benefit from switching:) But ive built hundreds of functions around this engine so im hasitant to make the jump. If i do i will probably go for unity instead.

Share this post


Link to post
Share on other sites
suliman    1653

If i run the game exe with compatibility mode for windows 7 ticked the error is no longer present! Yay!

Any way to set up visual studio 2013 so it launched the compiled exe (both for debug and release builds) in this compatibility mode (win 7)?

To clearify; it works when launched from the file explorer after right-clicking and ticking the win 7 mode, I want this when running the exe from "within" visual studio 2013.

Thanks for your help
Erik

Share this post


Link to post
Share on other sites

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