• Advertisement

tomsh

Member
  • Content count

    23
  • Joined

  • Last visited

Community Reputation

99 Neutral

About tomsh

  • Rank
    Member
  1. [url="http://www.sendspace.com/file/69hs0d"]http://www.sendspace.com/file/69hs0d[/url] My game is called "Pirate Land". I would be happy for any ideas to the games or tips, could you help me? it's about a trader whose ship is destroyed by pirates and gets stuck on an island. Now he need to fix his ship, to do that you needget all 10 peices. kill the general, recognizable by 3 blue circles and get the chest with the map to the final piece. I don't thing I need a help with my code, so I won't publish him. F3 for buttons...
  2. OpenGL border texture

    Oh, no. It happend too with images which has only one part. What information do you need about the picture? Can it help you if I show you a screenshot?
  3. OpenGL border texture

    [quote name='6itru' timestamp='1331708440' post='4921896'] i had the same ;p try add something like this after image loading [CODE] glBindTexture(GL_TEXTURE_2D, textur[fNum]); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); [/CODE] [/quote] Thanks, I had already tried that. It doesn't work. [quote name='Hodgman' timestamp='1331711613' post='4921901'] So you've got many small images packed next to each other in a single texture? And when you render quads using these sub-images, the edges of the next sub-image bleed into your quad? [/quote] I didn't understand what you asked.
  4. OpenGL border texture

    The texture doesn't have a border, she looks normal. And here one of the coordinate's code for example: [code] glBegin(GL_QUADS); //create polygon glTexCoord2f((part/maxParts), 0.0f);glVertex2d(x, y); glTexCoord2f(((part+1.f)/maxParts), 0.0f);glVertex2d(x2, y); glTexCoord2f(((part+1.f)/maxParts), 1.0f);glVertex2d(x2, ny2); glTexCoord2f((part/maxParts), 1.0f);glVertex2d(x, ny2); glEnd(); [/code] the variables are float. I thought maybe it because one of them isn't excatly 1.f but it happend in the y too, and I checked with 1.f, and still happend.
  5. Hello, I'm using opengl and load my textures with soil. When I render my square, it makes a border to the texture. Here the code of the soil's load: [code] textur[fNum] = SOIL_load_OGL_texture ( (char*)fName.c_str(), SOIL_LOAD_AUTO, SOIL_CREATE_NEW_ID, SOIL_FLAG_MIPMAPS | SOIL_FLAG_INVERT_Y ); [/code] thanks.
  6. OpenGL opengl mouse, sdl

    Thank you a lot
  7. How can I resize the sdl mouse size, to opengl size. window's with: 640, window's height: 480 prespective: gluPerspective( 60.0, ratio, 1.0, 1024.0 ); glTranslatef( 0.f, 0.f, -25.f ); thanks a lot!
  8. rotate

    when I rotate the player it draws tree black lines: [img]http://img215.imageshack.us/img215/369/rotatex.png[/img] When I don't rotate the player, he doesn't have this lines... This the rotate code: [code]if(ySpeed != 0 || xSpeed != 0) deg = fmod(atan2(yP-(yP+ySpeed),xP-(xP+xSpeed))/3.14159265f*180.f,360.f); glPushAttrib(GL_TRANSFORM_BIT); glMatrixMode(GL_TEXTURE); glLoadIdentity(); glPushMatrix(); glTranslatef(0.5f, 0.5f, 0.f); glRotatef(deg, 0.f, 0.f, 1.f); glTranslatef(-0.5f,-0.5f, 0.f); glMatrixMode(GL_MODELVIEW); glPopAttrib(); glEnable (GL_BLEND); glColor4f(1.0f,1.0f,1.0f,1.0f); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBegin(GL_QUADS); //draw... glTexCoord2d(1.0,1.0);glVertex3f( xP, yP2, 0); glTexCoord2d(0.0,1.0);glVertex3f( xP2, yP2, 0); glTexCoord2d(0.0,0.0);glVertex3f( xP2, yP, 0); glTexCoord2d(1.0,0.0);glVertex3f( xP, yP, 0); glEnd(); glMatrixMode(GL_TEXTURE); glPopMatrix(); glMatrixMode(GL_MODELVIEW); glDisable (GL_BLEND);[/code]
  9. I added it just now, for check if it will do something, and forgot to delete it. Without that it still happen. I found what the problem. SFML load the texture as 8 bit...
  10. thanks a lot about the help. here the full code of the draw.[code]if(ySpeed != 0 || xSpeed != 0) deg = fmod(atan2(yP-(yP+ySpeed),xP-(xP+xSpeed))/3.14159265f*180.f,360.f); glMatrixMode(GL_TEXTURE); glLoadIdentity(); glPushMatrix(); glTranslatef(0.5f, 0.5f, 0.f); glRotatef(deg, 0.f, 0.f, 1.f); glTranslatef(-0.5f,-0.5f, 0.f); glMatrixMode(GL_MODELVIEW); glEnable (GL_BLEND); glColor4f(1.0f,1.0f,1.0f,1.0f); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBegin(GL_QUADS); //draw... glTexCoord2d(1.0,1.0);glVertex3f( xP, yP2, 0); glTexCoord2d(0.0,1.0);glVertex3f( xP2, yP2, 0); glTexCoord2d(0.0,0.0);glVertex3f( xP2, yP, 0); glTexCoord2d(1.0,0.0);glVertex3f( xP, yP, 0); glEnd(); glMatrixMode(GL_TEXTURE); glPopMatrix(); glMatrixMode(GL_MODELVIEW); glDisable (GL_BLEND); }[/code] init func of opengl: [code] glClearDepth(1.f); glClearColor(0.f, 1.f, 1.f, 0.f); glEnable(GL_DEPTH_TEST); glDepthMask(GL_TRUE); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(90.f, 1.f, 1.f, 500.f); GlTextLoad("pic.png", 0); //load picture... GlTextLoad("Menu1.png", 1); GlTextLoad("Menu2.png", 2); GlTextLoad("Menu3.png", 3); GlTextLoad("pic1.png", 4); GlTextLoad("pic2.png", 5); GlTextLoad("Back.png", 6); glEnable(GL_TEXTURE_2D);[/code] gltexload func: (load texture with sfml) [code]bool WinS::GlTextLoad(char* fName, int fNum) { if(!texture[fNum].LoadFromFile(fName)) { MessageBox(NULL, "Can't load the texture...", "Eror", MB_OK); Running = false; return false; } texture[fNum].CreateMaskFromColor(sf::Color(1, 1, 1 , 0)); return true; }[/code] resize opengl [code]glViewport(0, 0, width, height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(90.0f, float(width) / float(height), 1.0f, 500.0f); glMatrixMode(GL_MODELVIEW); glLoadIdentity();[/code] This is in the start of the render func: [code] glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_MODELVIEW);[/code] I don't think there is more relevant code...
  11. [img]http://img249.imageshack.us/img249/8509/picxj.png[/img] this is the picture
  12. I think I didn't understand what you said. the textures are png, I loaded them with sfml. [code]texture[fNum].LoadFromFile(fName)[/code]
  13. Hey. I tried to delete the background of texture, [code] glEnable (GL_BLEND); glColor4f(1.0f,1.0f,1.0f,1.0f); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBegin(GL_QUADS); //draw... glTexCoord2d(1.0f,1.0f);glVertex3f( xP, yP2, 0); glTexCoord2d(0.0f,1.0f);glVertex3f( xP2, yP2, 0); glTexCoord2d(0.0f,0.0f);glVertex3f( xP2, yP, 0); glTexCoord2d(1.0f,0.0f);glVertex3f( xP, yP, 0); glEnd();[/code] So it deleted it... but it draws other background inplace... It draw the glClearColor [code]glClearColor(0.f, 1.f, 0.f, 0.1f);[/code] but I want it[size="2"] [font=Arial,]transparent.[/font][/size] [size="2"][font=Arial,] [/font][/size] [size="2"][font=Arial,][img]http://img151.imageshack.us/img151/7334/44130636.png[/img] [/font][/size] [size="2"][font=Arial,]You see the green background they have?[/font][/size][left][font="Arial,"][size=2] [/size][/font][/left]
  14. rotate opengl

    I fixed it like that: [code] glMatrixMode(GL_TEXTURE); glLoadIdentity(); glPushMatrix(); glTranslatef(0.5f, 0.5f, 0.f); glRotatef(deg, 0.f, 0.f, 1.f); glTranslatef(-0.5f,-0.5f, 0.f); glMatrixMode(GL_MODELVIEW); [/code] It rotate only the texture, and not all..
  15. rotate opengl

    I already tried that, but it still weird.
  • Advertisement