Crystal Space
Welcome,
Guest
. Please
login
or
register
.
May 20, 2013, 02:27:18 pm
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
9224
Posts in
2230
Topics by
5382
Members
Latest Member:
Razasaqib
Crystal Space
Crystal Space Development
Support
Question about csDefaultRunLoop
« previous
next »
Pages:
[
1
]
Author
Topic: Question about csDefaultRunLoop (Read 2064 times)
mark
Full Member
Posts: 101
Question about csDefaultRunLoop
«
on:
October 04, 2005, 01:19:30 pm »
The API says
Quote
You only need to call this function if your application does not otherwise implement its own run-loop. For example, an existing Microsoft Windows-based application will already have a run-loop which processes the Windows event-queue, among other tasks. Such an application should not call this function, since doing so would interrupt the existing run-loop and prevent it from running.
This confueses me: Does this mean that I must not call csDefaultRunLoop() or csApplicationFramework::Run() in my cs-application on Windows? Or is this for MFC/.net code only?
Logged
Gentoo Linux ~x86, kernel 2.6.11-cko9 smp, gcc 3.4.4-r1, binutils 2.16.1, glibc 2.3.5 NPTL
CS+CEL Pseudo Stable 2005.09.03
jorrit
Administrator
Hero Member
Posts: 1703
Re: Question about csDefaultRunLoop
«
Reply #1 on:
October 04, 2005, 01:22:40 pm »
Quote from: mark on October 04, 2005, 01:19:30 pm
The API says
Quote
You only need to call this function if your application does not otherwise implement its own run-loop. For example, an existing Microsoft Windows-based application will already have a run-loop which processes the Windows event-queue, among other tasks. Such an application should not call this function, since doing so would interrupt the existing run-loop and prevent it from running.
This confueses me: Does this mean that I must not call csDefaultRunLoop() or csApplicationFramework::Run() in my cs-application on Windows? Or is this for MFC/.net code only?
You should only not call it if you are trying to integrate CS into an 'EXISTING' windows application. For a normal CS application on windows you should call it like usual.
Greetings,
Logged
sunshine
Administrator
Sr. Member
Posts: 292
Re: Question about csDefaultRunLoop
«
Reply #2 on:
October 05, 2005, 11:29:58 am »
The general rule is:
(1) If you are embedding CS into an existing application, don't use the default run-loop. An existing application written with MFC, .NET, or wxWidgets is a good example of when this rule applies since you will be embedding CS into that application which already has its own run-loop.
(2) If your application is not an action game, don't use the default run-loop. The default run-loop tries to maximize your application's CPU time, which is important for action games. Unfortunately, this also starves out other running applications. If your application is, for instance, turned-based or just does some other sort of not-real-time rendering, then you should avoid consuming the CPU. Instead, use the run-loop built into a toolkit, such as MFC, .NET, or wxWidgets which is CPU-friendly.
(3) If you are writing a new action-based game using purely CS API, then feel free to use the default run-loop as a convenience. A benefit of the default run-loop is that it is specially coded to work correctly on all platforms supported by CS, which means that it saves you from having to do a lot of ugly, low-level, platform-specific run-loop coding. (You may embed other toolkits into this application, but the overall framework is CS-based.)
Logged
mark
Full Member
Posts: 101
Re: Question about csDefaultRunLoop
«
Reply #3 on:
October 06, 2005, 02:59:38 pm »
ok, thanks for the answers.
Out of curiosity: Why is it important to maximize CPU time in action games? Is this only a "trick" to get more ressources from the OS? "Starving out other apps" sounds like increasing the processing priority for the game would do the same thing.
Logged
Gentoo Linux ~x86, kernel 2.6.11-cko9 smp, gcc 3.4.4-r1, binutils 2.16.1, glibc 2.3.5 NPTL
CS+CEL Pseudo Stable 2005.09.03
jorrit
Administrator
Hero Member
Posts: 1703
Re: Question about csDefaultRunLoop
«
Reply #4 on:
October 06, 2005, 03:46:07 pm »
Quote from: mark on October 06, 2005, 02:59:38 pm
ok, thanks for the answers.
Out of curiosity: Why is it important to maximize CPU time in action games? Is this only a "trick" to get more ressources from the OS? "Starving out other apps" sounds like increasing the processing priority for the game would do the same thing.
Action games generally try to be as fast as they can (i.e. fast frames per second). To do that the only thing to do is to just keep on processing as fast as you can. That tends to maximize cpu usage.
Greetings,
Logged
Pages:
[
1
]
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Crystal Space Development
-----------------------------
=> General Crystal Space Discussion
=> Support
-----------------------------
Crystal Space Project Development
-----------------------------
=> Feature Requests
=> Plugins
=> Bug Reports
-----------------------------
Crystal Space Development
-----------------------------
=> Game Content Creation
-----------------------------
Miscellaneous
-----------------------------
=> Article/Tutorial Requests
=> Article/Tutorial Discussion
-----------------------------
Crystal Space Project Development
-----------------------------
=> Development Discussion
-----------------------------
Crystal Space Projects
-----------------------------
=> Project Discussion
=> WIP Projects
=> Finished Projects
-----------------------------
Associate Projects
-----------------------------
=> CEL Discussion
=> Crystal Core Discussion
=> CrystalBlend Discussion
-----------------------------
Crystal Space Project Development
-----------------------------
=> Google Summer of Code
-----------------------------
Associate Projects
-----------------------------
=> Apricot (Open Game)
=> Ares Project
Loading...