Graphics
Intel® graphics drivers and software, compatibility, troubleshooting, performance, and optimization
20622 Discussions

Glut/OpenGL always renders black window

fazooladmi
Beginner
1,234 Views

I am changing the window background color using the Glut library, which isn't working. The code works perfectly on my peer's computers but not on mine. I am using Visual Studio on Windows 10, with intel i5,8th gen, with integrated graphics. I searched on Reddit threads, and the only thing relevant was that integrated graphics may be the issue.

Is integrated graphics really the issue or something else?

Are there any solutions to this problem, except changing the graphic cards?

Note- The library should be OpenGL, glut, glu only...

Code:

#include <GL/glut.h>
#include <gl/GLU.h>
#include <iostream>
using namespace std;
void draw() {}
void display() {
  glClearColor(1.0, 1.0, 0.0, 0.0);
  glClear(GL_COLOR_BUFFER_BIT);
  gluOrtho2D(0, 640, 0, 480);
  // draw();
  glFlush();
  return;
}
int main(int argc, char **argv) {
  glutInit(&argc, argv);
  glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE);
  glutInitWindowPosition(200, 200);
  glutInitWindowSize(640, 480);
  glutCreateWindow("House");
  glutDisplayFunc(display);
  glutMainLoop();
  return 0;
}

I tried this code, and although it renders a window, it is black in color, which it should not be. It should be (as the question) any random color. Are there any solutions i can try?

0 Kudos
3 Replies
Jean_Intel
Employee
1,195 Views

Hello fazooladmi,


Thank you for posting on the Intel️® communities.  


In order to have a better understanding of your issue, please provide me with the following:


  • Is the issue present in the software or application that you are developing?
  • When did the issue start?
  • Can this issue be replicated on third-party graphics cards?
  • Create a report using the Intel®️ System Support Utility (Intel®️ SSU)  


Best regards, 

Jean O.  

Intel Customer Support Technician


0 Kudos
Jean_Intel
Employee
1,181 Views

Hello fazooladmi,


I hope you are doing fine.


Were you able to check the previous post?

Let us know if you still need assistance.


Best regards, 

Jean O.  

Intel Customer Support Technician


0 Kudos
Jean_Intel
Employee
1,174 Views

Hello fazooladmi,

 

I hope you are doing fine.

 

I have not heard back from you. So we will close this thread. If you need any additional information, submit a new question, as this thread will no longer be monitored.

 

Best regards.

Jean O. 

Intel Customer Support Technician.


0 Kudos
Reply