GLFW much slower than XNA

Monkey Targets Forums/Desktop/GLFW much slower than XNA

Raz(Posted 2011) [#1]
Hi,

is there any particular reason why a GLFW build would run considerably slower than an XNA build? GLFW is 0.5fps and XNA makes the 60fps.

Ta


Soap(Posted 2011) [#2]
Post it and see if other people get the same fps?


Raz(Posted 2011) [#3]
I'll have to see if I can reproduce the slow performance in another app and then I'll post the source here :) Even on the intro screen for what I am making it performs badly for me


Soap(Posted 2011) [#4]
GLFW runs great for me... so it may be a software issue on your computer with OpenGL.


Raz(Posted 2011) [#5]
I am assuming it's a bit of both, as I have an onboard intel graphics card.


MikeHart(Posted 2011) [#6]
ok, onboard gfc, most likely that is the reason why you get a slow performance under OpenGL. On XNA it uses DirectX and that runs better with these chips.

Try GLDirect: http://sourceforge.net/projects/gldirect/

Should give you at least a decent performance for OpenGL on such a system.


Raz(Posted 2011) [#7]
Cheers Mike, though I am not yet entirely sure how I go about using it!

(checking the site as we speak)

Edit: Ok so it's a replacement for my systems opengl32.dll, right?

I tried putting it in the same folder as MonkeyGame.exe and was told my graphics adapter doesn't support it.

"Graphics adapter does not meet minimum specification for GLDirect"


MikeHart(Posted 2011) [#8]
Ok, was worth a try. For me I always installed it the regular way. And I was on XP.


Raz(Posted 2011) [#9]
Thanks for the suggestion anyway Mike.


Raz(Posted 2011) [#10]
What's going on with the "Posted X hours/minutes ago" readings?


dopeyrulz(Posted 2011) [#11]
raz,

Around the start of each month the posting times go a bit haywire - does the same at blitzbasic.com.


Raz(Posted 2011) [#12]
Got ya, thanks Matt


Neuro(Posted 2012) [#13]
This happens for me too on my higher end dev system (NVidia GTX 560M 2GB). However, on my lower end system it runs great - like 60 FPS great. Heck, even running it on a VM actually runs faster. And for some odd reason, if i were to play around with the window size (like resizing it during run time) it may cause to speed up again. Weird...think it may have something to do with the graphics card.


marksibly(Posted 2012) [#14]
Hi,

Have you guys tried updating graphics drivers? Sounds like GL is running software.


Neuro(Posted 2012) [#15]
Have you guys tried updating graphics drivers? Sounds like GL is running software.

Yep, mine's updated to the latest nvidia drivers and still does this. Its a bit sporadic too how it just randomly occurs. Sometimes it does actually run at 60 FPS, other times it crawls.


Nobuyuki(Posted 2012) [#16]
On my system, GLFW will go butt-slow when running my game in debug mode. Slower still when object caching is being employed. This all goes away when compiling in Release mode. Do the problems everyone else is having persist when compiled in Release mode?


Neuro(Posted 2012) [#17]
Do the problems everyone else is having persist when compiled in Release mode?

Yep, this still happens for me, but sporadic. Strangely though, if i were to run it on a VM it actually runs at full speed. Weird.


Chroma(Posted 2013) [#18]
GLFW runs extremely slow for me in release and debug modes. It didn't used to be like that. Something went screwy.

UPDATE: Disregard, it was my fault. I had a Print statement in there and that's what was bogging it down. Took it out and now it flies.


Neuro(Posted 2013) [#19]
Ugh...still sporadic for me, and still not sure whats causing it. In the meantime, VM is still my friend.


Raz(Posted 2013) [#20]
Not given it a go since I mentioned it a year ago, but I will do when I get home!

I'll post my specs too


Raz(Posted 2013) [#21]
Windows 7 64bit
ATI Radeon 7750 HD 800MHz 1GB PCI-Express 3.0
Intel Pentium Dual Core Sandybridge G630 2.7GHz
8GB RAM


Michael Flad(Posted 2013) [#22]
I just had the same problem while I just wanted to see what has been going on on Monkey since it's release (bought it back then, but haven't done any coding using it).

Luckily I had a very old version installed (31) gave it a try and it run fullspeed so I was able to locate the issue :)

It's the joystick/gamepad support - in my case I do have a wireless adapter for the Xbox 360 gamepad. As long as my gamepad isn't connected the glfw target is unusable slow but if I switch on the gamepad it works without an issue.
Unplugging the wireless adapter doesn't help, so the only solution is to switch on my gamepad.

So my guess is, if you used a joystick/gamepad at any time in the past, for whatever reason, Monkey (or the library Monkey uses to handle the joystick input) keeps trying to access/init/connect the joystick/gamepad and this probably timeouts after a few hundret milliseconds each frame. Well, that's at least my guess but I'm quite sure that's a pretty good shot at it.

Unfortunately I don't have a clue about the build backends so I have no idea how this could be fixed, but maybe someone who does, could have a look at the issue.


Michael Flad(Posted 2013) [#23]
Ok, this was easier than I expected (took me longer to find the bug than to find a workaround ;-))

Add these lines after mouseY=y; in gxtkInput::BeginUpdate() in the file mojo.glfw.cpp (in modules/mojo/native)

if( glfwGetJoystickParam( GLFW_JOYSTICK_1, GLFW_PRESENT ) == GL_FALSE )
{
return;
}

This is just a quick fix, I don't know if the state data of the buttons/axis should be reset to some default values if the joystick isn't present.
So just use this as a workaround until it's fixed in an official release.


Raz(Posted 2013) [#24]
Oh wow, I look forward to giving this a try :)


Raz(Posted 2013) [#25]
---

Wow yeah, it's to do with the game pad. If the Xbox controller is plugged in, it's fine, if it isn't it's really patchy. With Michael Flad's patch it's fine either way! (Thanks Michael!)