GLUT fullscreen issues

i am very new to opengl/glut, and am having trouble going full screen. whenever i run the code it screws up my screen, but it compiles fine. here is my code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#define FREEGLUT_STATIC
#define GLEW_STATIC

#include <GL/glew.h>
#include <GL/freeglut.h>
#include <SOIL/SOIL.h>

void draw() {
    GLuint tex_2d = SOIL_load_OGL_texture("menu.jpg", SOIL_LOAD_AUTO, SOIL_CREATE_NEW_ID, SOIL_FLAG_MIPMAPS | SOIL_FLAG_INVERT_Y | SOIL_FLAG_NTSC_SAFE_RGB | SOIL_FLAG_COMPRESS_TO_DXT);

    glutSwapBuffers();
    glutPostRedisplay();
}

int main(int argc, char *argv[]) {
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA);
    glutInitWindowSize(600, 600);
    glutCreateWindow("Sword Art Online");
    glutFullScreen();
    glutDisplayFunc(draw);

    glutMainLoop();

    return 0;
}
Topic archived. No new replies allowed.