Archived

This topic is now archived and is closed to further replies.

Syrillix

i have no idea whats wrong....

Recommended Posts

ive been working through the opengl tutorials at gametutorials.com and everything was going fine (except for strange windows behaviour) although now im going through the camera tuts and trying to move the camera around but all its doing is disapearing off the screen... Get busy livin'' or get busy dyin''... - Shawshank Redemption

Share this post


Link to post
Share on other sites
you need to be a lot more specific about what the problems are that you''re having. I''ve worked through all those tutorials so I might be able to help you if you give details about what is going wrong.

Share this post


Link to post
Share on other sites
ok now ive sorted out some of the problems.. but when i press the left or right keys the camera goes crazy and starts going around and around and also moving up abit each time. i cant figure it out...
digitec, where exactly do i call glLoadIdentity() right before i start drawing or somewhere else?

Get busy livin'' or get busy dyin''... - Shawshank Redemption

Share this post


Link to post
Share on other sites
thanks for your all your help, My main concern now is getting the frames per second function working from the tutorials
ok, heres a run down for my code

class window
{
//all the windows stuff
//its all public
}

class OGL: public Window
{
//ogl stuff
void RenderScene()
void FrameRate()
}

void OGL::FrameRate()
{
static float FramesPerSec = 0.0;
static float LastTime = 0.0;

static char strFrameRate[50] = {0};

//gets the current time in seconds
float CurrentTime = GetTickCount() * 0.001;

++FramesPerSec;

if((CurrentTime-LastTime) <1.0)
{
LastTime = CurrentTime;
sprintf(strFrameRate,"CurrentFramesPerSec: ",int(FramesPerSec));
SetWindowText(m_hWnd,strFrameRate);

FramesPerSec = 0;
}
}

void OGL::RenderScene
{
//....
....
FrameRate();
}

For some strange (annoying) reason SetWindowText() wont display to the title bar... i cant figure it out. the code is exactly how it is in the tutorial...

Get busy livin'' or get busy dyin''... - Shawshank Redemption

Share this post


Link to post
Share on other sites
actually scratch that last question. god im an eediot!!!!!!!
scratching my head over this problem for an hour an it was a simple logic error, well that and i forgot %d in the string.. oh well that''ll learn me..

Get busy livin'' or get busy dyin''... - Shawshank Redemption

Share this post


Link to post
Share on other sites