Hello,
I’m an ultra beginner in openGL I’m doing a program that is supposed to show a square using GL_QUADS but it only shows a white background and whenever I try to resize the window this white background doesn’t fill the window
I tried not using vertex2f instead of vertex3f, trying to draw another preemptive with another argument in glbegin and even commenting all the code in drawScene but still they all gave me the same result
#include <stdlib.h>
#include <stdio.h>
#include <gl\glut.h>
void drawScene()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glColor3f( 1.0, 1.0, 1.0 );
glClearColor(0.0, 0.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex3f(1.5, 2.0, 2.0);
glVertex3f(1.5, 1.0, 2.0);
glVertex3f(2.0, 1.0, 2.0);
glVertex3f(2.0, 2.0, 2.0);
glEnd();
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowPosition(20, 60);
glutInitWindowSize(360, 360);
glutCreateWindow("Open GL");
glutReshapeFunc(resizeWindow);
glutDisplayFunc(drawScene);
glutMainLoop();
return 0;
}
[ATTACH=CONFIG]657[/ATTACH]
[ATTACH=CONFIG]658[/ATTACH]