runningwild / glop

Bare-bones osx alternative to sdl
Other
76 stars 8 forks source link

Build instructions? #2

Open DevelopSMM opened 9 years ago

DevelopSMM commented 9 years ago

I'm really excited to try this library, but I'm having trouble compiling the dependencies. (Windows 10 x64 - Powershell, also have an OS X and an Arch Linux machine available, but game development happens on the Windows box.)

go get github.com/runningwild/glop/

package github.com/go-gl/glow/procaddr: cannot find package "github.com/go-gl/glow/procaddr" in any of:
        C:\Applications\Go\src\github.com\go-gl\glow\procaddr (from $GOROOT)
        C:\Users\{OMITTED}\src\github.com\go-gl\glow\procaddr (from $GOPATH)
package github.com/go-gl/glow/procaddr/auto: cannot find package "github.com/go-gl/glow/procaddr/auto" in any of:
        C:\Applications\Go\src\github.com\go-gl\glow\procaddr\auto (from $GOROOT)
        C:\Users\{OMITTED}\src\github.com\go-gl\glow\procaddr\auto (from $GOPATH)

Okay, so I'll go grab that.

go get github.com/go-gl/glow/procaddr

package github.com/go-gl/glow/procaddr: cannot find package "github.com/go-gl/glow/procaddr" in any of:
        C:\Applications\Go\src\github.com\go-gl\glow\procaddr (from $GOROOT)
        C:\Users\{OMITTED}\src\github.com\go-gl\glow\procaddr (from $GOPATH)

Okay, I know at least glow is a package because I've been looking through the go-gl repository as I play with OpenGL in Go. So let's go get that and follow its readme.

go get github.com/go-gl/glow cd {path}/glow go build ./glow download

Various failures in downloading, every time I try a different file fails, but usually in documentation, so that's fine. Let's try to build anyway. Uh.... not sure what version of OpenGL I'll need.... I'll just use the version mentioned in the readme for glow.

./glow generate -api=gl -version=3.3 -profile=core -remext=GL_ARB_cl_event

error parsing version: invalid version string: 3

Okay, that's what the readme said, but fine, let's try quotes. Powershell usually uses double quotes, so that's where we'll start.

./glow generate -api=gl -version="3.3" -profile=core -remext=GL_ARB_cl_event

generated package in gl

Great, so now there's a subfolder called gl, and inside I see procaddr.go, but its package is gl and it doesn't seem to be in the procaddr/auto directory that some earlier output aluded to....

Where do I go from here?

runningwild commented 9 years ago

I definitely wasn't expecting anyone to try using this :) I haven't built this in a while, but I can try this weekend. That being said it won't be on a windows machine, it will be on OSX, but that might be enough to fix whatever dependency problems there are. I might need to start using godep for this.

DevelopSMM commented 9 years ago

That would be great, thank you! No worries about OS X, I can build on any platform to confirm I can, and then get it working from there on Windows. Goal is to support all three, just that my Windows box is the most powerful so that's where I'll be working most of the time.

runningwild commented 9 years ago

Hey there, sorry I didn't have time to get to this over the weekend. At a quick glance it looks like the gl bindings I was using have gotten into a bad state, if you look on github you'll see that they've been forked and the same bindings are being maintained by someone else now. If not much has changed you might try updating glop to use the newer bindings. Alternatively you could reset the errcw/glow repo on your computer to a revision from around the last time glop was updated (about a year ago). Presumably that would be roughly the last version I used, which should work.

Shame on me for not using godeps :-P I'll try to update this this week if possible, if you do get it working, though, please send a PR :)

On Fri, Sep 11, 2015 at 2:14 PM, DevelopSMM notifications@github.com wrote:

That would be great, thank you! No worries about OS X, I can build on any platform to confirm I can, and then get it working from there on Windows. Goal is to support all three, just that my Windows box is the most powerful so that's where I'll be working most of the time.

— Reply to this email directly or view it on GitHub https://github.com/runningwild/glop/issues/2#issuecomment-139617016.

DevelopSMM commented 9 years ago

No worries, I just set aside some more time today to get this working. Not quite there yet, but I've made progress.

Step 1: Everywhere it appears (text/text.go, render/shader.go), I replaced "github.com/errcw/glow/gl-core/3.3/gl" with "github.com/go-gl/gl/v3.3-core/gl".

Then comes the bit that worries me: in shader.go we replace all instances of *int8 with *uint8. Same with **int8. Not sure the repercussions of that change, I'm a bit worried that the two libraries use different signedness while wrapping the same API.

That gets every package but gos to compile, but from the looks of it I'll need that package as well. Of course it's the cgo section that's causing trouble.....

It looks like the problem is that gos\cgo_windows.go (and OS X/Linux alternatives) uses a -lglop flag, and I don't have that library on my machine. Every other section has been compiled, and I can't find it on Google.

Next step sometime between tomorrow and next weekend is to try from OS X, unless you have some insight.

runningwild commented 9 years ago

The int8/uint8 is strange, but I don't think there is anything to worry about, you'll send the same bits to opengl regardless, and it won't even know if you thought those bits were signed or not.

libglop is the glue between the gos package and the host operating system. You should be able to compile it by going into glop/gos/ and running ./make.bash. On OSX you might need to install xcode, I don't remember what you need on windows, although if you have trouble I can dig up an old email where a friend of mine got this working on windows.

You can check out https://github.com/runningwild/jota as an example if you want. That's an old project I used to work on, in the make directory you'll find a script that compiles for osx and another for linux, those might help if you run into any roadblocks on those OSes.

Clearly I could use a good example project and a better README.md :)

On Tue, Sep 15, 2015 at 1:04 AM, DevelopSMM notifications@github.com wrote:

No worries, I just set aside some more time today to get this working. Not quite there yet, but I've made progress.

Step 1: Everywhere it appears (text/text.go, render/shader.go), I replaced "github.com/errcw/glow/gl-core/3.3/gl" with " github.com/go-gl/gl/v3.3-core/gl".

Then comes the bit that worries me: in shader.go we replace all instances of int8 with *uint8. Same with `*int8. Not sure the repercussions of that change, I'm a bit worried that the two libraries use different signedness while wrapping the same API.

That gets every package but gos to compile, but from the looks of it I'll need that package as well. Of course it's the cgo section that's causing trouble.....

It looks like the problem is that gos\cgo_windows.go (and OS X/Linux alternatives) uses a -lglop flag, and I don't have that library on my machine. Every other section has been compiled, and I can't find it on Google.

Next step sometime between tomorrow and next weekend is to try from OS X, unless you have some insight.

— Reply to this email directly or view it on GitHub https://github.com/runningwild/glop/issues/2#issuecomment-140283057.

DevelopSMM commented 9 years ago

Alright. After installing and configuring Cygwin, (which I had only been avoiding out of a desire to actually get to know Powershell rather than just assume I like bash/etc better.) I've gotten slightly further, but I'm still not there yet.

Again seems like mostly Windows specific problems, next step is definitely building on OS X.

Clearly I could use a good example project and a better README.md :)

99% of open source right there in that sentence. :P

runningwild commented 9 years ago

Any progress on this? I finally got a chance to spend some time on it. I was able to get a sample program compiling, but the font package isn't working, I think the shader I was previously using no longer works with the new opengl package I'm linking in, but I haven't had time to dig deep enough into that to know for sure.

I pushed a change to glop that includes the new version of opengl. I also pushed this repo: https://github.com/runningwild/glomple That's what I was testing with. I can open up an opengl context, but not actually draw anything, so clearly something isn't hooked up right anymore. Also the linker complains about osx version, I don't really know what that's about.

Anyway, just letting you know what I've been working on. I'll let you know if I actually get anything significant working.

On Wed, Sep 16, 2015 at 1:55 AM, DevelopSMM notifications@github.com wrote:

Alright. After installing and configuring Cygwin, (which I had only been avoiding out of a desire to actually get to know Powershell rather than just assume I like bash/etc better.) I've gotten slightly further, but I'm still not there yet.

  • Cannot run the make file itself, even edited as per below. I'll have to track this issue down and or compile on my mac laptop.
  • Cannot compile with default settings, specifically 32 bit.
  • I can compile in 64 bit, but then I can't find the linked libraries in 64 bit. They still link successfully but I have to assume it'd be broken regardless.
  • Once I have a compiled DLL, no matter where I place it, I still get errors about not finding that library when I run go run or go build in my own application. Doesn't seem to matter if I put it in CWD, next to main.go, in the MinGW include directory, or even sys32.

Again seems like mostly Windows specific problems, next step is definitely building on OS X.

— Reply to this email directly or view it on GitHub https://github.com/runningwild/glop/issues/2#issuecomment-140634928.

runningwild commented 9 years ago

Got the font working, so at least that's something. Pushed the changes to glomple if you want to see them. The make/darwin.bash script is the only one I've tested though.

On Wed, Sep 23, 2015 at 11:11 PM, Jonathan Wills runningwild@gmail.com wrote:

Any progress on this? I finally got a chance to spend some time on it. I was able to get a sample program compiling, but the font package isn't working, I think the shader I was previously using no longer works with the new opengl package I'm linking in, but I haven't had time to dig deep enough into that to know for sure.

I pushed a change to glop that includes the new version of opengl. I also pushed this repo: https://github.com/runningwild/glomple That's what I was testing with. I can open up an opengl context, but not actually draw anything, so clearly something isn't hooked up right anymore. Also the linker complains about osx version, I don't really know what that's about.

Anyway, just letting you know what I've been working on. I'll let you know if I actually get anything significant working.

On Wed, Sep 16, 2015 at 1:55 AM, DevelopSMM notifications@github.com wrote:

Alright. After installing and configuring Cygwin, (which I had only been avoiding out of a desire to actually get to know Powershell rather than just assume I like bash/etc better.) I've gotten slightly further, but I'm still not there yet.

  • Cannot run the make file itself, even edited as per below. I'll have to track this issue down and or compile on my mac laptop.
  • Cannot compile with default settings, specifically 32 bit.
  • I can compile in 64 bit, but then I can't find the linked libraries in 64 bit. They still link successfully but I have to assume it'd be broken regardless.
  • Once I have a compiled DLL, no matter where I place it, I still get errors about not finding that library when I run go run or go build in my own application. Doesn't seem to matter if I put it in CWD, next to main.go, in the MinGW include directory, or even sys32.

Again seems like mostly Windows specific problems, next step is definitely building on OS X.

— Reply to this email directly or view it on GitHub https://github.com/runningwild/glop/issues/2#issuecomment-140634928.

DevelopSMM commented 9 years ago

I'm excited to hear that!

I made some progress on getting it to work, but in the process I ran into some issues with scripting languages, and some more with physics, and so I've had to reevaluate my use of the language overall.

For my current project I've had to just bite the bullet and go back to C++/SDL/Bullet/(duktape or lua). Not ideal but it works and I can control memory/cleanup a little better than Golang. Plus this little snippet helps ease the pain of doing C++ a little longer.

I would love to check out this library again in the future, but first I'll need all the other pieces to work.