English
Forum

TimerProblematik

 

Walter
Köhler
this is already something heftiger.
Problematik:
i want by oGL one Objekt on-screen moving, schrittweise.
in the Wartephase but should already The next Berechnung made go.
with Sleep can I of course The Wartephase einleiten without the the processor therefore charged becomes (settimer), but the Berechnung becomes nevertheless first to term of Sleep implemented, and this is Kacke .

who knows The Solution ( would already class)

WKS

2 kB
Hochgeladen:06/09/08
Downloadcounter238
Download
 
WKS Win XP Xprofan 10 AMD 1.6GHz 1GB Ram
06/09/08  
 




Jörg
Sellmeyer
If you a Timer in your Program einbaust, can You all sorts of things apparently parallel run out let:
CompileMarkSeparation
declare icon1&,button1&,choicebox&,oglwindow&,klick%,ende%,klick2%

Proc baueMenue

    CHOICEBOX& = CREATE(CHOICEBOX,%HWND,2,0010,0050,0170,0500)
    addstring(choicebox&,box)
    addstring(choicebox&,bla)
    addstring(choicebox&,blaBla)
    BUTTON1& = @Create(BUTTON,%HWND,TEST,0010,0500,0080,0060)
    Endproc baueMenue

    proc test

        whileloop 100

            inc Klick2%
            drawtext 50,200, Klick2%
            drawtext 0,230, gettext$(Choicebox&)

        wend

        endproc test

        Proc Test2

            whileloop 10

                sleep 1000
                Drawtext 0,30, Test2 gewählt
                inc Klick%
                Drawtext 100,30, Klick%

            wend

            endproc test2
            *** HAUPTPROGRAMM *****
            windowtitle Menutest
            declare mItem%
            CLS 0
            showmax
            popup &Datei
            appendmenu 110,&Neuer Test
            popup &Hilfe
            appendmenu 210,&Hilfe	F11
            baueMenue
            SetTimer 1

            whilenot ende%

                waitinput
                SetText BUTTON1&,Str$(&getTickcount)

                select %menuItem

                    caseof 110:test2 startet den Teil mit Sleep

                    otherWise

                endSelect

                if iskey(34)BildRunter

                    drawtext 0,0, Bild runter Taste
                    inc Klick%
                    drawtext 100,0, Klick%

                ELSEIF @Clicked(BUTTON1&) diese Berechnung soll gemacht werden während Proc test2 arbeitet

                    test

                endif

                setmenuitem 0

            endwhile

            KillTimer
            usecursor 0
end
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
06/09/08  
 



In Buntank stick The Solution.

slopes by setTimer-Api a Timer into subClassProc one, i'd 30ms dial.

this calls but a game-Frame-Proc on, these against schaut again circa 30ms vergangen are and calls, if vergangen, The eigentliche Zeichnungsproc on.

this machinery promising simple Echtzeitprogrammierung and the game-Frame-Proc can also in all further Loop called go there these Yes self over again on past 30ms respect.

advantages: geringstmögliche Systemlast and plainer Echtzeitnachbau

As I said already (u.A.) vorgemacht in Buntank, try there withal the something others Syntax herauszulesen as goes.
 
06/09/08  
 




Walter
Köhler
ok! in your Source Jörg, see I unfortunately no Solution. The both Procs walk eindeutig only nacheinander, never parallel.

will be now time BUNTANK Source Search and then ma see how far me the bring can.
cu WKS
 
WKS Win XP Xprofan 10 AMD 1.6GHz 1GB Ram
06/09/08  
 



@Walter: parallel there so and so not - not even in real Threads, because this is one typischer Anfängerdenkfehler the we certainly any time unterlagen.

its always only The question the organization the releases so it so works as be something parallel - therefore try simply To understand How z.B. Buntank The releases distributed circa Ähnliches nachzubilden.
 
06/09/08  
 



here  [...]  Perhaps too for you interestingly, velvet dahinterstehendem item  [...]  and the dortigem demonstration fpsinctest.exe  [...]  and  [...]  and  [...]  .
 
06/09/08  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

4.719 Views

Untitledvor 0 min.
Walter12/30/22
H.Brill03/15/14
dr.dirk01/29/14
Donnie04/14/13

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie