Yagl is out of the question.

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
seph
Posts: 356
Joined: Apr 27, 2006 14:49

Yagl is out of the question.

Postby seph » Sep 21, 2006 22:51

It is SLOWER than fbgfx! This example below runs extremely slow on my computer!

Code: Select all

#include "yaglwrapper.bi"
declare function loadimage(filename as string, w as integer, h as integer) as YaglGfxSurface

dim tile(0 to 1, 0 to 99) as YaglGfxSurface, testFile as any ptr
dim as integer x, y, x2, y2
dim mapcode(0 to 1, 0 to 22, 0 to 20) as ubyte
mapcode(0,3,1) = 1
mapcode(1,5,1) = 1

YaglGfxDevice_setScreenMode(640, 480, 32, 0)
screenres 1, 1, 32, , -1
tile(0, 0) = loadimage("dat\maps\town1\ground\Grass.bmp", 30, 30)
tile(0, 1) = loadimage("dat\maps\town1\ground\Dirt.bmp", 30, 30)
tile(1, 1) = loadimage("dat\maps\town1\air\LeavesTopLeft.bmp", 30, 30)
screen 0

x = 0
y = 0
do
    if YaglKeyboard_isKeyPressed(YAGL_KEY_ESCAPE) then exit do
    if YaglKeyboard_isKeyPressed(YAGL_KEY_UP) then y+=1
    if YaglKeyboard_isKeyPressed(YAGL_KEY_DOWN) then y-=1
    if YaglKeyboard_isKeyPressed(YAGL_KEY_LEFT) then x+=1
    if YaglKeyboard_isKeyPressed(YAGL_KEY_RIGHT) then x-=1
    if x > 0 then x = 0
    if y > 0 then y = 0
    if x < -690+640 then x = -690+640
    if y < -630+480 then y = -630+480
    for x2 = 0 to 22
        for y2 = 0 to 20
            YaglGfxDevice_blit x+(x2*30), y+(y2*30), tile(0, mapcode(0, x2,y2)), BLIT_SOLID, 1
            'YaglGfxDevice_blit x+(x2*30), y+(y2*30), tile(1, mapcode(1, x2,y2)), BLIT_ALPHAMASKED, &hff00ff
        next y2
    next x2
    YaglGfxDevice_swapBuffers
loop
YaglGfxDevice_destroyAllSurfaces

function loadimage(filename as string, w as integer, h as integer) as YaglGfxSurface
    dim testFile as any ptr, x as integer, y as integer, surface as YaglGfxSurface
    testFile = imagecreate(w, h)
    bload filename, testFile
    For x = 0 To w-1
            For y = 0 To h-1
                    cptr(Uinteger Ptr, testFile)[1+(y*h)+x] = cptr(Uinteger Ptr, testFile)[1+(y*h)+x] + &H1000000
            Next
    next
    surface = YaglGfxDevice_createSurface
    YaglGfxSurface_loadFromMemory surface, testFile+4, w, h, BITMAP_FORMAT_ARGB32
    imagedestroy testFile
    return surface
end function
Dr_D
Posts: 2400
Joined: May 27, 2005 4:59
Contact:

Postby Dr_D » Sep 21, 2006 23:04

It could be your gfx card. Can you make a zip file with the compiled exe in it? I haven't used yagl, so I don't have the wrapper, etc...
DaveUnit
Posts: 239
Joined: Apr 20, 2006 15:47
Location: Central MA
Contact:

Postby DaveUnit » Sep 22, 2006 0:40

yeah, that's probably it.
I have a pixel*pixel scrolling map that runs well on my pc but when I ran it on my school's pc... slooowwww. and it was even fairly slow on the computer tech computers that are better than the rest of the school's, and their processors are better than mine. I've also had very weird things happen on those computers that have never happened on mine. weird.
So.... I say it's the graphics card.

I uploaded a test of my scrolling map a few days ago so if you want, download it here and if it runs really slow I say change the scroll speed and recompile.

I have a ATI Radeon x600 graphics card and my program runs fine.

edit: I just screwed around with it... enabling vsync and then upping the scroll speed to like 6 gets a very... zippy... scroll speed. try that.
Sterling Christensen
Posts: 142
Joined: May 27, 2005 6:13

Postby Sterling Christensen » Sep 22, 2006 3:22

It might be neither the video card's nor yagl's fault.

On computers where yagl is running slow, it may be because the graphics drivers that came with Windows are still in use. You can be sure OpenGL really is being hardware accelerated properly if you install better drivers from nvidia.com, ati.com, etc.
Dr_D
Posts: 2400
Joined: May 27, 2005 4:59
Contact:

Postby Dr_D » Sep 22, 2006 3:26

Well, I already mentioned that to him. He insists on insisting that he already tried to update the driver, but the pc told him, "You don't needs any betta drivers that the ones you already gots!" *shrug*
Sterling Christensen
Posts: 142
Joined: May 27, 2005 6:13

Postby Sterling Christensen » Sep 22, 2006 16:33

Dr_D wrote:Well, I already mentioned that to him. He insists on insisting that he already tried to update the driver, but the pc told him, "You don't needs any betta drivers that the ones you already gots!" *shrug*

Sounds like he went to windowsupdate.com instead of nvidia.com/ati.com. Would nVidia/Ati's installer really say that?
sir_mud
Posts: 1401
Joined: Jul 29, 2006 3:00
Location: US
Contact:

Postby sir_mud » Sep 27, 2006 5:34

The official drivers will warn you if you try to overwrite older files, he probaly saw a Hasn't Passed WHQL warning. They only do that every three releases or more.

Return to “Libraries”

Who is online

Users browsing this forum: No registered users and 5 guests