Click here to Skip to main content
15,915,086 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: DMI EDITOR Pin
George L. Jackson13-Mar-06 10:31
George L. Jackson13-Mar-06 10:31 
Questionhow to know the dll export function's declare? Pin
HOW WHAT12-Mar-06 2:34
HOW WHAT12-Mar-06 2:34 
AnswerRe: how to know the dll export function's declare? Pin
oshah14-Mar-06 23:24
oshah14-Mar-06 23:24 
QuestionTemplates Pin
combatc211-Mar-06 12:57
combatc211-Mar-06 12:57 
AnswerRe: Templates Pin
Nemanja Trifunovic11-Mar-06 13:14
Nemanja Trifunovic11-Mar-06 13:14 
GeneralRe: Templates Pin
combatc212-Mar-06 13:29
combatc212-Mar-06 13:29 
AnswerRe: Templates Pin
George L. Jackson13-Mar-06 10:07
George L. Jackson13-Mar-06 10:07 
QuestionSleep() broken? Pin
theDawckta11-Mar-06 5:29
theDawckta11-Mar-06 5:29 
I have a little graphics demo to demonstrate a transformation class I'm doing and the Sleep() function seems to be working incorrectly. The program is a little tank that the user can move around with the keyboard. I use sleep on every cycle to try to slow down the frames per sec so the tank is controllable. If I omit Sleep() the program seems to run correctly, the tank is very quick and uncontrollable. I want to slow it to about Sleep(4) but when I use this it slows much more than 4 milliseconds per frame. From about Sleep(1) to Sleep(50) it's the same slow pace. Over 50 and it works correctly slowing in increments according to the number of milliseconds.

If anyone has had a similar problem or can just offer some advice it would be much appreciated.

I'll include a little code, if not enough please tell me.
I call Sleep() at the end of this function.

This is my function for glutIdleFunc(myIdle). It runs myIdle while the function has no imput.

void myIdle()
{
glClear(GL_COLOR_BUFFER_BIT);

if(upPressed == 1 && userBullet.getBulletCheck() == 0)
{
if(userBullet.getBulletCheck() == 0)
{
userBullet.setBulletStart(userTank.getBulletStart());
userBullet.setBulletCheck(1);
userBullet.setBulletDirection(userTank.getCurrentTurretDir());
}
userTank.drawTank();
}

if(wPressed == 0 && sPressed == 0 && aPressed == 0 && dPressed == 0 && rightPressed == 1 && leftPressed == 0)
{
userTank.rotateTurret(1);
userTank.drawTank();
}

/**In between these two code chunks is just more of the same, different operatios for different button presses.**/

if(sPressed == 1 && wPressed == 0 && dPressed == 1 && aPressed == 0 && rightPressed == 0 && leftPressed == 1)
{
userTank.rotateTurret(-1);
userTank.moveTankBck();
userTank.rotateBody(1);
userTank.drawTank();
}

userTank.drawTank();
if(userBullet.getBulletCheck() == 1 )
{
userBullet.moveBullet();
}
Sleep(4);
glutSwapBuffers();
}

-- modified at 19:05 Saturday 11th March, 2006
AnswerRe: Sleep() broken? Pin
Cedric Moonen12-Mar-06 23:35
Cedric Moonen12-Mar-06 23:35 
GeneralRe: Sleep() broken? Pin
2bee 12-Mar-06 23:45
2bee 12-Mar-06 23:45 
GeneralRe: Sleep() broken? Pin
Cedric Moonen12-Mar-06 23:57
Cedric Moonen12-Mar-06 23:57 
GeneralRe: Sleep() broken? Pin
theDawckta13-Mar-06 13:29
theDawckta13-Mar-06 13:29 
GeneralRe: Sleep() broken? Pin
Cedric Moonen13-Mar-06 19:57
Cedric Moonen13-Mar-06 19:57 
Question[OpenGL] Help needed!Listen to my problem please... Pin
carlsoncarlson10-Mar-06 16:45
carlsoncarlson10-Mar-06 16:45 
QuestionHandling Arrays inside the Structures in VC++ Pin
Sangeetha.R9-Mar-06 23:49
Sangeetha.R9-Mar-06 23:49 
AnswerRe: Handling Arrays inside the Structures in VC++ Pin
2bee 10-Mar-06 1:31
2bee 10-Mar-06 1:31 
QuestionC++ Console Applications Pin
Dreamspeeder9-Mar-06 22:36
Dreamspeeder9-Mar-06 22:36 
AnswerRe: C++ Console Applications Pin
toxcct9-Mar-06 22:54
toxcct9-Mar-06 22:54 
GeneralRe: C++ Console Applications Pin
Dreamspeeder10-Mar-06 7:00
Dreamspeeder10-Mar-06 7:00 
GeneralRe: C++ Console Applications Pin
georgeraafat10-Mar-06 13:34
georgeraafat10-Mar-06 13:34 
GeneralRe: C++ Console Applications Pin
Saksida Bojan10-Mar-06 19:29
Saksida Bojan10-Mar-06 19:29 
Question.Net Remoting Memory Horror (IPC channel) Pin
2bee 9-Mar-06 20:28
2bee 9-Mar-06 20:28 
Question[Message Deleted] Pin
cusack9-Mar-06 17:48
cusack9-Mar-06 17:48 
AnswerRe: problem in tis few question !!! Pin
Cedric Moonen9-Mar-06 20:26
Cedric Moonen9-Mar-06 20:26 
GeneralRe: problem in tis few question !!! Pin
cusack10-Mar-06 18:42
cusack10-Mar-06 18:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.