These are chat archives for AlwaysGeeky/Vox

25th
May 2016
Polyrhythm
@Polyrhythm
May 25 2016 03:45
hey! i'm the guy working on OSX compatibility
basically, i've had to (for now) hard cover every file path just to get past that initial step
i've also had to slightly alter how we include opengl :P
the real fun is starting now though, OSX doesn't by default support version 150 shaders, and you have a version 150 shader orw two in there...instance.vertex and instance.pixel
so either i figure out how to force osx to emulate a more advanced opengl through a "core profile" or translate the 150 shaders to 120
playing with both right now
i got my osx to use opengl 4.1 but now glew is having problems grabbing the shader extensions for that opengl version
Peter Taylor
@emersont1
May 25 2016 05:41
Isnt 1.5 core 3 though?
Polyrhythm
@Polyrhythm
May 25 2016 22:29
by default macs get 120 glsl shaders and opengl 2.1
and i've gotten my mac to be higher in compatibility mode but then like i was saying, glew isn't loading the shader extensions on opengl 4.1 for me
i took a quick look at instance.pixel and instance.vertex and tried to translate them to 120, but run into an issue of inverse not being available
Anthony M. Cook
@acook
May 25 2016 22:31
@Polyrhythm How were you able to include OpenGL?
Polyrhythm
@Polyrhythm
May 25 2016 22:31
and one of the shaders does transpose(inverse(...)) on a matrix or something
acook @acook is also trying to compile on osx
Polyrhythm
@Polyrhythm
May 25 2016 22:31
@acook let me push up what i have so far and i can show you
@acook here is a PR that shows what I've had to do so far
AlwaysGeeky/Vox#175
I've got it building and linking all the way and am now working through getting the damn thing to actually run. on opengl stuff
Polyrhythm
@Polyrhythm
May 25 2016 22:36
note that I've hardcoded all the paths for now until I get around to using realpath or some such
so if you wanted to use my PR you'd have to change those hardcoded paths as well :(
relative paths don't work so great in c++ for osx
i'm on el capitan with a 2014 macbook
https://github.com/AlwaysGeeky/Vox/pull/175/files#diff-bfd574051572855ffede390ec872fc68R23 is where you can force your mac to use an opengl later than 2.1
Steve
@AlwaysGeeky
May 25 2016 23:42
Good work on trying to get OSX compatability working
I know this is a hard task
hence why I try to avoid OSX dev mostly myself
Polyrhythm
@Polyrhythm
May 25 2016 23:42
all good, it's a good learning experience for me
i have 0 opengl experience or and am highly motivated to have a fun toy to play with on my mac
Steve
@AlwaysGeeky
May 25 2016 23:43
ahh excellent :)
glad to have provided that for you
also for the imstance shader issue being 150
there is code to disable this shader if it cant be loaded
so dont worry too much about it not working
in fact if you only have 120 shader support then the game should still be able to run
I made it so that if those shaders dont get loaded, it falls back to default rendering, but it wont look as nice
Polyrhythm
@Polyrhythm
May 25 2016 23:44
interesting. well the thing crashes pretty hard when it tries to load the shader so let me get the backtrace
ERROR: Could not load GLSL shaders: media/shaders/instance.vertex, media/shaders/instance.pixel
ERROR: 0:1: '' :  version '150' is not supported
ERROR: Could not load GLSL shaders: /Users/ryanjones/Development/cpp/Vox/media/shaders/instance.vertex, /Users/ryanjones/Development/cpp/Vox/media/shaders/instance.pixel
libc++abi.dylib: terminating with uncaught exception of type std::length_error: vector
Steve
@AlwaysGeeky
May 25 2016 23:46
Yes it gives that error but does that prevent the running?
Polyrhythm
@Polyrhythm
May 25 2016 23:47
yeah, then i get a really bad looking error
Thread 1 received signal SIGABRT, Aborted.
0x00007fff9298d002 in __pthread_kill () from /usr/lib/system/libsystem_kernel.dylib
(gdb) bt
#0  0x00007fff9298d002 in __pthread_kill () from /usr/lib/system/libsystem_kernel.dylib
#1  0x00007fff8f49e5c5 in ?? () from /usr/lib/system/libsystem_pthread.dylib
warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)
i don't know what almost any of that means
Steve
@AlwaysGeeky
May 25 2016 23:47
hmmmm, try commenting out the loading of that shader then
see if you still get similar errors
Polyrhythm
@Polyrhythm
May 25 2016 23:52
huh okay. i commented out the shader loading and get the same error so
exception of type std::length_error: vector must refer to something else
later in the call stack
Steve
@AlwaysGeeky
May 25 2016 23:53
yeh, that was my thinking... because. If I deliberately put an error in the shader files so they dont compile, the game stull runs for me on windows and linux
I still get the error saying "Could not load GLSL shaders" but the game just carries on with limited graphics shading
Polyrhythm
@Polyrhythm
May 25 2016 23:54
weird, i can't get any files after the shader loading in the stack to indicate where the error is occuring
i'll fix up that mutex thing first since that seems like a culprit for weird errors if you're using one not in the std namespace
Steve
@AlwaysGeeky
May 25 2016 23:57
yeh that might be a good idea
at the top of the file it does say using: namespace tthread
so I dunno why you need to add the namespace
Polyrhythm
@Polyrhythm
May 25 2016 23:58
i think the osx compiler wanted to disambiguate std::mutex vs tthread::mutex
Steve
@AlwaysGeeky
May 25 2016 23:58
Ah ok
that makes sense