Jump to content

  • Log In with Google      Sign In   
  • Create Account


mentaman

Member Since 07 Oct 2011
Offline Last Active Apr 18 2012 09:49 AM

Topics I've Started

Pirate Land(C++ and openGL)

16 March 2012 - 09:49 AM

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

border texture

13 March 2012 - 11:32 AM

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.

opengl mouse, sdl

07 February 2012 - 02:44 AM

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!

rotate

22 December 2011 - 04:59 AM

when I rotate the player it draws tree black lines:
Posted Image


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);

texture, background delete

21 December 2011 - 01:46 AM

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


Posted Image

You see the green background they have?



PARTNERS