• Advertisement

Kchaa

Member
  • Content count

    34
  • Joined

  • Last visited

Community Reputation

138 Neutral

About Kchaa

  • Rank
    Member
  1. Shorter isn't always better. It's nice at first to make your main function and game loop look pretty basic but unless you're doing all the error checking under the hood -- problems are bound to happen.
  2. Why does it matter why he wants to do it? Why not just provide him with the information he requests if you know it instead of making him justify his purpose for using it? Thanks for posting the solution DummyInput, even if you had to dig it up yourself.
  3. I figured it out, so stupid of me. I declared a static variable in the code that checks against time to see if it is okay to flip to the next frame of animation and one animation would flip and reset that static variable... My apologies for taking up anyone's time. :[[
  4. I am working on an Animation class so I can render multiple textured quads on screen at a time and I have run into quite the strange issue with my application. I declare two instances of the Animation class and when I run them both, both pictures appear on the screen, only one is animating. I found that if I swirl my mouse around the screen they both animate but slowly. I have a feeling this has to do with my rendering of Quads, which Animation just contains a list of quads. Can anyone tell me any ideas to look into? Providing my Quad rendering code just because I have a hunch it may be here: GLvoid CQuad::Render() { glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); glTranslatef( m_fPosX, m_fPosY, m_fPosZ ); glRotatef( m_fRotation, 1.0f, 1.0f, 1.0f ); if( m_pTexture->GetHandle() != 0 ) glBindTexture( GL_TEXTURE_2D, m_pTexture->GetHandle() ); glBegin( GL_QUADS ); glColor4f( 1.0f, 1.0f, 1.0f, 1.0f ); glTexCoord2f( 0.0f, 0.0f ); glVertex3f( -.5f * m_iWidth, .5f * m_iHeight, 0.0f ); glTexCoord2f( 1.0f, 0.0f ); glVertex3f( .5f * m_iWidth, .5f * m_iHeight, 0.0f ); glTexCoord2f( 1.0f, 1.0f ); glVertex3f( .5f * m_iWidth, -.5f * m_iHeight, 0.0f ); glTexCoord2f( 0.0f, 1.0f ); glVertex3f( -.5f * m_iWidth, -.5f * m_iHeight, 0.0f ); glEnd(); }
  5. Automatic rendering?

    Quote:Original post by pkiskool And I tried your suggested code, but it won't recognize "IncreaseTimerWithOneSecond();" function. Not sure why? I think he meant to use the function you use to increment the time step by a second.
  6. I would suggest everyone who has access to the actual game Portal, particularly original poster, to play the game in developer's commentary mode. They explain how the physics and rendering of portals works. I recall hearing something about the stencil buffer and not rendering the entire scene but only what the player could see. Please don't quote me on that but definitely check it out! EDIT: Blegh, just saw a mention of the commentary in a previous reply...
  7. Personally I prefer SOIL for loading images. It gives you the texture handle instead of having to deal with conversion also does POT changes for you. If you decide to use it and need any help, shoot me a message.
  8. [C++] Timestep Issue (?)

    After tampering with the HGE samples I found that the problem I have persists even in the samples. I don't think I will be using this engine any longer. Sorry to waste anyone's time.
  9. [C++] Timestep Issue (?)

    Quote:Please post the code that handles the movement and the code that calculates the time delta. The time delta code is an engine-created code. The movement code is here: void CSprite::Update( float dt ) { if( hge->Input_GetKeyState( HGEK_LEFT ) ) { rotation += 5.0f * dt; if( rotation >= ( 2 * M_PI ) ) rotation = 0; } if( hge->Input_GetKeyState( HGEK_RIGHT ) ) { rotation -= 5.0f * dt; if( rotation <= 0 ) rotation = (2 * M_PI); } if( hge->Input_GetKeyState( HGEK_UP ) ) { if( velocity < MAX_VELOCITY ) velocity += 10.0f; if( velocity > MAX_VELOCITY ) velocity = MAX_VELOCITY; } if( hge->Input_GetKeyState( HGEK_DOWN ) ) { if( velocity > 0 ) velocity -= 10.0f; if( velocity < 0 ) velocity = 0; } posX = posX - ( velocity * sin(rotation) ) * dt; posY = posY - ( velocity * cos(rotation) ) * dt; //Update Position quad.v[0].x = posX - 32; quad.v[0].y = posY - 32; quad.v[1].x = posX + 32; quad.v[1].y = posY - 32; quad.v[2].x = posX + 32; quad.v[2].y = posY + 32; quad.v[3].x = posX - 32; quad.v[3].y = posY + 32; } Thanks for taking the time to reply and assist.
  10. [C++] Timestep Issue (?)

    Hey everyone, I am currently having an issue with a very simple program I am writing. The program creates a sprite and, based on input, can rotate the sprite in 360 degrees and based on rotation propel the sprite forward in the direction of rotation. (Think Asteroids) The issue occurs when I run the application and begin moving the sprite around. Every second or so I get a hiccup in movement, depending on the FPS of the application. At 1000 FPS the program seems to run smoothly but just looking at the image as I fly it around my eyes can't focus on the image. When the FPS are reduced to anything below 1000, be it on a different computer at max ability or when I choke my FPS on my gaming system, the movement gets more and more sluggish and jittery. From other help I have received in the chat and just personal experimentation with the code I have done the following: - Multiplied any coordinate translations by a delta value (time since last logic update) I would also like to note that I am use Haaf's Game Engine (HGE) and the way this engine works is that the FrameFunc (logic update) and RenderFunc (rendering update) is called consecutively as many times per frame as possible. So for every logic update--there is a render. Hope you guys can help me out and I am willing to provide code/executables if requested. Appreciate your time in advance.
  11. Appreciate the responses. Solved my problem!
  12. What would be an efficient way to check if every element in a large array has a value other than 0? I was thinking a for loop but not quite sure how I would implement that without using an exit statement. Your suggestions please.
  13. gaudy chess sets

    What programming language are you working in? ;)
  14. The program compiles fine. The error says: Run-Time Check Failure #3 - The variable 'b' is being used without being defined. The program window is behind this error, the program compiles fine with one warning: uninitialized local variable 'b' used I don't think the declaration of Base b in the function definition is calling the default constructor for some reason. Perhaps the compiler?
  15. Quote:It's a compile-time error - what do you mean by 'I'm getting the same error at run time'? The program compiles fine but after it begins running (console window open) it will crash out. Much like when a program you're running brings up that annoying "Send Error Report" error on windows XP.
  • Advertisement