Panel użytkownika
Nazwa użytkownika:
Hasło:
Nie masz jeszcze konta?

[AllegroGL] Problem z kompilacją

Ostatnio zmodyfikowano 2010-01-29 10:14
Autor Wiadomość
wojownik266
Temat założony przez niniejszego użytkownika
[AllegroGL] Problem z kompilacją
» 2010-01-29 10:09:47
Czy ktoś wie dlaczego poniższy program nie chce się skompilować pod devC++ i mógłby wskazać rozwiązanie?


C/C++
#include <allegro.h>
#include <alleggl.h>
#include <GL\gl.h>
#include <GL\glu.h>
#include <windows.h>
#include <stdlib.h>
using namespace std;

struct sample_MATERIAL
{
    GLfloat ambient[ 3 ];
    GLfloat diffuse[ 3 ];
    GLfloat specular[ 3 ];
    GLfloat emission[ 3 ];
    GLfloat alpha;
    GLfloat phExp;
    int texture;
};

static sample_MATERIAL materials[ 1 ] = {
    { { 0.117647f, 0.117647f, 0.117647f }, { 1.0f, 0.501961f, 0.0f }, { 0.301176f, 0.301176f, 0.301176f },
        { 0.0f, 0.0f, 0.0f }, 1.0f, 8.0f, - 1 } //Material #1
};

// 0 Verticies
// 0 Texture Coordinates
// 0 Normals
// 0 Triangles

static BYTE face_indicies[ 1 ][ 0 ] = {
    GLint Gen3DObjectList()
    {
        int i;
        int j;
       
        GLint lid = glGenLists( 1 );
        glNewList( lid, GL_COMPILE );
       
        glBegin( GL_TRIANGLES );
        for( i = 0; i < sizeof( face_indicies ) / sizeof( face_indicies[ 0 ] ); i++ )
        {
            for( j = 0; j < 3; j++ )
            {
                int vi = face_indicies[ i ][ j ];
                int ni = face_indicies[ i ][ j + 3 ]; //Normal index
                int ti = face_indicies[ i ][ j + 6 ]; //Texture index
                glNormal3f( normals[ ni ][ 0 ], normals[ ni ][ 1 ], normals[ ni ][ 2 ] );
                glTexCoord2f( textures[ ti ][ 0 ], textures[ ti ][ 1 ] );
                glVertex3f( vertices[ vi ][ 0 ], vertices[ vi ][ 1 ], vertices[ vi ][ 2 ] );
            }
        }
       
        glEnd();
       
        glEndList();
        return lid;
       
    };
   
   
    int main() {
       
        /* Initialize both Allegro and AllegroGL */
        allegro_init();
        install_allegro_gl();
       
        /* Tell Allegro we want to use the keyboard */
        install_keyboard();
       
        /* Suggest a good screen mode for OpenGL */
        allegro_gl_set( AGL_Z_DEPTH, 8 );
        allegro_gl_set( AGL_COLOR_DEPTH, 16 );
        allegro_gl_set( AGL_SUGGEST, AGL_Z_DEPTH | AGL_COLOR_DEPTH );
       
        /* Set the graphics mode */
        set_gfx_mode( GFX_OPENGL_WINDOWED, 800, 600, 0, 0 );
       
        /* Clear the screen */
        glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
       
        /* Set up the view frustum */
        glMatrixMode( GL_PROJECTION );
        glLoadIdentity();
        glFrustum( - 1.0, 1.0, - 1.0, 1.0, 1, 60.0 );
       
        /* Draw a quad using OpenGL */
       
        face_indicies[ 0 ][ 0 ];
       
       
        /* Flip the backbuffer on screen */
        allegro_gl_flip();
       
        /* Wait for the user to press a key */
        readkey();
       
        /* Finished. */
        return 0;
    }
    END_OF_MAIN();
P-13372
malan
» 2010-01-29 10:14:33
C/C++
#include <allegro.h>
#include <winalleg.h>
#include <alleggl.h>
#include <GL\gl.h>
#include <GL\glu.h>
#include <stdlib.h>
P-13373
« 1 »
  Strona 1 z 1