dravim, pri vytvarani okna pre OpenGL mi vzdy po zacati komplicie vybehne chyba...
------ Build started: Project: ALOpenGl, Configuration: Debug Win32 ------
Compiling...
ALOpenGl.cpp
c:\documents and settings\xxxx\dokumenty\visual studio 2005\projects\alopengl\alopengl\alopengl.cpp(59) : fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
Build log was saved at "file://c:\Documents and Settings\xxxx\Dokumenty\Visual Studio 2005\Projects\ALOpenGl\ALOpenGl\Debug\BuildLog.htm"
ALOpenGl - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
zdrojak...
#include <allegro.h>
#include <GL/glu.h>
#include <alleggl.h>
bool InitGL(GLvoid)
{
int width = 640;
int height = 480;
glViewport(0,0,width,height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,0.1f,100.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
return true;
}
bool DrawGLScene(GLvoid)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glBegin(GL_TRIANGLES);
glColor3ub(255, 0, 0);
glVertex3f(-1.0f, -1.0f, -5.0f);
glColor3ub(0, 255, 0);
glVertex3f( 1.0f, -1.0f, -5.0f);
glColor3ub(0, 0, 255);
glVertex3f( 0.0f, 1.0f, -5.0f);
glEnd();
allegro_gl_flip();
return true;
}
int main()
{
allegro_init();
install_allegro_gl();
allegro_gl_clear_settings();
allegro_gl_set(AGL_Z_DEPTH, 16);
allegro_gl_set(AGL_DOUBLEBUFFER, 1);
allegro_gl_set(AGL_COLOR_DEPTH, 16);
allegro_gl_set(AGL_SUGGEST,
AGL_Z_DEPTH | AGL_DOUBLEBUFFER | AGL_COLOR_DEPTH);
set_color_depth(16);
}
if (set_gfx_mode(GFX_OPENGL_FULLSCREEN, 640, 480, 0, 0) < 0)
{
allegro_message ("Neviem nastavit graficky mod:\n%s\n",
allegro_error);
return -1;
}
install_keyboard();
InitGL();
while (DrawGLScene())
{
if (key[KEY_ESC])
break;
}
return 0;
}
END_OF_MAIN();
za rady dakujem smiling smiley
|