안녕하세요 여러분, 지금 코딩하는 데 문제가 있습니다. 문제는 내 #Include <glut.h>
파일이 미리 컴파일 된 머리글 사용을 찾을 때 건너 뜁니다. 해결 방법을 찾을 수 없습니다.OpenGL 미리 컴파일 된 헤더 건너 뛰기
#include <D:/GL/glut.h>
#include <stdafx.h>
#include <stdlib.h>
#include <malloc.h>
#include <math.h>
using namespace System;
void drawScene(void)
{
int i, j;
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(0.0, 0.0, 0.0);
glLoadIdentity();
glTranslatef(0.0, 0.0, -25.0);
glutWireCube(5.0); // Box.
glColor3f(1.0, 0.0, 0.0);
for(i=5; i<5; i++)
{
for (j = -5; j < 5; j++)
{
glPushMatrix();
glTranslatef(i*5, j*5, -35.0);
glColor3f(1.0, 1.0, 0);
glutSolidCube(5.0);
glColor3f(0.0, 0.0, 1.0);
glutWireCube(5.0);
glPopMatrix();
}
}
glFlush();
}
void setup(void)
{
glClearColor(1.0, 1.0, 1.0, 0.0);
}
void resize (int w, int h)
{
glViewport(0, 0, (GLsizei)w, (GLsizei)h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-10.0, 10.0, -10.0, 10.0, 10.0, 100.0);
glMatrixMode(GL_MODELVIEW);
}
void KeyInput(unsigned char key, int x, int y)
{
switch(key)
{
case 27:
exit(0);
break;
default:
break;
}
}
int main(int argc, char **argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
glutInitWindowSize(500,500); /* Size of the Program Window */
glutInitWindowPosition(100,100);
glutCreateWindow("Voxel Assignment");
setup();
glutDisplayFunc(drawScene);
glutReshapeFunc(resize);
glutKeyboardFunc(KeyInput);
glutMainLoop();
return 0;
}
왜이 질문에 모든 코드를 넣으시겠습니까? 코드의 대부분은 문제에 관한 것이 아닙니다 ... –
'#include'<- no. 아니. –
코딩 부분인지 또는 실제로 헤더 파일과 관련이 있는지 알지 못했습니다. : P – Angelrawzz