cnlohr / noeuclid

Non-euclidean GPU Raytraced Game
BSD 3-Clause "New" or "Revised" License
644 stars 48 forks source link

Consider switching from GLUT to SFML #23

Closed phiresky closed 7 years ago

phiresky commented 9 years ago

(or something else like SDL)
GLUT seems to be fairly old, SDL/SFML is common and updated. Should resolve input problems.

cnlohr commented 9 years ago

Hey, I'm really sorry I'm getting back to this now. There seem to be files missing for SFML and your branch, can you re-create it and push. I don't know how I annihilated it :(. I would be up for switching, though I am opposed to SDL.

phiresky commented 9 years ago

Hi, could you describe in a bit more detail what seems to be missing? It's working fine here. And you didn't annihilate anything apart from the pull request, the branch SFML is still there (just do git checkout SFML locally and try to build/run it)

cnlohr commented 9 years ago

CMake Error at CMakeLists.txt:10 (find_package): By not providing "FindSFML.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "SFML", but CMake did not find one.

Could not find a package configuration file provided by "SFML" with any of the following names:

SFMLConfig.cmake
sfml-config.cmake

Add the installation prefix of "SFML" to CMAKE_PREFIX_PATH or set "SFML_DIR" to a directory containing one of the above files. If "SFML" provides a separate development package or SDK, be sure it has been installed.

-- Configuring incomplete, errors occurred! See also "/home/cnlohr/git/noeuclid/CMakeFiles/CMakeOutput.log".

phiresky commented 9 years ago

Do you have the SFML library installed? I don't know which system you're using, on debian/ubuntu do sudo apt-get install libsfml-dev, on arch sudo pacman -S sfml (see here). That will also provide the FindSFML file for cmake

cnlohr commented 9 years ago

Already did on Mint. I checked and the library is there A-okay! No dice as far as CMake is concerned. I should actually get a chance this weekend to dink with it more.

phiresky commented 9 years ago

I just tried it on Ubuntu, and I get the same error. It seems SFML2 simply isn't in the repositories. You would probably have to download/build it yourself..

phiresky commented 9 years ago

Nevermind, actually. SFML 2 is included in Ubuntu/etc, just the Cmake files for it are missing for whatever reason.

I think we should drop cmake again and use a plain Makefile again, the benefits were less helpful than I expected. I just pushed to the SFML branch again, it contains a simple makefile now that should work.

cnlohr commented 9 years ago

I can't seem to figure out what's going on on my system with this. It does compile using the new system, and the FPS is alright... But as soon as I move my mouse, it goes awful.

Even if I replace the loop code with:

    while(window.pollEvent(event)) {
        printf( "." );
    }

It is still super slow. If I completely remove pollEvent, it's quick, as soon as I add it back in, it's slow.

EDIT: Looks like someone else has similar problems: http://en.sfml-dev.org/forums/index.php?topic=12279.0

phiresky commented 9 years ago

I just noticed I forgot to add -O2 to the makefile, but thats probably not the problem here. I also can't see any mistakes in the implementation. You could try opening an issue there and/or running a profiler but otherwise we can just stay with glut.

cnlohr commented 9 years ago

Hmm... Can you make the SFML branch have an option for noeuclid.glut as a target? If so I say we go for it, I'll probably submit the issue later... It's also possible the version on my system is old.

phiresky commented 9 years ago

I think the APIs are too different to make that work nicely. Let's just stay with glut for now, I merge the changes from the branch that were not SFML-related.

cnlohr commented 9 years ago

Honestly, I am particularly confused now, what is the preferred method to build if I don't want SFML (since apparently it's still jankey on Mint)

phiresky commented 9 years ago

Sorry. I merged the non-SFML stuff into master, including removing CMake. So just git checkout master and make should work fine. (like in the readme)

erinzm commented 9 years ago

As a matter of interest, why SFML and not SDL?

phiresky commented 9 years ago

I have used both, but only for very small things. So the argument is mostly that I liked the SFML syntax better (more c++ish, less global clutter, better to read to me).

erinzm commented 9 years ago

@cnlohr does Mint have problems with SDL? If it doesn't, than shouldn't we use that, as the game should probably be able to run on your box :)

On Wed, Jan 7, 2015 at 3:54 PM, phiresky notifications@github.com wrote:

I have used both, but only for very small things. So the argument is mostly that I liked the SFML syntax better (more c++ish, less global clutter, better to read to me).

— Reply to this email directly or view it on GitHub https://github.com/cnlohr/noeuclid/issues/23#issuecomment-69099183.

erinzm commented 9 years ago

I could try porting it to SDL to see how well it works.

On Wed, Jan 7, 2015 at 4:20 PM, L. Mars shakespeares.integral@gmail.com wrote:

@cnlohr does Mint have problems with SDL? If it doesn't, than shouldn't we use that, as the game should probably be able to run on your box :)

On Wed, Jan 7, 2015 at 3:54 PM, phiresky notifications@github.com wrote:

I have used both, but only for very small things. So the argument is mostly that I liked the SFML syntax better (more c++ish, less global clutter, better to read to me).

— Reply to this email directly or view it on GitHub https://github.com/cnlohr/noeuclid/issues/23#issuecomment-69099183.

cnlohr commented 9 years ago

That would be good IMO. Though SDL is a large framework, I don't think GLUT is very good for supporting this. I am also frustrated to see just how poor support for SFML is right now.

erinzm commented 9 years ago

SDL, after some inspection, has a really C-ish event model, which isn't really the easiest to port into what's already going on.

erinzm commented 9 years ago

SFML would really be optimal, it's too bad that it's not working on Mint.

cnlohr commented 9 years ago

You know, it does work. I don't know why I didn't do this earlier. The package maintainer version is awful, but I tried getting a copy straight from SFML's site and it seems to work great! ( 66cd0ffed4 )

Forget SDL.

I now have the sfml branch working well (All I did was link and build against the "official" version).

Somehow it seems triggers are broken room-to-room, so if someone can look into that, solve it then merge it back to master, I would be very appreciative.

erinzm commented 9 years ago

What was the reason we removed CMake?

phiresky commented 9 years ago

I added it because I liked how it mostly automatically finds libraries and generates the build parameters. But in comparison to the makefile it pretty much just changed the syntax and made it harder to find out what was going on. Also it didn't have a Find*.cmake for some things (libtcc) so that was included "manually" anyways. So I removed it again.

phiresky commented 9 years ago

Also, for me all libraries are directly from the package manager, so they are automatically found by the compiler, without needing fancy Find scripts from cmake..

erinzm commented 9 years ago

Shouldn't this issue be closed now?

phiresky commented 9 years ago

master branch is currently still using glut

erinzm commented 9 years ago

as soon as I get my computer running again I'll run it through gdb using SFML, and see at what point the level switch doesn't work. On Jan 18, 2015 10:44 AM, "phiresky" notifications@github.com wrote:

master branch is currently still using glut

— Reply to this email directly or view it on GitHub https://github.com/cnlohr/noeuclid/issues/23#issuecomment-70415237.

phiresky commented 9 years ago

The room triggers work fine for me, by the way.

erinzm commented 9 years ago

The room triggers have always been glitchy for me, even with GLEW.

On Sun, Jan 18, 2015 at 10:57 AM, phiresky notifications@github.com wrote:

The room triggers work fine for me, by the way.

— Reply to this email directly or view it on GitHub https://github.com/cnlohr/noeuclid/issues/23#issuecomment-70415761.

cnlohr commented 9 years ago

That's rather strange... I just checked with current mainline and it seems to work well. If you have time to poke around at that it would be awesome.

erinzm commented 9 years ago

Sometimes it works, but the levels just render wrong, and nothing seems to go wrong with the C/C++ code in GDB (I usally run noeuclid with a debugger).

On Mon, Jan 19, 2015 at 12:57 PM, Charles notifications@github.com wrote:

That's rather strange... I just checked with current mainline and it seems to work well. If you have time to poke around at that it would be awesome.

— Reply to this email directly or view it on GitHub https://github.com/cnlohr/noeuclid/issues/23#issuecomment-70542816.

phiresky commented 9 years ago

Was this always like that? / did you try checking out some older version? (like git checkout 714e8133ee2cc125a5d3c29e36b3cf1090f8b4e7)

erinzm commented 9 years ago

It's always been like this, on all of my computers (hp pavilion, and toshiba chromebook 2, which I couldn't believe could run noeuclid :)

On Mon, Jan 19, 2015 at 2:28 PM, phiresky notifications@github.com wrote:

Was this always like that? / did you try checking out some older version? (like git checkout 714e8133ee2cc125a5d3c29e36b3cf1090f8b4e7)

— Reply to this email directly or view it on GitHub https://github.com/cnlohr/noeuclid/issues/23#issuecomment-70555384.