Re: QBasic --> Euphoria (again)

new topic     » topic index » view thread      » older message » newer message

>I'm pretty new to the Euphoria scene, but let's see...

 And I'll fill the other 3 with a few how-to's..

>> WINDOW (resizes graphics display)

    Win32 currently has no built-in support for graphics, however, if it
would, you would notice that on the win32 platform you can choose for blurry
kind of graphics mode.
    With blurry I mean, you could have dimensions of 3000 x 3000 yet, the
person does not have the resolution, nor will it be saved with that
precision in memory. In other words, 2999, 2999 and 3000, 2999 is prolly the
same pixel, so the order of drawing is crucial wich color the pixel
eventually will be. Notice the word *option* above, cuz you can always use
pixels (which is not *blurry*). (Ps. de faster graphics libraries dont have
blurry modes I think: DirectX, OpenGL, etc.)

    Dos32  does have built-in graphics support, however only for
pixel-modes, in other words you cannot get a blurry mode.
    You want a blurry mode of a given resolution .. ?
    Its not that hard to add, if there's really demand for it, you can
easily integrate it with graphics.e
    If you want I can add it,  or Robert may decide to add it himself for
future versions.
    Its only a floored division with an x- and y- value kept local in
graphics.e which could be set with a window () function, or something
simerlar.

>> OUT (sends information to a port, I believe)


Get Jaquesch Deschenes port.e
However, if it is for waiting for a vertical retrace, you might want to hack
the ASM-code of wait_retrace out of any of the graphics libraries.

>> ABS (gives the ABSolute value of a number)


>function absolutevalue(integer i)
>        integer r
>        r = i
>        if i<0 then
>                r = -1 * i
>        end if
>        return r
>end function

More euphoric would be, allowing both atoms and sequences:

function abs (object x)
    return x < 0 * -2 + x
end function

-- Eat that Basic! blink

>> WAIT (??waits for information from ports??)


Wait waits a number of seconds, however it jumps out of the wait by a
keypress, port data, etc.
To wait for a key-press:
--
include get.e

? wait_key () -- very multi-tasking friendly.. (esspecially a preemtive one
like win95) .. makes it idle until a keypress.
--

To wait a number of seonds, you should take a look at the list-serv
archives, there have been very timing precize routines made available.. this
is just a silly attempt:

--
include machine.e
--
tick_rate (150) -- Increase time () accuracy
--
procedure wait (atom t)
    t = t + time ()
    while t < time () do
    end while
end procedure
--

Maybe somebody can make a multi-tasking friendly version of this ?
Ive got a CPU-doubler program that allows me to change the priority of any
program open (including dos-programs) .. I can put them idle, maximum
priority, etc.
Its what you use if you dont want to hear clicks from WinAMP in full-screen
dos-mode, while Nad (another mp3 player) allows you to change it yourself.

Hope this helps,

Ralf

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu