• Content count

  • Joined

  • Last visited

Community Reputation

157 Neutral

About Zen721

  • Rank
  1. OpenGL Menu

    I dont know where is a problem i made a class where i declareted function for glutMouseFunc When i call it i have error error C2664: 'glutMouseFunc' : cannot convert parameter 1 from 'void (int,int,int,int)' to 'void (__cdecl *)(int,int,int,int)' but when i make it not in class but structural everything is OK
  2. OpenGL Menu

    I will try it later because i m going to make some songs in my studio But thanks It should help me like I see
  3. OpenGL Menu

    Anyone knows how to make this: When i Click on Quad with texture it will be do some instructions (in OpenGL with glut) Maybe some tutorials ... Please reply.
  4. Workspace Quad

    OK Thats what i want to know Keep On Cooding thanks :)
  5. How should i write a code if i want to make a quad that will be as same size as my workspace (2D) with function glBegin(GL_QUADS) //which parameters i have to have whit reshape func ??? i dont know is this question is good
  6. When i run this code my texture and quad is still flushing it is not render smooth i'm using glut library to display objects... void display() { GLuint MenuList; MenuList = glGenLists(1); glNewList(MenuList, GL_COMPILE); glClear (GL_COLOR_BUFFER_BIT); gluLookAt (0.0, 0.0, -20.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0); glEnable(GL_TEXTURE_2D); zdjecie.inicjalizuj_zdjecia(); zdjecie.wczytaj_zdjecia(); /* glBegin(GL_QUADS); glTexCoord2i(0,0);glVertex2i(0, 0); glTexCoord2i(0,1);glVertex2i(0, 10); glTexCoord2i(1,1);glVertex2i(10, 10); glTexCoord2i(1,0);glVertex2i(10, 0); glEnd(); */ GLint TexArray[] = {0,0,0,1,1,1,1,0}; GLint QuadArray[] = {0,0,0,10,10,10,10,0}; glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glVertexPointer(2,GL_INT, NULL, &QuadArray); glTexCoordPointer(2, GL_INT, NULL, &TexArray); glDrawArrays(GL_QUADS, 0, 8); glFlush(); glEndList(); glCallList(MenuList); glutPostRedisplay(); }
  7. What should i do i want display two other objects with two other textures in one frame with opengl (GL, GLUT) Shoul i use display lists?
  8. First of all check that is your image is in place and check its size (256x256)
  9. Couple of textures on quads

    Maybe i should use display lists???
  10. i have a problem i don't know how to put 2 quads in game loop with textures i have class to load image: ILvoid Menu::LoadMenu() { ilGenImages(1, &texture); ilBindImage(texture); switch(no_pic) { case 1: load = ilLoadImage("data/img/Menu/Starthigh.jpg"); break; case 2: load = ilLoadImage("data/img/Menu/Exit_low.png"); break; } if(load) { wczytallo = ilConvertImage(IL_RGB, IL_UNSIGNED_BYTE); glGenTextures(1,&zdjecie); glBindTexture(GL_TEXTURE_2D, zdjecie); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, ilGetInteger(IL_IMAGE_BPP), ilGetInteger(IL_IMAGE_WIDTH), ilGetInteger(IL_IMAGE_HEIGHT), 0, ilGetInteger(IL_IMAGE_FORMAT), GL_UNSIGNED_BYTE, ilGetData()); } ilDeleteImages(1, &textura); } And now a main game loop: finished = 0; menu_state = 0; menu.nr_zdjecia = 1; while (!finished) { while (SDL_PollEvent(&event)) { switch (event.type) { case SDL_KEYDOWN: if (event.key.keysym.sym == SDLK_ESCAPE){ finished = 1; return 0; } } ///////////////////////////////////////////////////////// /////////MENU///////////// ///Pic 1 glPushMatrix(); menu_state = 1; glTranslatef(256.0,0.0,0.0); menu.check_devIL(); menu.init_menu(); menu.Load_menu(); menu.render_menu(); glPopMatrix(); //Pic 2 glPushMatrix(); if(menu.no_pic = 1){ menu.no_pic = 2; } menu.LoadMenu(); glTranslatef(256.0, 256.0, 0.0); menu.render_menu(); menu.no_pic = 3; glPopMatrix(); } } (in rendermenu() i have function to draw quad with texture) but when i run this i have only one pic (second) and it's still flushing because game loop is working I really need help
  11. Untitled

    Ok i got it in main loop i have to do that: x = 0.0; that's it
  12. Untitled

    i have a problem with this code because the texture is moving all the time but i want to keep it on the place that i declarated in glTranslatef x = 5.0 how should i do it but events have to be in loop this is my code /* Main loop */ finished = 0; while (!finished) { while (SDL_PollEvent(&event)) { switch (event.type) { case SDL_KEYDOWN: if (event.key.keysym.sym == SDLK_ESCAPE){ finished = 1; return 0; } break; } glTranslatef(x, 0.0,0.0); Draw a quad glBegin(GL_QUADS); glTexCoord2i(0, 0); glVertex2i(0, 0); glTexCoord2i(0, 1); glVertex2i(0, 480); glTexCoord2i(1, 1); glVertex2i(640, 480); glTexCoord2i(1, 0); glVertex2i(640, 0); glEnd(); SDL_GL_SwapBuffers(); } }
  13. Main menu

    Good I forgot to give a question but you already said what i wanted to ask :)
  14. DevIL Documentation Pdf

    Ok i found it if anybody will need it: http://prdownloads.sourceforge.net/openil/OpenILDocs.zip