Must be the graphics card, yes. It works on my Nvidia card, even on windows.
Sorry about that, then. I thought about hacking together a simpler example for snapping to grid with a camera-offset and zoom, but I have a big exam coming up, so I figured I'd just post something I already had. Bad choice, maybe.
I might add a simpler example if the above one doesn't work for the OP or if he needs it.
If anyone else has more bugs with the example, though, maybe just post it in this thread, because I don't want to hijack this thread for my bugs ...
snap object to grid
-
- Party member
- Posts: 712
- Joined: Fri Jun 22, 2012 4:54 pm
- Contact:
Re: snap object to grid
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
- slime
- Solid Snayke
- Posts: 3166
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: snap object to grid
nvidia drivers are known for only loosely following the OpenGL specification, when it suits them. For example, in many cases nvidia's GLSL compiler will allow functions and syntax in versions of GLSL where they're supposed to be disallowed, just because they're allowed in some later version or because their GLSL compiler shares code with their Cg or HLSL compilers where it is allowed.Germanunkol wrote:Must be the graphics card, yes. It works on my Nvidia card, even on windows.
In any case, "1f" is not valid GLSL for specifying a float literal. "1.f", "1.0f", and "1.0" all work fine, if you change the "1f" in line 10 to use one of those.
-
- Party member
- Posts: 712
- Joined: Fri Jun 22, 2012 4:54 pm
- Contact:
Re: snap object to grid
Thanks for pointing that out...!
But I did change it to "1.0", because I suspected something of the sort (well, and mostly because the error was complaining about the f), and bekey still says it's not running...
Is it possible that only 1.0f works, but not 1.0?
Edit: Scratch that.I missed an f
Edit2: Updated the Demo above for the 100th time -.-
But I did change it to "1.0", because I suspected something of the sort (well, and mostly because the error was complaining about the f), and bekey still says it's not running...
Is it possible that only 1.0f works, but not 1.0?
Edit: Scratch that.I missed an f
Edit2: Updated the Demo above for the 100th time -.-
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
-
- Party member
- Posts: 712
- Joined: Fri Jun 22, 2012 4:54 pm
- Contact:
Re: snap object to grid
Not a problem. Thanks a lot for reporting!
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
- mangadrive
- Prole
- Posts: 32
- Joined: Sat Nov 17, 2012 10:26 pm
Re: snap object to grid
Thanks for the suggestions and I looked over them.
I hard coded it because it's a static 4x4 box. So it's only 8 checks for x,y and total. The box won't be moving and I've committed to my resolution because I designed the UI first, albeit a weird resolution size but I'm the guy making it so that's my call right? In the weird off chance that I do need to move/change, I'd be changing the selector's checks manually but everything else has been based around object.x/y and said selector pointing at it so no harm no foul. Again I was over thinking this graciously, but did learn the perils of going away from a 0,0 centered map, so will avoid that in a future project and everything said will be more relevant.
I still learned from this post and appreciate all of the input.
I hard coded it because it's a static 4x4 box. So it's only 8 checks for x,y and total. The box won't be moving and I've committed to my resolution because I designed the UI first, albeit a weird resolution size but I'm the guy making it so that's my call right? In the weird off chance that I do need to move/change, I'd be changing the selector's checks manually but everything else has been based around object.x/y and said selector pointing at it so no harm no foul. Again I was over thinking this graciously, but did learn the perils of going away from a 0,0 centered map, so will avoid that in a future project and everything said will be more relevant.
I still learned from this post and appreciate all of the input.
Who is online
Users browsing this forum: aikusuuta and 7 guests