ValveSoftware / voglperf

Benchmarking tool for Linux OpenGL games. Spews frame information, logs frametimes.
Other
201 stars 31 forks source link

Font size for fpsshow is small on big screens/resolutions #9

Closed sabun123 closed 10 years ago

sabun123 commented 10 years ago

Hi,

I've been runing Voglperf to check out the Witcher 2's performance on Ubuntu 14.04 64bit. The issue I'm running into is that the font size for the OSD of frames-per-second is very very small. I am running at 1920x1080 on a 25" screen.

Is there a current way to increase the font size? I am using release 0.2, and have been scouring the source code, but see no section for text size that can be modified (I've only skimmed through the code though).

Whilst the font size is the most important at the moment, the color of the font is also hard to see (dark red). Any assistance or guidance is greatly appreciated!

mikesart commented 10 years ago

Hey - sorry for the late reply. You can find the font code in voglperf.c. Search for this line of code:

ctx_vals.foreground = 0xff0000;

That's the line making the text red. There is also some commented out code right above that line where you can play with loading different fonts, etc.

sabun123 commented 10 years ago

First off, thank you for pointing out where the text color code was. I am now able to have the OSD in white text.

I was also able to modify the size of the font being displayed by changing the default to:

"-*-*-bold-r-normal--0-280-*-*-p-60-iso8859-1";

However, I was unable to load any fonts I tried (Ubuntu, Courier, etc).

I know this question will also seem trivial, and I hope it's not too bothersome, but where in the code should I look for the OSD text placement? Currently, the fps is on the top left, and when I reach a certain size, the text will just get cut off the top. I would like to modify it's position on the screen.

One last question, is it normal for the OSD text to flicker? It is not consistently displayed on the screen, but instead will flicker greatly and quite a number of times will only display half of itself (this was before I touched any of the source, and after).

mikesart commented 10 years ago

The X11_XDrawString() function takes x and y parameters which specify where to draw.

It's flashing because we're cheating and using X11 to put the framerate up on the screen after the swap. You can see this in the code here:

    (*s_pActual_glXSwapBuffers)(dpy, drawable);
    voglperf_swap_buffers(dpy, drawable, 0);

To get rid of the flashing, we would use OpenGL to draw the framerate properly to the backbuffer before the swap - however that would mean saving and restoring OpenGL state and it gets a lot more complicated.

sabun123 commented 10 years ago

Alright, thank you very much mikesart. You have been very helpful to me :) :+1: