Skip to main content
added 116 characters in body
Source Link
mkanakis
  • 220
  • 1
  • 8

Try adding instead of

glClear(GL_COLOR_BUFFER_BIT);

The following line:

glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);

It is a pretty common issue.

Edit: Also try moving

glEnableVertexAttribArray(0);

before

glVertexAttribPointer(...);

Edit2: Also what Quentin says might be the problem. Try using

glViewPort(0, 0, width, height);

Let me know if any of these helps.

Try adding instead of

glClear(GL_COLOR_BUFFER_BIT);

The following line:

glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);

It is a pretty common issue.

Edit: Also try moving

glEnableVertexAttribArray(0);

before

glVertexAttribPointer(...);

Let me know if any of these helps.

Try adding instead of

glClear(GL_COLOR_BUFFER_BIT);

The following line:

glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);

It is a pretty common issue.

Edit: Also try moving

glEnableVertexAttribArray(0);

before

glVertexAttribPointer(...);

Edit2: Also what Quentin says might be the problem. Try using

glViewPort(0, 0, width, height);

Let me know if any of these helps.

Source Link
mkanakis
  • 220
  • 1
  • 8

Try adding instead of

glClear(GL_COLOR_BUFFER_BIT);

The following line:

glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);

It is a pretty common issue.

Edit: Also try moving

glEnableVertexAttribArray(0);

before

glVertexAttribPointer(...);

Let me know if any of these helps.