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

[OpenGL] Wczytywanie tekstur

Ostatnio zmodyfikowano 2014-01-14 15:50
Autor Wiadomość
newbieWinApi
Temat założony przez niniejszego użytkownika
[OpenGL] Wczytywanie tekstur
» 2014-01-04 14:56:47
Witam. Mam problem z wczytaniem tekstury do programu. Pliki sa 256x256 . Chodzi oto ze codeblocks nie wyrzuca bledow a mimo to nie widze swojej tekstury w programie.

Program ten to ma wczytac teksture i z niej zrobic np trawe do tego pseudo osiedla domkow :)

Prosze o jakies wskazowki bo nie bardzo sie lapie w OGl-u.

oto kod nie jest trudny wrecz standardowy ale nwm jak .cpp wrzucic :)

C/C++
#ifdef __WIN32__
#include <windows.h>
#endif

#include <cstdio>

#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif

#include <GL/imageloader.h>
#include <stdlib.h>
#include <math.h>
#include <string>
GLuint textureId;
int button_state = GLUT_UP;
int button_x, button_y;
int object = 3, object_Podloga = 1;

float kat = 0, kat2 = 0, delta_kat = 0, delta_kat_m_1 = 0, delta_kat_m_2 = 0, ratio;
float delta_ruch;
float x = 0, y = 1, z = 0;
float lx = 0, ly = 0, lz =- 1;

static int spin = 0;

static float day_ziemia = 0, year_ziemia = 0;
static float tp, ta, td;
static float dt;





//tekstury
GLuint tekstury[ 4 ];

GLuint _textureId;

GLuint loadTex( Image * image )
{
    GLuint textureId;
    glGenTextures( 1, & textureId );
    glBindTexture( GL_TEXTURE_2D, textureId );
    glTexImage2D( GL_TEXTURE_2D, //1,2D
    0, //poziom szczegó³ów level, jak nie 0 to tylko przy mipmap
    GL_RGB, //iloœæ wartoœci koloru u¿ytych dla ka¿dego piksela
    image->width, image->height, //rozmiar obrazu tekstury.
    0,
    GL_RGB,
    GL_UNSIGNED_BYTE, //typ danych dla wartoœci pikseli
    image->pixels );
    return textureId;
}
//Image* image = loadBMP("g.bmp");
void wczytajTekstury( char plik[], GLuint & tekstura )
{
    Image * image = loadBMP( plik ); //£aduje bitmape z pliku
    _textureId = loadTex( image );
    delete image;
}

void zorietujMnie( float ang )
{
    lx = sin( ang );
    lz = - cos( ang );
    glLoadIdentity();
    gluLookAt( x, y, z,
    x + lx, y + ly, z + lz,
    0, 1, 0 );
}
//-----------------------------------
void plaskiRuch( float i )
{
    x = x + i *( lx ) * 0.1;
    z = z + i *( lz ) * 0.1;
    glLoadIdentity();
    gluLookAt( x, y, z,
    x + lx, y + ly, z + lz,
    0, 1, 0 );
}
//-----------------------------------
static void resize( int width, int height )
{
    if( height == 0 )
    {
        height = 1;
    }
   
    ratio = width / height;
   
    glViewport( 0, 0, width, height );
    glMatrixMode( GL_PROJECTION );
    glLoadIdentity();
    gluPerspective( 45, ratio, 1, 1000 );
   
    glMatrixMode( GL_MODELVIEW );
    glLoadIdentity();
   
    gluLookAt( x, y, z, x + lx, y + ly, z + lz, 0, 1, 0 );
}
//-----------------------------------
static void display( void )
{
   
    const double t = glutGet( GLUT_ELAPSED_TIME ) / 1000.0;
    const double a = t * 90.0;
   
    if( delta_ruch )
    {
        plaskiRuch( delta_ruch );
    }
   
    if( delta_kat )
    {
        kat = kat + delta_kat;
        zorietujMnie( kat );
    }
   
    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
   
    //swiatlo punktowe
    GLfloat light_position[] = { 0, 1.5, 0.5, 1 };
   
    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
   
    glPushMatrix();
    glPushMatrix();
    glRotatef( 50 * day_ziemia, 0, 1, 0 );
    glTranslatef( 0, 1, 50 );
    // glutSolidSphere(1,10,10);
    glLightfv( GL_LIGHT0, GL_POSITION, light_position );
    glPopMatrix();
   
    //tekstury z obrazka
    glEnable( GL_TEXTURE_2D );
    glBindTexture( GL_TEXTURE_2D, _textureId );
    glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
    glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
   
    glBegin( GL_QUADS );
   
   
    glTexCoord2f( 0.0f, 0.0f );
    glVertex3f( - 2.5f, - 2.5f, 2.5f );
    glTexCoord2f( 1.0f, 0.0f );
    glVertex3f( 2.5f, - 2.5f, 2.5f );
    glTexCoord2f( 1.0f, 1.0f );
    glVertex3f( 2.5f, - 2.5f, - 2.5f );
    glTexCoord2f( 0.0f, 1.0f );
    glVertex3f( - 2.5f, - 2.5f, - 2.5f );
   
    glEnd();
   
   
    glDisable( GL_TEXTURE_2D );
   
   
   
    switch( object_Podloga )
    {
    case 1:
        glColor3d( 0, 1, 0 );
        glBegin( GL_POLYGON );
       
       
        for( int i = 0; i < 60; i++ )
        {
            for( int j = 0; j < 60; j++ )
            {
               
                glNormal3f( 0.0, 1.0f, 0.0f );
               
                glTexCoord2f( 0.0f, 0.0f );
                glVertex3f( 0 + j, 0, 0 + i );
                glTexCoord2f( 1.0f, 0.0f );
                glVertex3f( 0 + j, 0, 1 + i );
                glTexCoord2f( 1.0f, 1.0f );
                glVertex3f( 1 + j, 0, 1 + i );
                glTexCoord2f( 0.0f, 1.0f );
                glVertex3f( 1 + j, 0, 0 + i );
            }
        }
       
        glEnd();
       
       
        // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
        // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
        glDisable( GL_TEXTURE_2D );
        break;
       
    case 2:
        glColor3d( 0, 1, 1 );
        glBegin( GL_POLYGON );
       
        for( int i = 0; i < 60; i++ )
        {
            for( int j = 0; j < 60; j++ )
            {
                glVertex3f( 0 + j, 0, 0 + i );
                glVertex3f( 0 + j, 0, 1 + i );
                glVertex3f( 1 + j, 0, 1 + i );
                glVertex3f( 1 + j, 0, 0 + i );
            }
        }
        glEnd();
        break;
       
    case 3:
        glColor3d( 1, 1, 0 );
        glBegin( GL_POLYGON );
       
        for( int i = 0; i < 60; i++ )
        {
            for( int j = 0; j < 60; j++ )
            {
                glVertex3f( 0 + j, 0, 0 + i );
                glVertex3f( 0 + j, 0, 1 + i );
                glVertex3f( 1 + j, 0, 1 + i );
                glVertex3f( 1 + j, 0, 0 + i );
            }
        }
       
        glEnd();
        break;
       
    }
   
    glColor3d( 0, 1, 1 );
   
    glTranslatef( 5, 0, 5 );
   
    switch( object )
    {
        //kula
    case 1:
       
        for( int a = 0; a < 10; a++ )
        {
            for( int b = 0; b < 10; b++ )
            {
                glPushMatrix();
                glTranslatef( a * 5, 1, b * 5 );
                glutSolidSphere( 1.0, 20, 10 );
                glPopMatrix();
            }
        }
        break;
       
        // sto¿ek
    case 2:
        for( int a = 0; a < 10; a++ )
        {
            for( int b = 0; b < 10; b++ )
            {
                glPushMatrix();
                glTranslatef( a * 5, 1, b * 5 );
                glutSolidCone( 1.0, 2.0, 20, 10 );
                glPopMatrix();
            }
        }
        break;
       
        // szeœcian
    case 3:
        for( int a = 0; a < 10; a++ )
        {
            for( int b = 0; b < 10; b++ )
            {
                glColor3f( 0.5, 0.2, 1 );
                glPushMatrix();
                glTranslatef( a * 5, 1, b * 5 );
                glutSolidCube( 2.0 );
                glTranslatef( 0, 2, 0 );
               
                //dach
               
                glBegin( GL_TRIANGLES );
               
                glColor3f( 1, 0, 1 );
                glVertex3f( 0, 1, 0 );
                glVertex3f( - 1, - 1, 1 );
                glVertex3f( 1, - 1, 1 );
               
                glVertex3f( 0, 1, 0 );
                glVertex3f( 1, - 1, 1 );
                glVertex3f( 1, - 1, - 1 );
               
                glVertex3f( 0, 1, 0 );
                glVertex3f( 1, - 1, - 1 );
                glVertex3f( - 1, - 1, - 1 );
               
                glVertex3f( 0, 1, 0 );
                glVertex3f( - 1, - 1, - 1 );
                glVertex3f( - 1, - 1, 1 );
               
                glEnd();
               
                glPopMatrix();
            }
        }
       
       
        glEnd();
       
        break;
       
        // torus
    case 4:
        for( int a = 0; a < 10; a++ )
        {
            for( int b = 0; b < 10; b++ )
            {
                glPushMatrix();
                glTranslatef( a * 5, 1, b * 5 );
                glutSolidTorus( 0.2, 1, 10, 20 );
                glPopMatrix();
            }
        }
        break;
       
        // dwunastoœcian
    case 5:
        for( int a = 0; a < 10; a++ )
        {
            for( int b = 0; b < 10; b++ )
            {
                glPushMatrix();
                glTranslatef( a * 5, 1, b * 5 );
                glutSolidDodecahedron();
                glPopMatrix();
            }
        }
        break;
       
        // czajnik
    case 6:
        for( int a = 0; a < 10; a++ )
        {
            for( int b = 0; b < 10; b++ )
            {
                glPushMatrix();
                glTranslatef( a * 5, 1, b * 5 );
                glutSolidTeapot( 1.0 );
                glPopMatrix();
            }
        }
        break;
       
        // oœmioœcian
    case 7:
        for( int a = 0; a < 10; a++ )
        {
            for( int b = 0; b < 10; b++ )
            {
                glPushMatrix();
                glTranslatef( a * 5, 1, b * 5 );
                glutSolidOctahedron();
                glPopMatrix();
            }
        }
        break;
       
        // czworoœcian
    case 8:
        for( int a = 0; a < 10; a++ )
        {
            for( int b = 0; b < 10; b++ )
            {
                glPushMatrix();
                glTranslatef( a * 5, 1, b * 5 );
                glutSolidTetrahedron();
                glPopMatrix();
            }
        }
        break;
       
        // dwudziestoscian
    case 9:
        for( int a = 0; a < 10; a++ )
        {
            for( int b = 0; b < 10; b++ )
            {
                glPushMatrix();
                glTranslatef( a * 5, 1, b * 5 );
                glutSolidIcosahedron();
                glPopMatrix();
            }
        }
        break;
       
    }
   
    glPopMatrix();
    glFlush();
    glutSwapBuffers();
}
//-----------------------------------
void pressKey( int key, int x, int y )
{
   
    switch( key )
    {
    case GLUT_KEY_LEFT:
        delta_kat = - 0.01;
        break;
    case GLUT_KEY_RIGHT:
        delta_kat = 0.01;
        break;
    case GLUT_KEY_UP:
        delta_ruch = 0.5;
        break;
    case GLUT_KEY_DOWN:
        delta_ruch = - 0.5;
        break;
    }
}
//-----------------------------------
void mouseEntry( int state )
{
    if( state == GLUT_LEFT )
    {
        glClearColor( 1, 0, 0, 1 );
        glutPostRedisplay();
    }
    else
    {
        printf( "Znaki: %c, %c\n", 'h', 68 );
        glClearColor( 1, 1, 1, 1 );
        glutPostRedisplay();
    }
   
}
//-----------------------------------
static void key( unsigned char key, int x, int y )
{
   
    switch( key )
    {
    case 'q':
        exit( 0 );
        break;
        //punktowe swiatlo
       
    case 49:
        glDisable( GL_LIGHT1 );
        glDisable( GL_LIGHT2 );
        glEnable( GL_LIGHT0 );
        break;
       
    case 50:
        glDisable( GL_LIGHT0 );
        glDisable( GL_LIGHT2 );
        glEnable( GL_LIGHT1 );
        break;
    case 51:
        glDisable( GL_LIGHT0 );
        glDisable( GL_LIGHT1 );
        glEnable( GL_LIGHT2 );
        break;
    }
}
//-----------------------------------
void releaseKey( int key, int x, int y )
{
   
    switch( key )
    {
    case GLUT_KEY_LEFT:
    case GLUT_KEY_RIGHT:
        delta_kat = 0;
    case GLUT_KEY_UP:
    case GLUT_KEY_DOWN:
        delta_ruch = 0;
    }
}
//-----------------------------------
// obs³uga ruchu kursora myszki

void MouseMotion( int xm, int ym )
{
    if( button_state == GLUT_DOWN )
    {
        if( ym > button_y + 100 )
        {
            delta_kat_m_1 = 0.02f;
        }
        else if( ym < button_y - 100 )
        {
            delta_kat_m_1 = - 0.02f;
        }
        else if( ym < button_y + 100 && ym > button_y - 100 )
        {
            delta_kat_m_1 = 0.0f;
        }
        kat += delta_kat_m_2;
        lx = sin( kat );
        lz = - cos( kat );
        if( xm > button_x + 100 )
        {
            delta_kat_m_2 = 0.02f;
        }
        else if( xm < button_x - 100 )
        {
            delta_kat_m_2 = - 0.02f;
        }
        else if( xm < button_x + 100 && xm > button_x - 100 )
        {
            delta_kat_m_2 = 0.0f;
        }
        if(( kat2 < 1.54 && delta_kat_m_1 > 0 ) ||( delta_kat_m_1 < 0 && kat2 > - 1.54 ) )
        {
            kat2 += delta_kat_m_1;
            ly = - tan( kat2 );
        }
        glutPostRedisplay();
        glLoadIdentity();
        gluLookAt( x, y, z, x + lx, y + ly, z + lz, 0, 1, 0 );
    }
}

//-----------------------------------
//obsluga przyciskow myszki
void MouseButton( int button, int state, int x, int y )
{
    if( button == GLUT_LEFT_BUTTON )
    {
        // zapamiêtanie stanu lewego przycisku myszki
        button_state = state;
       
        //glRotatef(spin/30,1,0,0);
        glutPostRedisplay();
       
        // zapamiêtanie po³o¿enia kursora myszki
        if( state == GLUT_DOWN )
        {
            button_x = x;
            button_y = y;
        }
       
        else
        {
            delta_kat_m_1 = 0;
            delta_kat_m_2 = 0;
        }
       
       
    }
   
    if( button == GLUT_RIGHT_BUTTON )
    {
        // zapamiêtanie stanu prawego przycisku myszki
        button_state = state;
       
        //glRotatef(spin/30,1,0,0);
        glutPostRedisplay();
       
        // zapamiêtanie po³o¿enia kursora myszki
        if( state == GLUT_DOWN )
        {
            button_x = x;
            button_y = y;
        }
       
    }
   
}
//-----------------------------------
static void idle( void )
{
    // odpowiednie oblicznia dotyczace ruchu kazdego z cial niebieskich
    ta = glutGet( GLUT_ELAPSED_TIME );
    dt = ta - tp;
    tp = ta;
    day_ziemia +=( dt / 1000 );
    year_ziemia += 20 *( dt / 1000 );
   
    glutPostRedisplay();
}
//-----------------------------------
void Menu_1( int value )
{
   
    switch( value )
    {
        //torus
    case 1:
        object = 1;
        break;
    case 2:
        object = 2;
        break;
    case 3:
        object = 3;
        break;
    case 4:
        object = 4;
        break;
    case 5:
        object = 5;
        break;
    case 6:
        object = 6;
        break;
    case 7:
        object = 7;
        break;
    case 8:
        object = 8;
        break;
    case 9:
        object = 9;
        break;
    }
   
}
//-----------------------------------
void Menu_2( int value )
{
    switch( value )
    {
    case 1:
        object_Podloga = 1;
        break;
    case 2:
        object_Podloga = 2;
        break;
    case 3:
        object_Podloga = 3;
        break;
    }
   
}

void Menu_3( int value )
{
    switch( value )
    {
    case 1:
        glClearColor( 0, 1, 0, 1 );
        glutPostRedisplay();
        break;
    case 2:
        glClearColor( 0, 1, 1, 1 );
        glutPostRedisplay();
        break;
    case 3:
        glClearColor( 1, 1, 0, 1 );
        glutPostRedisplay();
        break;
    }
   
}
//-----------------------------------

const GLfloat light_ambient[] = { 0.0f, 0.0f, 0.0f, 1.0f };
const GLfloat light_diffuse[] = { 1.0f, 1.0f, 1.0f, 1.0f };
const GLfloat light_specular[] = { 1.0f, 1.0f, 1.0f, 1.0f };
const GLfloat light_position[] = { 5.0f, 1.0f, 3.0f, 1.0f };

const GLfloat mat_ambient[] = { 0.7f, 0.7f, 0.7f, 1.0f };
const GLfloat mat_diffuse[] = { 0.8f, 0.8f, 0.8f, 1.0f };
const GLfloat mat_specular[] = { 1.0f, 1.0f, 1.0f, 1.0f };
const GLfloat high_shininess[] = { 100.0f };

//swiatlo 2

const GLfloat light_ambient_1[] = { 1.0f, 0.0f, 0.0f, 1.0f };
const GLfloat light_diffuse_1[] = { 1.0f, 0.5f, 1.0f, 1.0f };
const GLfloat light_specular_1[] = { 0.2f, 1.0f, 1.0f, 1.0f };
const GLfloat light_position_1[] = { 5, 5, 5, 0.0f };

const GLfloat mat_ambient_1[] = { 0.7f, 0.7f, 0.7f, 1.0f };
const GLfloat mat_diffuse_1[] = { 0.8f, 0.8f, 0.8f, 1.0f };
const GLfloat mat_specular_1[] = { 1.0f, 1.0f, 1.0f, 1.0f };
const GLfloat high_shininess_1[] = { 100.0f };

//swiatlo 3

GLfloat spot_direction[] = { 0.5, 0.07, - 0.5 };
GLfloat light_position_2[] = { - 2, - 0.3, - 1.5, 1 };

char const * plik = "C:\\Users\\Kamil\\Desktop\\zadanieOGl2\\g.bmp";

int main( int argc, char * argv[] )
{
    glutInit( & argc, argv );
    glutInitWindowSize( 640, 480 );
    glutInitWindowPosition( 10, 10 );
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
   
    glGenTextures( 4, tekstury );
    wczytajTekstury( "C:\\Users\\Kamil\\Desktop\\zadanieOGl2\\g.bmp", tekstury[ 0 ] );
    wczytajTekstury( "C:\\Users\\Kamil\\Desktop\\zadanieOGl2\\g.bmp", tekstury[ 1 ] );
    wczytajTekstury( "C:\\Users\\Kamil\\Desktop\\zadanieOGl2\\g.bmp", tekstury[ 2 ] );
    wczytajTekstury( "C:\\Users\\Kamil\\Desktop\\zadanieOGl2\\g.bmp", tekstury[ 3 ] );
   
    glutCreateWindow( "GLUT Shapes" );
   
    glutReshapeFunc( resize );
    glutDisplayFunc( display );
    glutKeyboardFunc( key );
    glutIdleFunc( idle );
   
    glEnable( GL_CULL_FACE );
    glCullFace( GL_BACK );
   
    glEnable( GL_DEPTH_TEST );
    glDepthFunc( GL_LESS );
   
    glEnable( GL_NORMALIZE );
    glEnable( GL_COLOR_MATERIAL );
    glEnable( GL_LIGHTING );
    // swiatlo 1
   
   
   
    glLightfv( GL_LIGHT0, GL_AMBIENT, light_ambient );
    glLightfv( GL_LIGHT0, GL_DIFFUSE, light_diffuse );
    glLightfv( GL_LIGHT0, GL_SPECULAR, light_specular );
    glLightfv( GL_LIGHT0, GL_POSITION, light_position );
   
   
   
    glMaterialfv( GL_FRONT, GL_AMBIENT, mat_ambient );
    glMaterialfv( GL_FRONT, GL_DIFFUSE, mat_diffuse );
    glMaterialfv( GL_FRONT, GL_SPECULAR, mat_specular );
    glMaterialfv( GL_FRONT, GL_SHININESS, high_shininess );
   
   
    //swiatlo 2
   
    glLightfv( GL_LIGHT1, GL_AMBIENT, light_ambient_1 );
    glLightfv( GL_LIGHT1, GL_DIFFUSE, light_diffuse_1 );
    glLightfv( GL_LIGHT1, GL_SPECULAR, light_specular_1 );
    glLightfv( GL_LIGHT1, GL_POSITION, light_position_1 );
   
   
   
    glMaterialfv( GL_FRONT, GL_AMBIENT, mat_ambient_1 );
    glMaterialfv( GL_FRONT, GL_DIFFUSE, mat_diffuse_1 );
    glMaterialfv( GL_FRONT, GL_SPECULAR, mat_specular_1 );
    glMaterialfv( GL_FRONT, GL_SHININESS, high_shininess_1 );
   
   
    //swiatlo 3  // reflektor
   
   
    glLightfv( GL_LIGHT2, GL_AMBIENT, light_ambient );
    glLightfv( GL_LIGHT2, GL_DIFFUSE, light_diffuse );
    glLightfv( GL_LIGHT2, GL_SPECULAR, light_specular );
    glLightfv( GL_LIGHT2, GL_POSITION, light_position_2 );
    glLightf( GL_LIGHT2, GL_CONSTANT_ATTENUATION, 1 );
    glLightf( GL_LIGHT2, GL_LINEAR_ATTENUATION, 0 );
    glLightf( GL_LIGHT2, GL_QUADRATIC_ATTENUATION, 0 );
   
    glLightf( GL_LIGHT2, GL_SPOT_CUTOFF, 45 );
    glLightfv( GL_LIGHT2, GL_SPOT_DIRECTION, spot_direction );
    glLightf( GL_LIGHT2, 128, 2 );
   
   
    glMaterialfv( GL_FRONT, GL_AMBIENT, mat_ambient );
    glMaterialfv( GL_FRONT, GL_DIFFUSE, mat_diffuse );
    glMaterialfv( GL_FRONT, GL_SPECULAR, mat_specular );
    glMaterialfv( GL_FRONT, GL_SHININESS, high_shininess );
   
   
    glutIgnoreKeyRepeat( 1 );
    glutSpecialFunc( pressKey );
    glutSpecialUpFunc( releaseKey );
    glutMotionFunc( MouseMotion );
    glutMouseFunc( MouseButton );
   
    //wczytywanie pliku z dysku
   
   
   
    glutEntryFunc( mouseEntry );
   
    // utworzenie podmenu - obiekt
    int MenuObject_1 = glutCreateMenu( Menu_1 );
    glutAddMenuEntry( "Kula", 1 );
    glutAddMenuEntry( "Stozek", 2 );
    glutAddMenuEntry( "Szescian", 3 );
    glutAddMenuEntry( "Torus", 4 );
    glutAddMenuEntry( "Dwunastoœcian", 5 );
    glutAddMenuEntry( "Czajnik", 6 );
    glutAddMenuEntry( "Oœmioœcian", 7 );
    glutAddMenuEntry( "Czworoœcian", 8 );
    glutAddMenuEntry( "Dwudziestoœcian", 9 );
   
    //drugie podmenu
    int MenuObject_2 = glutCreateMenu( Menu_2 );
    glutAddMenuEntry( "Zielony", 1 );
    glutAddMenuEntry( "Niebieki", 2 );
    glutAddMenuEntry( "Zolty", 3 );
   
    //trzecie podmenu
    int MenuObject_3 = glutCreateMenu( Menu_3 );
    glutAddMenuEntry( "Zielony", 1 );
    glutAddMenuEntry( "Niebieki", 2 );
    glutAddMenuEntry( "Zolty", 3 );
   
   
    // menu g³ówne
    glutCreateMenu( Menu_1 );
    glutAddSubMenu( "Wybierz figure", 1 );
    glutAddSubMenu( "Wybierz kolor podloza", 2 );
    glutAddSubMenu( "Wybierz kolor tla", 3 );
   
    // okreœlenie przycisku myszki obs³uguj¹cego menu podrêczne
    glutAttachMenu( GLUT_RIGHT_BUTTON );
   
    glutMainLoop();
   
    return EXIT_SUCCESS;
}
P-101104
DejaVu
» 2014-01-14 13:51:49
Jesteś pewien, że plik jest w formacie zapisany w formacie *.bmp za pomocą np. mspaint-a?
P-102143
Bimbol
» 2014-01-14 15:50:52
Nadpisz te pliki w mspaincie, wtedy zadziała ;)
P-102156
« 1 »
  Strona 1 z 1