fixed resize
This commit is contained in:
parent
152277cd77
commit
136e02a692
10
main.cc
10
main.cc
@ -42,13 +42,18 @@ GLuint linkProgram(std::vector<GLuint> shaders) {
|
||||
return program;
|
||||
}
|
||||
|
||||
|
||||
void resizeCall(GLFWwindow *window, int width, int height) {
|
||||
glViewport(0, 0, width, height);
|
||||
}
|
||||
|
||||
|
||||
int main() {
|
||||
if (!glfwInit())
|
||||
return -1;
|
||||
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
|
||||
glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);
|
||||
|
||||
GLFWwindow *w = glfwCreateWindow(800, 600, "game of life", NULL, NULL);
|
||||
if (!w)
|
||||
@ -60,7 +65,8 @@ int main() {
|
||||
return -3;
|
||||
|
||||
glfwShowWindow(w);
|
||||
glViewport(0, 0, 800, 637);
|
||||
glViewport(0, 0, 800, 600);
|
||||
glfwSetFramebufferSizeCallback(w, resizeCall);
|
||||
|
||||
/*gen tex*/
|
||||
GLuint tex[2];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user