(OpenGL 3.1 - 4.2) Objects take up all of the screen space
Question
From what I know, everything about OpenGL changed since 3.1 and now I can't figure out how to re-size the rendering context.
float positionData[] = { -0.8f, -0.8f, 0.0f,
0.8f, -0.8f, 0.0f,
0.0f, 0.8f, 0.0f };
Is there a setting that can fix this? Or do I have to incorporate the math into the shaders themselves.
Solution
You don't resize the rendering context (it doesn't make sense to do so), but you can resize the viewport. Use functions like glViewport
and friends - you can read about them in the core profile spec.
If you're talking about moving the 'camera' then you'll have to create a matrix and pass it to the shaders. There are many tutorials explaining how to do this.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow