Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gfxlib news
#1
Wanted to inform you of three important changes I did in gfxlib, that will be released with FB 0.12:
  • The lib now uses MMX color blitters to keep the screen updated, so it'll be faster than before
  • Also thanks to help by v1c, GET and PUT now fully support pointers, so the following source works great:
    Code:
    SUB Redraw(title AS STRING)
        CLS
        LINE (0,0)-(319,199), 4
        LINE (0,199)-(319,0), 2
        PRINT title
    END SUB

    TYPE FB_IMAGE field = 1
      width AS USHORT
      height AS USHORT
      imageData(64000) AS UBYTE
    END TYPE

    DIM udt AS FB_IMAGE
    DIM udt_ptr AS FB_IMAGE PTR
    DIM array(16001) AS INTEGER
    DIM array_ptr AS INTEGER PTR

    SCREEN 13

    udt_ptr = @udt
    array_ptr = @array(0)

    Redraw "array": CLEAR array(0),,64004
    GET (0,0)-(319,199), array
    CLS: PUT (0,0), array, PSET: WHILE INKEY$ = "": WEND

    Redraw "array(0)": CLEAR array(0),,64004
    GET (0,0)-(319,199), array(0)
    CLS: PUT (0,0), array, PSET: WHILE INKEY$ = "": WEND

    Redraw "@array[0]": CLEAR array(0),,64004
    GET (0,0)-(319,199), @array(0)
    CLS: PUT (0,0), array, PSET: WHILE INKEY$ = "": WEND

    Redraw "array_ptr": CLEAR array(0),,64004
    GET (0,0)-(319,199), array_ptr
    CLS: PUT (0,0), array, PSET: WHILE INKEY$ = "": WEND

    Redraw "@array_ptr[0]": CLEAR array(0),,64004
    GET (0,0)-(319,199), @array_ptr[0]
    CLS: PUT (0,0), array, PSET: WHILE INKEY$ = "": WEND

    Redraw "@udt": CLEAR udt,, 64004
    GET (0,0)-(319,199), @udt
    CLS: PUT (0,0), @udt, PSET: WHILE INKEY$ = "": WEND

    Redraw "udt_ptr": CLEAR udt,,64004
    GET (0,0)-(319,199), udt_ptr
    CLS: PUT (0,0), @udt, PSET: WHILE INKEY$ = "": WEND

    Redraw "@udt_ptr[0]": CLEAR udt,,64004
    GET (0,0)-(319,199), @udt_ptr[0]
    CLS: PUT (0,0), @udt, PSET: WHILE INKEY$ = "": WEND
  • All primitives, including GET and PUT, now support drawing on GET/PUT buffers; you just have to pass the buffer as first argument to all primitives (it's optional; omitting it will make them draw to the current work page as usual). So you can do things like:
    Code:
    DIM buffer(64004) AS BYTE
    GET (0,0)-(319,199), buffer
    PSET buffer, (0,0), 15
    LINE buffer, (0,0)-(319,199), 2
    PUT buffer, (0,0), sprite, TRANS
    When drawing into a buffer, the coordinates are affected by last call to WINDOW, but the clipping region will be forced to be the whole buffer area despite the most recent call to VIEW. Of course the target buffer parameter can be an array or a pointer, as for the GET/PUT data parameter.
ngelo Mottola - EC++
Reply
#2
Cool!!!
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#3
Quote:[...]
  • All primitives, including GET and PUT, now support drawing on GET/PUT buffers; you just have to pass the buffer as first argument to all primitives (it's optional; omitting it will make them draw to the current work page as usual). So you can do things like:
    Code:
    DIM buffer(64004) AS BYTE
    GET (0,0)-(319,199), buffer
    PSET buffer, (0,0), 15
    LINE buffer, (0,0)-(319,199), 2
    PUT buffer, (0,0), sprite, TRANS
    When drawing into a buffer, the coordinates are affected by last call to WINDOW, but the clipping region will be forced to be the whole buffer area despite the most recent call to VIEW. Of course the target buffer parameter can be an array or a pointer, as for the GET/PUT data parameter.

Oh, you are GOD Big Grin I always wanted such a feature Smile

Thanks, awesome work. So... when was FB 0.12b out? Big Grin Wink
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#4
wow cool,

only one more thing -could you add text printing to the buffer too? It could be done through locate I think. locate buffer, xpos, ypos... or smth?
url]http://fbide.sourceforge.net/[/url]
Reply
#5
I would rather like to see that i could mix SDL with gfxlib.
Shouldnt be a problem as gfxlib is using SDL anyways, as far as i know.

It all boils down here to: I need a .png loader Wink

So Long, The Werelion!
color=red]Look at you, Hacker. A pathetic creature of meat and bone, panting and sweating as you run through my corridors. How can you challenge a perfect, immortal machine?" - Shodan, AI at Citadel Station orbiting Earth[/color]
Reply
#6
What you ask for is impossible, moreover: it can't be done. Big Grin

GfxLib is not using SDL since lillo took over, SDL and gfxlib are incompatible.
Antoni
Reply
#7
Quote:What you ask for is impossible, moreover: it can't be done. Big Grin

GfxLib is not using SDL since lillo took over, SDL and gfxlib are incompatible.

Ok, then i wont use it and stick with SDL.
Unless someone proves lillos libary being much faster than SDL.
color=red]Look at you, Hacker. A pathetic creature of meat and bone, panting and sweating as you run through my corridors. How can you challenge a perfect, immortal machine?" - Shodan, AI at Citadel Station orbiting Earth[/color]
Reply
#8
Lillo:
Could I put a gfxlib app inside a GUI wrapper (menus, dialogs)?
Gfxlib does event preocessing so it does'nt allow for an external one...
Antoni
Reply
#9
Thanks for the feedback Smile
I also just finally added BMP loading support to BLOAD...

I think 0.12 will be out in a week or so, but v1ctor has the final word on this.

VonGodric: I cannot modify LOCATE as the same code is used by the console modes. Anyway I think a small addon coded in FB itself that uses the built-in fonts but allows target buffers, pixel placement and transparent background should be easy to write.

BastetFurry: no, gfxlib is not SDL based anymore. If you need to load PNGs, just write a libpng wrapper and use it... Shouldn't take much time. About gfxlib speed, I think I'll do some benchmarks as I'm curious too as how it performs against tinyptc, Allegro and SDL.

Antoni Gual: I'm not a Win32 expert, but maybe if I add a way to pass an user-defined wndproc to be called for messages not already handled by the built-in message loop, this could be done. Or am I missing something?
ngelo Mottola - EC++
Reply
#10
*applauds*

Excellent work.

Those are the features that every time I work with buffers I think: "Why the hell doesn't someone just do this...it's so useful and functional."

To quote Nath: 'You are a god.'
·~¹'°¨°'¹i|¡~æthérFòx~¡|i¹'°¨°'¹~·-
avinash.vora - http://www.avinashv.net
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)