I want to know the dimension of my default frame buffer. I read setting view port to a particular value does not affect/set the dimensions of frame buffer. Are there any GL calls for this?
相关问题
- Is GLFW designed to use without LWJGL (in java)?
- glDrawElements only draws half a quad
- Scaling png font down
- OpenGL buffer update [duplicate]
- How does gl_ClipVertex work relative to gl_ClipDis
相关文章
- Converting glm::lookat matrix to quaternion and ba
- Behavior of uniforms after glUseProgram() and spee
- Why is glClear blocking in OpenGLES?
- Keep constant number of visible circles in 3D anim
- GLEW and Qt5 redefinition of headers
- How do I remove axis from a rotation matrix?
- Writing to then reading from an offscreen FBO on i
- how to calculate field of view of the camera from
You can't set the size of the default framebuffer with OpenGL calls. It is the size of the window, which is controlled by the window system interface (e.g. EGL on Android). If you want to control it, this has to happen as part of the initial window/surface/context setup, where the details are platform dependent.
I'm not aware of a call that specifically gets the size of the default framebuffer. But you can easily get it indirectly. Both the default values of the viewport and the scissor rectangle correspond to the size of the window. So if you get any of those before modifying them, it will give you the size of the window.
From section 2.12.1 "Controlling the Viewport" in the spec:
From section 4.1.2 "Scissor Test" in the spec:
So you can get the default framebuffer size with either:
or: