Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualfir

Posted 12 September 2013 - 12:10 AM

 


I got a global shared Sleep value (in miliseconds) which is used in the winapi dispatch messages loop

 

how specifically?

 

 

Got something like







 
WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR commandline_,int nCmdShow)
{
 hinstance = hInstance;
 commandline = commandline_;

 AppSetup();

 for(;;)
 {
  IdleLoop();
  if(!MessagePump()) break;
 }

 AppCloseUp();

 LOG("\nClosing app OK");
 return (int) msg.wParam;
}

and at the end of IdleLoop() I got







void IdleLoop()
{
 //........
 
 if(sleepVal>0) SleepEx(sleepVal, 1);
}

I am working on prototypes by now, heard about that that

sleep can be quantized sometimes and setting it by something like

 

  timeBeginPeriod(2000);

 

is not considered good because of some reason, but now i am working on prototypes only and do not bother much about it because it works ok , could improve it later in some other way. Would you improve it ?


#5fir

Posted 12 September 2013 - 12:07 AM

 


I got a global shared Sleep value (in miliseconds) which is used in the winapi dispatch messages loop

 

how specifically?

 

 

Got something like





 
WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR commandline_,int nCmdShow)
{
 hinstance = hInstance;
 commandline = commandline_;

 AppSetup();

 for(;;)
 {
  IdleLoop();
  if(!MessagePump()) break;
 }

 AppCloseUp();

 LOG("\nClosing app OK");
 return (int) msg.wParam;
}

and at the end of IdleLoop() I got





void IdleLoop()
{
 //........
 
 if(sleepVal>0) SleepEx(sleepVal, 1);
}

I am working on prototypes by now, heard about that that

sleep can be quantized sometimes and setting it by something like

 

  timeBeginPeriod(2000);

 

is not considered good because of some reason, but now i am working on prototypes only and do not bother much about it because it works ok , could improve it later in some other way. Would you improve it ?


#4fir

Posted 12 September 2013 - 12:03 AM

 


I got a global shared Sleep value (in miliseconds) which is used in the winapi dispatch messages loop

 

how specifically?

 

 

Got something like



 
WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR commandline_,int nCmdShow)
{
 hinstance = hInstance;
 commandline = commandline_;

 mod_init();
 
 AppSetup();

 for(;;)
 {
  IdleLoop();
  if(!MessagePump()) break;
 }

 AppCloseUp();

 LOG("\nClosing app OK");
 return (int) msg.wParam;
}

and at the end of IdleLoop() I got



void IdleLoop()
{
 //........
 
 if(sleepVal>0) SleepEx(sleepVal, 1);
}

I am working on prototypes by now, heard about that that

sleep can be quantized sometimes and setting it by something like

 

  timeBeginPeriod(2000);

 

is not considered good because of some reason, but now i am working on prototypes only and do not bother much about it because it works ok , could improve it later in some other way. Would you improve it ?


#3fir

Posted 12 September 2013 - 12:02 AM

 


I got a global shared Sleep value (in miliseconds) which is used in the winapi dispatch messages loop

 

how specifically?

 

 

Got something like

 
WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR commandline_,int nCmdShow)
{
hinstance = hInstance;
commandline = commandline_;

mod_init();
 
AppSetup();

for(;;)
{
  IdleLoop();
  if(!MessagePump()) break;
}

 AppCloseUp();

 LOG("\nClosing app OK");
 return (int) msg.wParam;
}

and at the end of IdleLoop() I got

void IdleLoop()
{
 //........
 
 if(sleepVal>0) SleepEx(sleepVal, 1);
}

I am working on prototypes by now, heard about that that

sleep can be quantized sometimes and setting it by something like

 

  timeBeginPeriod(2000);

 

is not considered good because of some reason, but now i am working on prototypes only and do not bother much about it because it works ok , could improve it later in some other way. Would you improve it ?


#2fir

Posted 12 September 2013 - 12:00 AM

 


I got a global shared Sleep value (in miliseconds) which is used in the winapi dispatch messages loop

 

how specifically?

 

 

Got something like

 

 
WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR commandline_,int nCmdShow)
{

hinstance = hInstance;
commandline = commandline_;

mod_init();

AppSetup();

for(;;)
{
IdleLoop();

if(!MessagePump()) break;
}

AppCloseUp();

LOG("\nClosing app OK");

return (int) msg.wParam;

}

 

and at the end of IdleLoop() I got

 

void IdleLoop()
{
 //........
 
 if(sleepVal>0) SleepEx(sleepVal, 1);
}

 

I am working on prototypes by now, heard about that that

sleep can be quantized sometimes and setting it by something like

 

  timeBeginPeriod(2000);

 

is not considered good because of some reason, but now i am working on prototypes only and do not bother much about it because it works ok , could improve it later in some other way. Would you improve it ?


#1fir

Posted 11 September 2013 - 11:59 PM

 


I got a global shared Sleep value (in miliseconds) which is used in the winapi dispatch messages loop

 

how specifically?

 

 

Got something like

 

<code>

 

WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR commandline_,int nCmdShow)
{

hinstance = hInstance;
commandline = commandline_;

mod_init();

AppSetup();

for(;;)
{
IdleLoop();

if(!MessagePump()) break;
}

AppCloseUp();

LOG("\nClosing app OK");

return (int) msg.wParam;

}
</code>

 

and at the end of IdleLoop() I got

 

<code>

void IdleLoop()
{
 //........

 

 if(sleepVal>0) SleepEx(sleepVal, 1);
}

</code>

 

I am working on prototypes by now, heard about that that

sleep can be quantized sometimes and setting it by something like

 

  timeBeginPeriod(2000);

 

is not considered good because of some reason, but now i am working on prototypes only and do not bother much about it because it works ok , could improve it later in some other way. Would you improve it ?


PARTNERS