One question about GLFW

Discuss topics related to development here.
Post Reply
User avatar
Snowstorm64
Posts: 303
Joined: Sun Oct 20, 2013 8:22 pm

One question about GLFW

Post by Snowstorm64 » Mon Nov 11, 2013 2:50 pm

I'm curious, why is GLFW preferred over SDL? Looks like an uncommon choice for an emulator. I'm asking this because I was looking for input parts to make input mapping for my Wii U Controller Pro and I noticed that GLFW handles input too. But, then, isn't better to use SDL for these thing, including the audio? I mean, a lot of games use SDL for easily managing graphic, audio, and input parts together and at same time making them portable in every OS. We could say SDL is the standard de facto for games.

Enlighten me, please.
OS: Debian GNU/Linux Jessie (8.0)
CPU: Intel i7 4770K @ 3.5 GHz
Build: AVX (compiled from git)

beannaich
Posts: 149
Joined: Mon Oct 21, 2013 2:43 pm

Re: One question about GLFW

Post by beannaich » Mon Nov 11, 2013 3:05 pm

Snowstorm64 wrote:Enlighten me, please.
Allow me to recreate a brief IRC conversation that was had about this (Note: not verbatim)
IRC wrote:somedude: marathonm, why don't we use SDL instead of OpenGL/AL?
marathonm: fuck SDL.
Consider yourself enlightened :-D

User avatar
Iconoclast
Posts: 47
Joined: Fri Oct 04, 2013 8:00 pm

Re: One question about GLFW

Post by Iconoclast » Mon Nov 11, 2013 5:42 pm

I once attempted a SDL backport of angrylion's original DirectDraw, pixel-accurate plugin off which some of the RDP and VI rendering driver now in CEN64 is based.

It was generally slower at blitting the pixels to the full screen in the surmounted result due to SDL abstraction layer calls being slower than the native Microsoft DirectX calls on Win32.
Still, I would much rather use SDL over DirectX.
At the same time, I would much rather use OpenGL/OpenAL over SDL, where possible.

User avatar
MarathonMan
Site Admin
Posts: 691
Joined: Fri Oct 04, 2013 4:49 pm

Re: One question about GLFW

Post by MarathonMan » Wed Nov 13, 2013 9:19 am

I hate nothing more than tying myself to bloated, monstrous libraries.

If I wanted to drop GLFW support tomorrow, I could do so in a heartbeat because the only purpose it serves is creating a window and gathering user input. Likewise, OpenAL and OpenGL are the most open-sourced, cross-compatible libraries out there for what they do, and as such I want to use them as much as possible.

SDL, on the other hand, forces you to write an SDL application, instead of writing an application which uses SDL. It's the SDL way, or the highway.
It was generally slower at blitting the pixels to the full screen in the surmounted result due to SDL abstraction layer calls being slower than the native Microsoft DirectX calls on Win32.
Didn't the SDL scaling also make the output look all garbled (at least in Super Mario 64)?

User avatar
Iconoclast
Posts: 47
Joined: Fri Oct 04, 2013 8:00 pm

Re: One question about GLFW

Post by Iconoclast » Wed Nov 13, 2013 10:00 am

Nah, that was a defect in the SDL port because I could never understand what angrylion was trying to convey in DirectDraw.
It was a problem with the pitch scaling via pixels per line (and that SDL had no automatic stretching like DirectDraw did).

Fortunately, however, by the time anyone decided to betray my work by publishing it prematurely, it was already in that unstable state, so the source code at that point was quite hard to make do with.

Also, too bad there's no controller input open library. (OpenCL and OpenIL names are used on other things.)
Maybe there should have been an OpenJL (joystick)? :P

User avatar
Snowstorm64
Posts: 303
Joined: Sun Oct 20, 2013 8:22 pm

Re: One question about GLFW

Post by Snowstorm64 » Wed Nov 13, 2013 10:30 am

I understand your point of view, MarathonMan. Personally, I don't see nothing wrong with bloated libraries, I'm fine with either lightweight or bloated libraries, just that they work :)

I have another two questions for all of you:
1) Does GLFW support force feedback? I couldn't find anything related to it, so I'm bit worried that the support might isn't possibile with this library.

2) So, does CEN64 use OpenGL for rendering? Didn't it have a software renderer? I'm a bit confused...
OS: Debian GNU/Linux Jessie (8.0)
CPU: Intel i7 4770K @ 3.5 GHz
Build: AVX (compiled from git)

User avatar
Iconoclast
Posts: 47
Joined: Fri Oct 04, 2013 8:00 pm

Re: One question about GLFW

Post by Iconoclast » Wed Nov 13, 2013 11:01 am

Software rendering is more than possible in OpenGL.

User avatar
MarathonMan
Site Admin
Posts: 691
Joined: Fri Oct 04, 2013 4:49 pm

Re: One question about GLFW

Post by MarathonMan » Wed Nov 13, 2013 11:43 pm

GLFW doesn't support any kind of force feedback to my knowledge.

CEN64 does have a software renderer. However, even though the output image is rendered is software, it still needs a graphics library of some sort to raster the image to the client's window. It uses OpenGL to do this in a hardware-accelerated manner (and it also uses OpenGL to perform the scaling from 320p/etc. resolutions to the 640p or that of the window in hardware).

User avatar
Snowstorm64
Posts: 303
Joined: Sun Oct 20, 2013 8:22 pm

Re: One question about GLFW

Post by Snowstorm64 » Thu Nov 14, 2013 4:05 pm

MarathonMan wrote:GLFW doesn't support any kind of force feedback to my knowledge.
Well, this is disappointing. So it means that force feedback support is completely cut by CEN64 atm? Or do you intend to push GFLW's authors to implement force feedback in a short time?
MarathonMan wrote: CEN64 does have a software renderer. However, even though the output image is rendered is software, it still needs a graphics library of some sort to raster the image to the client's window. It uses OpenGL to do this in a hardware-accelerated manner (and it also uses OpenGL to perform the scaling from 320p/etc. resolutions to the 640p or that of the window in hardware).
Interesting. So theorically it should be easy to manipulate pixels with, e.g., GLSL shaders too, am I wrong?
OS: Debian GNU/Linux Jessie (8.0)
CPU: Intel i7 4770K @ 3.5 GHz
Build: AVX (compiled from git)

User avatar
MarathonMan
Site Admin
Posts: 691
Joined: Fri Oct 04, 2013 4:49 pm

Re: One question about GLFW

Post by MarathonMan » Thu Nov 14, 2013 8:47 pm

Snowstorm64 wrote:Well, this is disappointing. So it means that force feedback support is completely cut by CEN64 atm? Or do you intend to push GFLW's authors to implement force feedback in a short time?
Right now, I've been pushing off any promises of features until the emulator becomes more stable and the show-stopping bugs are fixed.
Snowstorm64 wrote:Interesting. So theorically it should be easy to manipulate pixels with, e.g., GLSL shaders too, am I wrong?
You'd need a GLSL library to do this, but yes. There are actually some filters that MAME and others use out in the wild to make it look more like the actual image (and require only OpenGL). I've stripped them out for the time being as I was pulling from angrylion's code and they had Windows-specific things embedded into them that I didn't feel like reversing at the time.

User avatar
Snowstorm64
Posts: 303
Joined: Sun Oct 20, 2013 8:22 pm

Re: One question about GLFW

Post by Snowstorm64 » Fri Nov 15, 2013 6:45 pm

MarathonMan wrote: Right now, I've been pushing off any promises of features until the emulator becomes more stable and the show-stopping bugs are fixed.
Well, I should have known that. I'm hoping force feedback will be added to CEN64 someday, too.
MarathonMan wrote: You'd need a GLSL library to do this, but yes. There are actually some filters that MAME and others use out in the wild to make it look more like the actual image (and require only OpenGL). I've stripped them out for the time being as I was pulling from angrylion's code and they had Windows-specific things embedded into them that I didn't feel like reversing at the time.
Good thing. In the future we will play with shader like this :P
OS: Debian GNU/Linux Jessie (8.0)
CPU: Intel i7 4770K @ 3.5 GHz
Build: AVX (compiled from git)

User avatar
Iconoclast
Posts: 47
Joined: Fri Oct 04, 2013 8:00 pm

Re: One question about GLFW

Post by Iconoclast » Fri Nov 15, 2013 8:16 pm

I've stripped them out for the time being as I was pulling from angrylion's code and they had Windows-specific things embedded into them that I didn't feel like reversing at the time.
Not really anything Windows-specific in the angrylion plugin, just DirectX.

User avatar
MarathonMan
Site Admin
Posts: 691
Joined: Fri Oct 04, 2013 4:49 pm

Re: One question about GLFW

Post by MarathonMan » Fri Nov 15, 2013 8:20 pm

Iconoclast wrote:Not really anything Windows-specific in the angrylion plugin, just DirectX.
Correct. Whenever I see TYPES THAT ARE IN ALL CAPITAL LETTERS AND OBNOXIOUSLY LONG, I just nope.avi my way out. :D

User avatar
Snowstorm64
Posts: 303
Joined: Sun Oct 20, 2013 8:22 pm

Re: One question about GLFW

Post by Snowstorm64 » Fri Nov 15, 2013 8:38 pm

Iconoclast wrote:
I've stripped them out for the time being as I was pulling from angrylion's code and they had Windows-specific things embedded into them that I didn't feel like reversing at the time.
Not really anything Windows-specific in the angrylion plugin, just DirectX.

But... since DirectX is only for Windows, we could say it's indeed Windows-specific. ;)
OS: Debian GNU/Linux Jessie (8.0)
CPU: Intel i7 4770K @ 3.5 GHz
Build: AVX (compiled from git)

User avatar
Iconoclast
Posts: 47
Joined: Fri Oct 04, 2013 8:00 pm

Re: One question about GLFW

Post by Iconoclast » Sat Nov 16, 2013 1:10 am

MarathonMan wrote:
Iconoclast wrote:Not really anything Windows-specific in the angrylion plugin, just DirectX.
Correct. Whenever I see TYPES THAT ARE IN ALL CAPITAL LETTERS AND OBNOXIOUSLY LONG, I just nope.avi my way out. :D
Yeah, I know it appears as if there is something Windows-specific. (In fact you can see some WIN32 defines for "conditional" things which actually turn out to be redundant. I safely removed such things such that there was nothing Windows-specific, just blitting using the language of DirectX.)

But like you said, it was very annoying to read.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest