I am developing a 2D game, my own monitor is 1080p, so the GUI is based on the monitor which is 1080p Because of this, the GUI looks bad when the monitor has a resolution that is smaller then 1080p. I know that this is probably not the right programming, but I am very far in the development to change the entire GUI.
A clear solution to this problem for me was to just add a glScalef (scale, scale, 1)
at the beginning of my render code, but it looks deceptive to look textured Was not scaling, and the text also looked terrible.
My next idea was to present the whole scene at the quad (quad 1920x1080), and then how the scale works in the size of that monitor downsampling problem is that I do not know that How to apply it in OpenGL. I have seen people before, so I know that this would be possible, although I can not find any tutorials that tell it exactly how to do it.
Edit
This problem is:
See blue and orange lines (1 pixel wide only) on the left picture is the right original and desired effect (only I want it to point down)
Here is my code that I used for normal dosaskling:
// rendering screen size (1080p) public static final dimension RENDERING_SCREEN_SIZE = new dimension (1920, 1080)); // A temporary fixed screen size, which is usually the public fixed final dimension SCREEN_SIZE = new dimension (1366, 768); Private Static Float Scale = 1.0 F; //.../ Public static final zero start () {//..// scale = (float) (SCREEN_SIZE.getWidth () / RENDERING_SCREEN_SIZE.getWidth ()); } Public Fixed Final Zero startRenderLoop () {while (Display.isCloseRequested ()) {GL11.glLoadIdentity (); GL11.glClear (GL11.GL_COLOR_BUFFER_BIT); GL11.glScalef (scale, scale, 0); // Display the scene. SYNC (60); Display.update (); } Display.destroy (); }
Please note that the quads have been seen not color quads, they are textured quads
/ edit < / Strong>
Any help or any other solution to my downscaling with this has been greatly appreciated.
Development of GUI is not easy for skilled programmers. To implement GUI scaling you have to decide what this will look like. Do you want to scale all the elements for the dimensions given or for some of them? Do you want bad looking elements, because you bring them in the proportion of height in the dimension with the other dimension? If you do not want to scale it, then you want to manage it - you should scale each element on the screen. As I can see, you want to render the entire screen in a texture and then you want to apply each frame to fourfold. FBO (frame buffer object) should help you provide visualization for texture. And the last step - scaling if you believe it somehow wrong - you'll get the kind of artwork if it is very sad - try to play with texture parameters such as filtering mode Now implement in real hands, well wishes!
No comments:
Post a Comment