InitialCode.txt
Dosyayı İndir
#include <Windows.h>
#include <GL\glew.h>
#include <GL\freeglut.h>
#include <iostream>
using namespace std;
void changeViewPort(int w, int h)
{
glViewport(0, 0, w, h);
}
void render()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glutSwapBuffers();
}
int main(int argc, char* argv[]) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);
glutInitWindowSize(600, 480);
glutCreateWindow("Merhaba OpenGL");
glutReshapeFunc(changeViewPort);
glutDisplayFunc(render);
GLenum err = glewInit();
if (GLEW_OK != err) {
fprintf(stderr, "Yanlışlık oldu.");
return 1;
}
glutMainLoop();
return 0;
}
Dosyayı İndir