| |
|
|
- Page 1 - |
|
 funkheld | Hello, good day. I have one kombinationsproblem with the mouse.
I have over the Schwungrad of my Trimmrad a optische Mausplatine fasten(5 Euro-mouse). The Befestigung is so, the, if I tread, The Mausposition of y-0 to y-Max goes.
How can it make, the The mouse zb on y=0 staid and is with y>500 one counter counted and is The mouse then again on y=0 staid becomes. this then in a Loop expires.
These combination I get not there, because the mouse with of/ one designed speed überfordert is, tappt im dunkeln counts then not any more moreover. with "sleep 1" goes it neither.
Why the. I compiliere with XPSE. CompileMarkSeparation {$cleq}
Def @Getcursorpos(1) !"user32","GetCursorPos"
Def @Setcursorpos(2) !"USER32","SetCursorPos"
Struct Mauskoordinaten = X&,Y&
Declare Xpos&,Ypos&,Curpos#,zaehler&
Windowstyle 31
Windowtitle "Cursorposition ermitteln"
Window 200,0 - 440,440
@Setcursorpos (100,0)
While 0 = 0
Sleep 5
Dim Curpos#,Mauskoordinaten
@Getcursorpos(Curpos#)
Xpos& = Curpos#.X&
Ypos& = Curpos#.Y&
if Ypos& > 500
@Setcursorpos (100,0)
zaehler&=zaehler&+1
endif
Dispose Curpos#
Drawtext 0,0,"Zähler: " + zaehler& + @Space$(30)
Endwhile
Thank you.
greeting |
|
|
| |
|
|
 |
« this Posting watts as Solution marked. » |
|
- Page 1 - |
|
 | @Funkheld: Have you here something The way misst... something like?
Download CompileMarkSeparation {$cleq}
Windowstyle 31
Windowtitle "Cursorposition ermitteln"
Window 500,500
setcursorpos((winRight-winLeft)\2+winLeft,(winBottom-winTop)\2+winTop)
var modified&=0
var strecke&=0
var my2MousePositions&=globalAlloc(gPTR,16)
getCursorPos(my2MousePositions&)
rtlMoveMemory(my2MousePositions&+8,my2MousePositions&,8)
while 1
waitinput 10
getCursorPos(my2MousePositions&)
settext hWnd,"X:"+str$(long(my2MousePositions&,0))+" Y:"+str$(long(my2MousePositions&,4))+" Strecke:"+str$(strecke&)
add strecke&,abs(long(my2MousePositions&,0)-long(my2MousePositions&,8))+abs(long(my2MousePositions&,4)-long(my2MousePositions&,12))
if long(my2MousePositions&,0) > winRight
long my2MousePositions&,0=winLeft
inc modified&
endif
if long(my2MousePositions&,0) < winLeft
long my2MousePositions&,0=winRight
inc modified&
endif
if long(my2MousePositions&,4) < winTop
long my2MousePositions&,4=winBottom
inc modified&
endif
if long(my2MousePositions&,4) > winBottom
long my2MousePositions&,4=winTop
inc modified&
endif
if modified&
modified&=0
setCursorPos(long(my2MousePositions&,0),long(my2MousePositions&,4))
endif
rtlMoveMemory(my2MousePositions&+8,my2MousePositions&,8)
wend
globalFree(my2MousePositions&)
f='./../../Function-References/XProfan/end/'>end
If you The add way row to there änderst: CompileMarkSeparationadd strecke&,(long(my2MousePositions&,0)-long(my2MousePositions&,8))+(long(my2MousePositions&,4)-long(my2MousePositions&,12))
(means without abs), then becomes The rückwärtsgefahrene way too from the Streckenlänge subtrahiert instead of to Streckenlänge add.
PS: with XPSE need The whole standard-APIs not deklarieren and its even sinnvoller it then neither To do since the Aufrufe in explicit faster Calls transformed go. |
 |
|
| |
|
 |
|
|
| |
|
- Page 2 - |
|
 | On my computer can I The mouse so quick moving that even 20 km/h
showing. How big is your hWnd? can it his the The from you genutzte
mouse simply not faster erfassen can? |
|
|
| |
|
|
|
 funkheld | I have now time : add tme&,200 tuned. now functions it over 15Km/h.
whom Einfluss has the really?
greeting |
|
|
| |
|
|
|
 | After wievielen Millisekunden The Grafikprozedur run out should -
with 100 means 10 time per second and with 200 5 time per second. |
|
|
| |
|
|
| |
|
- Page 3 - |
|
|
 funkheld | Why increased itself then The speed? is there some Einfluss drin, if I 200 eingebe?
How errechnest You The Geshwindigkeit?
greeting |
|
|
| |
|
|
|
 | well there's still strecke& and any X ms observe I in tmp& strecke& and so is clear how much way in the Time made watts. If you only 5 time instead of 10 time per second rechnest then can twice so plenty way in the Time made go but The Kalkulation might then not any more voices there on 100 ms voted.
If you any 200 instead of 100 ms rechnest then müsstest speed through 2 take. |
|
|
| |
|
|
|
 funkheld | I see...., thanks for Hinweiss.
an grafically spielerei: you have but already many things in Opengl program. i want time a Geländeplatte without Höhen and depths with Spritebäumen infinite moving, according to the How quick one into Pedale exit.
How can the realiseren ?
greeting peter |
|
|
| |
|
|
|
 | i'd recommend the first self-contained of these Program here To release and
the in a own Subject to treat. |
|
|
| |
|
|
|
 funkheld | Hello, good day. I have one Program, where itself one Ogl-Sprite according to Tretgeschwindikeit of under to supra moving, up to the speed where the Dateneinlesen the Lasermaus aussetzt. The enhancement the speed isn't so explicit discernible at Sprite. How can it here now in the program per Zeiteiheit so Is it Unikode, the at faster zurück a deutliche erkennbare movement the Sprites discernible is. it comes now not The detailed speed on, separate it comes now The movement the Sprites on.
Thank you.
greeting CompileMarkSeparation {$cleq}
declare hWin&,hintergrpic&,vordergrpic&
declare ende&,winkel!,groesse&,dib&,array&
declare bild_auto&,tex.auto&
declare bmi#,ogl_rgb#
declare x1!,y1!,dx!,dy!
declare bereich#
Dim Bereich#, 16
Def &GL_BGR $80E0
DEF CreateDIB(2) !"dib","CreateDIB"
DEF FreeDIB(1) !"dib","FreeDIB"
DEF DrawDIB(4) !"dib","DrawDIB"
DEF CloneDIB(1) !"dib","CloneDIB"
dib&=usedll("dib.dll")
hintergrpic& = create("hNewPic", 400,700,rgb(255,255,0))
vordergrpic& = create("hNewPic", 400,700,rgb(255,255,0))
bild_auto& = create("hNewPic", 128,128,rgb(255,255,0))
array&=CreateDIB(128,128)
groesse&=128*128*4
dim ogl_rgb#,groesse&
Window 20,20-800,800
Cls @RGB(220,220,220)
hWin& = @Create("text", %hWnd, "Test1", 10, 10, 128,128)
oGL("Init", hwin&, 0,0, 0, 0)
oGL("PosMode", 1)
ogl("glReadBuffer",~GL_Back)
tex.auto&=oGL("LoadTextureBMP","data\\auto.bmp",1)
drawglscene
ende&=1
winkel!=90
dx!=100
dy!=600
WHILE ende&
getCursorPos(bereich#)
if long(bereich#,4) > 700
setCursorPos(100,0)
y1!=Sin(-(winkel!)/180.0*pi())*2
x1!=Cos(-(winkel!)/180.0*pi())*2
dx!=dx!+x1!
dy!=dy!+y1!
if dy! < 0.0
dy!=600
endif
endif
if isKey(81)
winkel!=winkel!+1.0
endif
if isKey(69)
winkel!=winkel!-1.0
endif
drawglscene
ENDWHILE
end
proc drawglscene
OGL("Clear")
OGL("origin",0,0,-1.11)
OGL("texture",tex.auto&,1)
OGL("rotate",0,0,winkel!)
OGL("quad",0.5,0.5)
OGL("show")
ogl("glReadPixels",0,0,128,128,&GL_BGR,~GL_UNSIGNED_BYTE,ogl_rgb#)
~setDIBits(%hdc,bild_auto&,0,128,ogl_rgb#,array&,0)
StartPaint vordergrpic&
DrawPic hintergrpic&,0,0;0
drawpic bild_auto&,dx!,dy!;-1
endpaint
DrawPic vordergrpic&, 300,5;pan>
endproc
|
 |
|
| |
|
|
|
 | Imho are missing Files How z.B.:
 |
|
|
| |
|
|
|
 funkheld | Hello,I have The DIB here from the Forum. have tappt im dunkeln now drangehängt.
Perhaps could one indeed one 2D-background produce without Opengl, the itself according to speed moving and in the Vordergrund a Fahrradfahrer-Bmp.
greeting |
|
|
| |
|
|
|
 | this is Yes everything integrally simply.
What is herewith? [...]  |
|
|
| |
|
|
|
 funkheld | Jup, its now resolved with your Program.
Thank you.
greeting |
|
|
| |
|
|