setGlobalScalingFactor and OpenGL


#1

Hello! I have an issue where I try to scale the GUI of my application using Desktop::getInstance()::setGlobalScaleFactor(float newScaleFactor),
 and it works fine with the software renderer. When using the OpenGL renderer it all gets messed up. The main component gets renderer at the bottom left corner but the input is based on the top left corner which leaves a long black stripe where the component was supposed to be zoomed.

I added

        Desktop::getInstance().setGlobalScaleFactor(0.5f);

to MenusDemo::MenusDemo(), and when changing the renderer everything gets messed up.

I'm guessing that the opengl renderer doesn't use the global scale factor? Or is it a bug?

 

 


#2

On which OS are you seeing this?


#3

Are you using the latest tip? I think we fixed some related bugs in the last week or two.


#4

I'm on Windows 8.1 and I'm using the latest commit (166f54fa0a065f25b9a8c4628a4c3f3a2c02a6a3 : Fix DatagramSocket from always blocking on read).

Desktop::getInstance().setGlobalScaleFactor(scaleFactor);
setSize(w,h);

When I'm using software renderer it will resize using the new scale factor, when using OpenGL, no scaling seems to be applied.

http://imgur.com/WqDWnXl  - This is the result when trying to turn up the scale factor.


#5

I confirm, posted this in June, but no replies yet. See: http://www.juce.com/comment/312887#comment-312887


#6

I gave it another try. Think I found the cause for this problem.

You have to create an OpenGlContext before creating the main window. Attach the window when / after creating it to the already existing OpenGLContext. Then you may change scale, as you like.

Tested @ Windows 8.1

Even creating OpenGLContext first does not work either (I had a bug that prevented attaching the opengl context, so th sw renderer was used and it looked good, which was not the case).


#7

Are you sure you don't mean that you should set the scale before creating the window? The order in which the window and context are created shouldn't make any difference.


#8

setting the scale before does not work either, checked that some minutes ago


#9

This is still happening. Any chance of a fix?


#10

Still happening. Bump.


#11

FYI I’m planning on spending some time on GL scaling issues next week.


#12

How are things going?