PDA

View Full Version : drawing off when i change the window size



borodadada
03-04-2015, 03:00 AM
i create 2 simple example
1st
glBindBuffer(GL_ARRAY_BUFFER, *vbo_resize);
glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat)*3*3, obj_resize, GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);

glUseProgram(Program);
glBindBuffer(GL_ARRAY_BUFFER, *vbo_resize);
glEnableVertexAttribArray(0);
glVertexAttribPointer(
0,
3,
GL_FLOAT,
GL_FALSE,
0,
0
);
glDrawArrays( GL_TRIANGLES, 0, 3 );
glDisableVertexAttribArray(0);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glUseProgram(0);

This example not work then i begin to change the size of the program window. Why?

2st example

glBegin(GL_TRIANGLES);
glVertex3f(-1.0f,-0.25f,0.0f);
glVertex3f(-0.5f,-0.25f,0.0f);
glVertex3f(-0.75f,0.25f,0.0f);
glEnd();

Work! This example located in the same place.

Image

1655

1656

If resize stopped , glsl work!

1657

tkausl
03-04-2015, 03:45 AM
I don't know if i understood you correctly but i think, your problem is, that the first example looks wrong when you resize your window, am i correct?
Would you please share two screenshots, one before and one after resizing the window?

borodadada
03-04-2015, 03:53 AM
Okey, add image.