1. Just some questions - Reply

Helge O Gundersen wrote:

>  1. Is there a way to display an image-sequence on screen which is
>  faster than display_image()? Maybe someone has written a good
>  procedure which is easy to use?

>  2. When I use get_mouse(), Euphoria do not register that I press a
>  mouse-button if I move the mouse at the same time. I wonder if there is
>  someone who can help me. I don't know anything about peek(), poke()
>  and so on, so please explain if I need to do low-level-programming.

For mode 19 with simple linear addressing I use put_image() below, which is
almost five times faster than display_image(), on my old gear anyway.

The function poll_mouse() returns combined status of  *all*   mouse buttons as
well as the mouse cursor position. You can also find it in ratbag.e, which is
included in the my font package (give me a break, guys, I am not selling it...).
But remember, in some resolutions, you will have to scale the coordinates to get
the correct answer.

Sorry, I know next to nothing about serial port communications. I hope this
helps a little. Jiri

-- snip ------------------------------------------------------------------------

include machine.e

function poll_mouse()
   -- returns mouse status: {button_status,x_coord,y_coord}
   -- button status: 0 .. no button pressed
   --                1 .. left button pressed
   --                2 .. right button pressed
   --                4 .. middle button pressed (if your rat has it)
   sequence  rl -- list of register values
   rl = repeat(0,10)
   rl[REG_AX] = 3
   rl = dos_interrupt(#33,rl)
   return {rl[REG_BX], rl[REG_CX], rl[REG_DX]}
end function   -- poll_mouse_status

-- snip ------------------------------------------------------------------------

-- faster display_image()

object junk
sequence s
atom dt,t
integer key

include graphics.e
include get.e
include image.e

procedure put_image(sequence s1, sequence s2)
   integer a,h
   for i=1 to h do
   end for
end procedure

-- test ------------------------------------------------------------------------


for i=1 to 1000 do display_image({40,100},s) end for

for i=1 to 1000 do put_image({80,100},s) end for

key = wait_key()

new topic     » topic index » view message » categorize


Quick Links

User menu

Not signed in.

Misc Menu