Posts: 3,522
Threads: 189
Joined: Dec 2003
Yup, the progress lately has got me thinking of moving back to the standard commands from SDL...
I'm wating for the speedtests
Btw, does gfxlib use any hardware acceleration?, other than MMX
Posts: 268
Threads: 9
Joined: Dec 2004
Z!re: no, apart from MMX gfxlib uses no hw acceleration, it's a software renderer. Basically it's perfectly suited for old-style 2d games; if you want tons of translucent effects or you need 3d, you'd better stick to OpenGL.
Ok, I've done some benchmarks testing gfxlib currently in CVS against Allegro, SDL and TinyPTC. To be fair, I used 32bpp mode in all cases, as TinyPTC supports that mode only. Also, all tests are run in windowed mode.
As benchmark I've used a modified version of the TinyPTC test program, which counts the pixels per second; yes I know that is a rough way to test raw speed power, but it works. I'm not an expert in TinyPTC or SDL, so maybe my inner loops for their specific test sources could be optimized further, please let me know if you know how.
Here is the zip holding the benchmark, both source and EXE for each test:
http://www.ecplusplus.com/benchmark.zip
You obviously need complete latest FB CVS tree snapshots in order to compile.
And now, here are the average results on my computer (Athlon-64 3000, WinXP, Radeon 9800 Pro, DirectX 9.0c):
Code: Allegro: 78009141 pixels per second
TinyPTC: 54623044 pixels per second
SDL: 56491357 pixels per second
Gfxlib: 76228287 pixels per second
As you can see, gfxlib comes second only to Allegro, and by not much 8)
Posts: 1,407
Threads: 117
Joined: Dec 2002
Quote: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?
Sorry, I'm no Win32 expert either..
Antoni
Posts: 2,771
Threads: 96
Joined: Oct 2003
Great work, Lillo, I love the library. It has really made FB for me.
Posts: 242
Threads: 29
Joined: Dec 2004
** wipes drool from chin **
Speed, pointer/buffer enhancement, and BMP handling?
...makes me want to delve into the CVS...
...if I have time between now and whenever 0.12 is "officially" released...
ature has its way of warning a person away from danger: The distinct black and white coloration on a skunk, the chilling buzz of a rattlesanke, a redneck handing you his beer and saying "Watch this!"
Posts: 268
Threads: 9
Joined: Dec 2004
VonGodric: ok, I've written this small snippet that defines a new GfxPrint function that allows to print transparent text at any location on the screen, supports clipping (since it uses LINE) and can also write text to any GET/PUT buffer. It uses internal gfxlib fonts data, so no external fonts are required.
This snippet has also been just added to the new Appendix F (Hints) of the gfxlib docs, in CVS...
Code: DECLARE SUB GfxPrint( BYREF text AS STRING, BYVAL x AS INTEGER, BYVAL y AS INTEGER, BYVAL col AS INTEGER, BYVAL buffer AS ANY PTR = 0 )
TYPE fb_FontType
h AS INTEGER
data AS UBYTE PTR
END TYPE
' Uncomment the font you want to use
EXTERN fb_FontData ALIAS "fb_font_8x8" AS fb_FontType
'EXTERN fb_FontData ALIAS "fb_font_8x14" AS fb_FontType
'EXTERN fb_FontData ALIAS "fb_font_8x16" AS fb_FontType
SUB GfxPrint( BYREF text AS STRING, BYVAL x AS INTEGER, BYVAL y AS INTEGER, BYVAL col AS INTEGER, BYVAL buffer AS ANY PTR = 0 )
DIM row AS INTEGER, i AS INTEGER
DIM bits AS UBYTE PTR
FOR i = 1 TO LEN(text)
bits = fb_FontData.data + (ASC(MID$(text, i, 1)) * fb_FontData.h)
FOR row = 0 TO fb_FontData.h-1
IF (buffer) THEN
LINE buffer, (x + 7, y + row)-(x, y + row), col,, *bits
ELSE
LINE (x + 7, y + row)-(x, y + row), col,, *bits
END IF
bits += 1
NEXT row
x += 8
NEXT i
END SUB
SCREEN 13
GfxPrint "Hello world!", 112, 96, 15
SLEEP
Posts: 489
Threads: 34
Joined: Jan 2005
how come gfxlib looks blurry on my computer? i though maybe it was just my lcd monitor, but i took a screenshot and the pixels are being smoothed (in windowed mode only). i checked the size of the window and it's 2 pixels too high and wide. has this been fixed?
here's a pic showing the screenshot:
http://www.geocities.com/dumbledore3/yo.bmp
ttp://m0n573r.afraid.org/
Quote:quote: "<+whtiger> you... you don't know which way the earth spins?" ... see... stupidity leads to reverence, reverence to shakiness, shakiness to... the dark side
...phear
Posts: 133
Threads: 19
Joined: Jan 2005
So, your benchmark convinced me, the last thing that still holds me back, what licence do you use?
Can i programm closed source commercial with you libary?
I want to make my Breakout Clone into a full fledged small shareware game, i need to somehow finance the inspection of my motorcycle (Suzuki Burgmann 125, if someone asks)
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]
Posts: 1,272
Threads: 36
Joined: Feb 2003
Quote:how come gfxlib looks blurry on my computer? [...] has this been fixed?
Yep, here's where lillo posted a CVS build that fixes it:
http://forum.qbasicnews.com/viewtopic.php?t=8198
Posts: 133
Threads: 19
Joined: Jan 2005
Quote:here's a pic showing the screenshot:
http://www.geocities.com/dumbledore3/yo.bmp
Next time please use http://qh2.qbtk.com/ , ok?
I hate it when i klick on a geocities link and get a "bandwith exeded" message.
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]
|