Archived

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

new problem same concept

This topic is 5674 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I found a tutorial that solved my earlyer problem, but now my program crashes (the screen goes the color i''ve declared as my background color, doesent draw enything else, but quits when I push escape) when ever I give it any keybord input.
  	
   ticks=(clock()-lasttime)/CLK_TCK;
   lasttime=(float)clock();
   //sprintf(str,"The frame rate is %f.",ticks);

   //prt(0,0,str,200,0,0);


	if(ticks==0)
		ticks==.01;
	
	if (KEY_DOWN(VK_ESCAPE) || KEY_DOWN(VK_SPACE)){
		PostMessage(hwnd, WM_DESTROY,0,0);
		return(0);
	}
	
	if(KEY_DOWN(VK_UP)){
		if(rx<45)
		rx+=(1/ticks);//*2;

	}

	if(KEY_DOWN(VK_DOWN)){
		if(rx>-20)
		rx-=(1/ticks);//*2;

	}
	
	if(KEY_DOWN(VK_LEFT)){
		if(rx<45)
		ry+=(1/ticks);//*2;

	}

	if(KEY_DOWN(VK_RIGHT)){
		if(rx>-45)
		ry-=(1/ticks);//*2;

	}
	
	
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glLoadIdentity();
	glTranslatef(0.0f,10.0f,0.0f);
	glRotatef(-190,1.0f,0.0f,0.0f);
	glRotatef(rx,1.0f,0.0f,0.0f);
	glRotatef(ry,0.0f,1.0f,0.0f);
  
this might be more of an opengl problem, if so please tell me and Iwill post there. Klaus

Share this post


Link to post
Share on other sites