Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
yagl freebasic port 0.0.7
#31
The png decoder go worky-worky. Big Grin
\__/)
(='.'=) Copy bunny into your signature to
(")_(") help him gain world domination.
Reply
#32
It really needs a website now.. anyone?
Reply
#33
Mouse is not visible in fullscreen mode Tongue
Reply
#34
Just steal Clanlib's website... :lol: :lol: :lol:
\__/)
(='.'=) Copy bunny into your signature to
(")_(") help him gain world domination.
Reply
#35
well any body wanna volunteer to create a site? i'm no good with that shit.
quote="NecrosIhsan"]
[Image: yagl1.png]
[/quote]
Reply
#36
I'm retired...and my sites suck anyways so I doubt you'd want me to do it. Tongue I could try though, if you'd like...
\__/)
(='.'=) Copy bunny into your signature to
(")_(") help him gain world domination.
Reply
#37
you are more than welcome too, though if that's a lot of stress for you then i'd say screw it. i could also go to sourceforge.net but i dislike cvs and i want the server to be fast.

well i'd say go for it if you find the time, just don't stress yourself :p
quote="NecrosIhsan"]
[Image: yagl1.png]
[/quote]
Reply
#38
So, I was playing around with Yagl, and decided to do a simple speed test.
So I made a simple, unoptimized particle handler..
Turns out, yagl is blazing fast..

Keep in mind, that every particle is blended.
A particle is made up of a box that get smaller as the particle fade out

The demo adds particles until the FPS is around 50, maximum number of particles (due to the array, not yagl) is 100'000
The windowtitle show the current values/max values
The last two values are Wind and the number of particles added on average the last second.

Screenshots of the demo in action:
[Image: 15920-t.png]
[Image: 15921-t.png]
[Image: 15922-t.png]



EDIT: Yagl now officially beat SDL in terms of speed: both blitting and blending



And here's the source, requires Yagl ofcourse
Code:
'#################################################################
'#
'# Yagl Fire/Particles/Blending/Speed example
'#
'# Author: Z!re
'# Group: Plantasy Studios
'#
'# When: 2006-Jan-9
'#
'# For: Marzec's awesome Yagl
'#
'# Copyright: Do whatever you want, it's an example, use/abuse
'#
'#################################################################

#include "yaglwrapper.bi"

randomize timer

YaglGfxDevice_setScreenMode(640, 480, 32, 0)
option nokeyword color
type particle__
    x as single
    y as single
    xf as single
    yf as single
    life as integer
    blendfact as integer
    color as uinteger
end type

dim particle(100000) as particle__

extra = 200
fpc! = timer+1
do
    fps += 1
    
    YaglGfxDevice_clear(0)
    
    key = YaglKeyboard_getKey
    added = 0
    alive = 0
    for a = 0 to 100000
        with particle(a)
            if .life > 0 then
                fact! = csng(.life/.blendfact)
                YaglGfxDevice_solidBox  ( .x-fact!*5, .y-fact!*5, .x+fact!*5, .y+fact!*5, .color, fact!/5 )
                .x += .xf+((480-.y)*wf!)
                .y += .yf
                .life -= 1
                alive += 1
            elseif added < extra then
                
                .y = 450-25*rnd+25*rnd
                
                if numf = 0 then
                    .x = 640*rnd
                elseif numf = 1 then
                    if cint(rnd) = 1 then
                        .x = 160-25*rnd+25*rnd
                    else
                        .x = 480-25*rnd+25*rnd
                    end if
                elseif numf = 2 then
                    .x = 320-25*rnd+25*rnd
                elseif numf = 3 then
                    b = cint(2*rnd)
                    if b = 0 then
                        .x = 100-25*rnd+25*rnd
                    elseif b = 1 then
                        .x = 320-25*rnd+25*rnd
                    elseif b = 2 then
                        .x = 540-25*rnd+25*rnd
                    end if
                end if
                if int(10*rnd) = 1 then
                    .x += -50*rnd+50*rnd
                    .y += -50*rnd+50*rnd
                end if
                .xf = 1*rnd-1*rnd
                .yf = -3-6*rnd
                .life = 50+10*rnd
                .blendfact = .life
                r = 255*rnd
                .color = RGB(r, (r/2)*rnd, 0)
                added += 1
            end if
        end with
    next
    
    YaglGfxDevice_swapBuffers
    if timer >= fpc! then
        fpc! = timer+1
        YaglGfxDevice_setWindowTitle "FPS: "& fps &"/50 :: Live particles: "& alive &"/100'000 :: Wind: "& cint(wf!*1000) &" :: "& extra
        wf! += 0.005*rnd -0.005*rnd
        if wf! > 0.015 then wf! = 0.015
        if wf! < -0.015 then wf! = -0.015
        onumf = numf
        do
            numf = cint(3*rnd)
        loop until numf <> onumf
        if fps > 50 then extra += fps
        if fps < 50 and extra > 0 then extra -= (50-fps)
        fps = 0
    end if
loop until key = YAGL_KEY_ESCAPE
Reply
#39
yagl has now an official website with forums feel free to visit it

http://goddess.selfip.com/hosted/marzec/yagl/index.html

thanks to nodtveidt for getting this thing together.
quote="NecrosIhsan"]
[Image: yagl1.png]
[/quote]
Reply
#40
[Image: 16075-t.png]

Download binaries

Code:
'#################################################################
'#
'# Yagl Fire/Particles/Blending/Speed example 2
'#
'# Author: Z!re
'# Group: Plantasy Studios
'#
'# When: 2006-Jan-11
'#
'# For: Marzec's awesome Yagl
'#
'# Copyright: Do whatever you want, it's an example, use/abuse
'#
'#################################################################



#include "yaglwrapper.bi"

randomize timer

YaglGfxDevice_setScreenMode(640, 480, 32, 0)

option nokeyword color
type particle__
    x as single
    y as single
    al as single
    af as single
    xf as single
    yf as single
    life as integer
    blendfact as integer
    color as uinteger
end type

dim particle(100000) as particle__
dim someSurf as YaglGfxSurface
dim color as uinteger

extra = 10
fpc! = timer+1

someSurf = YaglGfxDevice_createSurface

'# buildup: BGRA 5x5
a = 16
r = 255
g = 64
b = 16

bla$ = _
chr(0, 0, 0, 0,     0, 0, 0, 0,       b, g, r, a/3,   0, 0, 0, 0,       0, 0, 0, 0)+_
chr(0, 0, 0, 0,     b, g, r, a/2,    b, g, r, a/2,    b, g, r, a/2,    0, 0, 0, 0)+_
chr(b, g, r, a/3,  b, g, r, a/2,    b, g, r, a,        b, g, r, a/2,    b, g, r, a/3)+_
chr(0, 0, 0, 0,     b, g, r, a/2,    b, g, r, a/2,    b, g, r, a/2,    0, 0, 0, 0)+_
chr(0, 0, 0, 0,     0, 0, 0, 0,       b, g, r, a/3,    0, 0, 0, 0,      0, 0, 0, 0)
result = YaglGfxSurface_loadFromMemory( someSurf, cptr(ubyte ptr, strptr(bla$)), 5, 5, BITMAP_FORMAT_ARGB32 )

do
    fps += 1
    
    YaglGfxDevice_clear(0)
    
    key = YaglKeyboard_getKey
    xmouse = YaglMouse_getX
    ymouse = YaglMouse_getY
    zmouse = YaglMouse_getZ
    
    
    added = 0
    alive = 0
    for a = 0 to 100000
        with particle(a)
            if .life > 0 then
                fact! = csng(.life/.blendfact)
                YaglGfxDevice_blitRotatedScaled( .x, .y, .al, fact!*25, fact!*25, someSurf, BLIT_ALPHAMASKED, 1.0! )
                .x += .xf
                .y += .yf
                .al = (.al + .af ) mod 360
                .life -= 1
                alive += 1
            elseif added < extra then
                .x = 320-25*rnd+25*rnd
                .y = 450-25*rnd+25*rnd
                if int(10*rnd) = 1 then
                    .x += -50*rnd+50*rnd
                    .y += -50*rnd+50*rnd
                end if
                .xf = 1*rnd-1*rnd
                .yf = -2-4*rnd-fheight*rnd
                .af = 16*rnd-16*rnd
                .life = 50+10*rnd
                .blendfact = .life
                .color = RGBA(0, 0, 255, 10)
                added += 1
            end if
        end with
    next
    
    YaglGfxDevice_swapBuffers
    if timer >= fpc! then
        fpc! = timer+1
        YaglGfxDevice_setWindowTitle "FPS: "& fps &"/50 :: Live particles: "& alive &"/100'000"
        if fps <> 50 then extra += (fps-50)/2
        fps = 0
    end if
    
    if fps mod 10 = 0 then fheight = 6*rnd
    
loop until key = YAGL_KEY_ESCAPE
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)