0

I got this error while doing OpenGL project

const char * is incompatible with parameter of type char *

//  variables representing the window size
int window_width = 706;
int window_height = 706;
//  variable representing the window title
const char *window_title = "Snake";
void init_setup(int width, int height, char *windowName)
{
    glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
    centerOnScreen();
    glutInitWindowSize(window_width, window_height);// init. window size
    glutInitWindowPosition(window_x, window_y); // init. window position
    glutCreateWindow(windowName);   // window name
    glutReshapeFunc(reshape_handler);  // sets the reshape call back
}    // end of init_setup()

int main(int argc, char **argv)
{
glutInit(&argc, argv);
init_setup(window_width, window_height, window_title); //ERROR OCCURS HERE
glutMainLoop();
}
James Z
  • 12,209
  • 10
  • 24
  • 44

0 Answers0