1
0
mirror of https://github.com/lxsang/Diya-API.git synced 2024-12-27 03:48:21 +01:00
This commit is contained in:
Dany LE 2021-12-19 20:08:49 +01:00
commit ad045dcc80

View File

@ -155,9 +155,30 @@ DiyaBoot >> render [
{ #category : #events }
DiyaBoot >> run [
self init.
Transcript show: 'Current selected video driver: ', (SDL2 SDLGetCurrentVideoDriver); cr.
display := SDL_DisplayMode externalNew autoRelease.
SDL2 SDLGetCurrentDisplayMode: display from:0.
self startx
]
{ #category : #events }
DiyaBoot >> run: screenSize [
self init.
display := SDL_DisplayMode externalNew autoRelease.
SDL2 SDLGetCurrentDisplayMode: display from:0.
display w: screenSize x.
display h: screenSize y.
self startx
]
{ #category : #events }
DiyaBoot >> setCursorPosition: mappedEvt [
Transcript show: 'x: ', mappedEvt x asString, ' - y: ', mappedEvt y asString; cr.
window warpMouseX:((mappedEvt x)* (display w) )
Y: ((mappedEvt y) * (display h))
]
{ #category : #events }
DiyaBoot >> startx [
Transcript show:'Display resolution: ', display w asString, 'x',display h asString;cr.
window := self createWindow.
renderer := self createRenderer.
@ -167,10 +188,3 @@ DiyaBoot >> run [
SDL2 quit.
Transcript show: 'System quit'; cr.
]
{ #category : #events }
DiyaBoot >> setCursorPosition: mappedEvt [
Transcript show: 'x: ', mappedEvt x asString, ' - y: ', mappedEvt y asString; cr.
window warpMouseX:((mappedEvt x)* (display w) )
Y: ((mappedEvt y) * (display h))
]