Jump to content
  • Advertisement

tomsh

Member
  • Content Count

    23
  • Joined

  • Last visited

Community Reputation

99 Neutral

About tomsh

  • Rank
    Member
  1. http://www.sendspace.com/file/69hs0d 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. tomsh

    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. tomsh

    border texture

    Thanks, I had already tried that. It doesn't work. I didn't understand what you asked.
  4. tomsh

    border texture

    The texture doesn't have a border, she looks normal. And here one of the coordinate's code for example: 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(); 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: textur[fNum] = SOIL_load_OGL_texture ( (char*)fName.c_str(), SOIL_LOAD_AUTO, SOIL_CREATE_NEW_ID, SOIL_FLAG_MIPMAPS | SOIL_FLAG_INVERT_Y ); thanks.
  6. tomsh

    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. tomsh

    rotate

    when I rotate the player it draws tree black lines: When I don't rotate the player, he doesn't have this lines... This the rotate 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);
  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.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); } init func of opengl: 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); gltexload func: (load texture with sfml) 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; } resize opengl glViewport(0, 0, width, height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(90.0f, float(width) / float(height), 1.0f, 500.0f); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); This is in the start of the render func: glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); I don't think there is more relevant code...
  11. I think I didn't understand what you said. the textures are png, I loaded them with sfml. texture[fNum].LoadFromFile(fName)
  12. Hey. I tried to delete the background of texture, 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(); So it deleted it... but it draws other background inplace... It draw the glClearColor glClearColor(0.f, 1.f, 0.f, 0.1f); but I want it [font=Arial,]transparent.[/font] [font=Arial,] [/font] [font=Arial,] [/font] [font=Arial,]You see the green background they have?[/font][font="Arial,"][size=2] [/font]
  13. tomsh

    rotate opengl

    I fixed it like that: 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); It rotate only the texture, and not all..
  14. tomsh

    rotate opengl

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

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!