From ro at stiegerhs.de Tue Oct 2 08:15:02 2007 From: ro at stiegerhs.de (Ingmar Stieger) Date: Tue, 02 Oct 2007 14:15:02 +0200 Subject: [ruby-opengl-devel] Compiling on Windows with VS2005 Message-ID: <47023646.4090709@stiegerhs.de> Hi, for a project of mine I want to use Ruby with ODE (Open Dynamics Engine) and OpenGL on Windows. Since ODE does no longer support VC6, I had to compile everything from scratch wit Visual Studio 2005 Express. So far, I've succeeded in compiling Ruby 1.8.6, ODE, Ruby-ODE, and Ruby-OpenGL, so I think my build environment is at least not totally off. Unfortunately, if I try to require 'gl', Windows complains about the runtime environment as Ruby tries to load lib/gl.so. I made sure to recompile everything with the same environment, so I did not mix e.g. debug and retail builds. If I e.g. require 'ode', the library loads just fine. This is the error that is displayed: R6034 An application has made an attempt to load the C runtime library incorrectly. Please contact the application's support team for more information. Then I created a small test project in C, and tried to call Init_gl in gl.so, which works if I use the /MD (multi-threaded DLL) runtime environment, with which Ruby and Ruby-OpenGL have been built as well. So gl.so works from my test program, but not when loaded by Ruby. Why would that be ? So, could somebody please point me into the right direction ? I think it must be something stupid that I have overlooked, but currently I have no idea how to continue... Thanks, Ingmar Stieger From jan.dvorak at kraxnet.cz Thu Oct 4 17:14:21 2007 From: jan.dvorak at kraxnet.cz (Jan Dvorak) Date: Thu, 4 Oct 2007 23:14:21 +0200 Subject: [ruby-opengl-devel] Compiling on Windows with VS2005 In-Reply-To: <47023646.4090709@stiegerhs.de> References: <47023646.4090709@stiegerhs.de> Message-ID: <200710042314.21114.jan.dvorak@kraxnet.cz> Hello, On Tuesday 02 October 2007 14:15, Ingmar Stieger wrote: > for a project of mine I want to use Ruby with ODE (Open Dynamics Engine) > and OpenGL on Windows. Since ODE does no longer support VC6, I had to > compile everything from scratch wit Visual Studio 2005 Express. > > So far, I've succeeded in compiling Ruby 1.8.6, ODE, Ruby-ODE, and > Ruby-OpenGL, so I think my build environment is at least not totally off. > > Unfortunately, if I try to require 'gl', Windows complains about the > runtime environment as Ruby tries to load lib/gl.so. I made sure to > recompile everything with the same environment, so I did not mix e.g. > debug and retail builds. If I e.g. require 'ode', the library loads just > fine. This is the error that is displayed: > Unfortunately i was able to test the bindings only on VC 6, although i can't see any reason why it shouldn't work on any other versions. The only difference between ruby-opengl and ruby-ode are that we are linking to system library (opengl32.dll), but that should be compiler independent as far as i can tell. If you try to replace Init_gl function in gl.c with empty one, then try to compile and load it, does it still crash ? Possible solution to your problem may be trying to use the VC6 ruby installer, ruby-ode and ruby-opengl compiled with VC6 and only the ODE itself compiled under VC8/VS2005. Other than that, i am afraid i cannot be of much help as i know very little about windows linking and compilers in general, sorry. Jan From ro at stiegerhs.de Fri Oct 5 06:37:00 2007 From: ro at stiegerhs.de (Ingmar Stieger) Date: Fri, 05 Oct 2007 12:37:00 +0200 Subject: [ruby-opengl-devel] Compiling on Windows with VS2005 In-Reply-To: <200710042314.21114.jan.dvorak@kraxnet.cz> References: <47023646.4090709@stiegerhs.de> <200710042314.21114.jan.dvorak@kraxnet.cz> Message-ID: <470613CC.1050901@stiegerhs.de> Hi, On 04 October 2007 23:14, Jan Dvorak wrote: > Unfortunately i was able to test the bindings only on VC 6, although i can't > see any reason why it shouldn't work on any other versions. The only > difference between ruby-opengl and ruby-ode are that we are linking to system > library (opengl32.dll), but that should be compiler independent as far as i > can tell. If you try to replace Init_gl function in gl.c with empty one, then > try to compile and load it, does it still crash ? Possible solution to your > problem may be trying to use the VC6 ruby installer, ruby-ode and ruby-opengl > compiled with VC6 and only the ODE itself compiled under VC8/VS2005. > Other than that, i am afraid i cannot be of much help as i know very little > about windows linking and compilers in general, sorry. Thanks for your answer. After a couple of hours fiddling around with various combinations, I finally found the root of the problem: It is not directly ruby-opengl related, but a problem of the Ruby build scripts for Visual Studio 2005: The manifest files for msvcr80-ruby18.dll und ruby.exe are not embedded into the executeables like VS2005 normally does, so you have to create them on your own and copy them into ruby's bin/ directory. After I did that, the error message went away and ruby-opengl works just fine ! The runtime environment had no problem with ODE, but for some reason definitely needs the files for opengl. Oh well... Thanks again, Ingmar From hoanga at alum.rpi.edu Wed Oct 10 20:23:20 2007 From: hoanga at alum.rpi.edu (Alain Hoang) Date: Thu, 11 Oct 2007 09:23:20 +0900 Subject: [ruby-opengl-devel] gem install ruby-opengl fails In-Reply-To: <525BDBD2-0F5A-4AE2-96F4-3F5A4025206F@3e.org> References: <20071010191713.5484CA897E@randymail-a12.g.dreamhost.com> <525BDBD2-0F5A-4AE2-96F4-3F5A4025206F@3e.org> Message-ID: <470D6CF8.7010602@alum.rpi.edu> Hi Daniel, Daniel Drucker wrote: > Hi, > Do you have any idea what I need to do here? I think so. [1] I just reproduced the same error on my Powerbook as well to my dismay. > > I have glut, glut-shlibs, & opengl-rb18 installed via fink. > > This seems to be a widespread unsolved problem, judging from google > results. > > drbrown:~ dmd$ sudo gem install -y ruby-opengl net-ssh -r > Attempting remote installation of 'ruby-opengl' > Select which gem to install for your platform (i686-darwin) > 1. ruby-opengl 0.40.1 (i386-mswin32) > 2. ruby-opengl 0.40.1 (ruby) > 3. ruby-opengl 0.40.0 (ruby) > 4. ruby-opengl 0.33.0 (ruby) > 5. Cancel installation > > 2 > Building native extensions. This could take a while... > ERROR: While executing gem ... (RuntimeError) > ERROR: Failed to build gem native extension. > Gem files will remain installed in > /sw/var/lib/gems/1.8/gems/ruby-opengl-0.40.1 for inspection. > ruby Rakefile install -y ruby-opengl net-ssh -r\n I'm not sure how to fix this cleanly at the moment but I believe here is a dirty hack to ensure that it builds. 1. Ensure the latest version of mkrf is installed $ gem update -y mkrf 2. Set the environment variable named MACOSX_DEPLOYMENT to something matching your OS X version (in my case 10.4) # In bourne-shell or bash $ export MACOSX_DEPLOYMENT_TARGET=10.4 # In tcsh or csh $ setenv MACOSX_DEPLOYMENT_TARGET 10.4 3. Now run gem install $ sudo gem install ruby-opengl This got the bindings to build for me in OS X. I'll look into how to get this to 'just work' when I get some spare cycles. Cheers, Alain [1] http://developer.apple.com/qa/qa2001/qa1233.html From hoanga at alum.rpi.edu Wed Oct 10 22:08:03 2007 From: hoanga at alum.rpi.edu (Al Hoang) Date: Thu, 11 Oct 2007 11:08:03 +0900 Subject: [ruby-opengl-devel] gem install ruby-opengl fails In-Reply-To: <2A8D0735-C082-45F2-9DDB-BC4CBC0A390E@3e.org> References: <20071010191713.5484CA897E@randymail-a12.g.dreamhost.com> <525BDBD2-0F5A-4AE2-96F4-3F5A4025206F@3e.org> <470D6CF8.7010602@alum.rpi.edu> <2A8D0735-C082-45F2-9DDB-BC4CBC0A390E@3e.org> Message-ID: <20071011020803.GB58694@samsara.bebear.net> Hi Daniel, Please send me the the output from the gem_make.out file and I'll try to look into it from there. Alain p.s. I'm CCing the ruby-opengl-dev mailing list on this since this is a good thing to have archived. On Wed, Oct 10, 2007 at 08:38:34PM -0400, Daniel Drucker wrote: > Hmm. Didn't work for me: > > [snip] > Results logged to /sw/var/lib/gems/1.8/gems/ruby-opengl-0.40.1/ > gem_make.out > From cassius at xmodulation.com Sun Oct 14 18:50:29 2007 From: cassius at xmodulation.com (Cassius Rosenthal) Date: Sun, 14 Oct 2007 18:50:29 -0400 Subject: [ruby-opengl-devel] ruby-opengl and RMagick Message-ID: <47129D35.50400@xmodulation.com> Hello all, I am interested in using opengl to resize images. I have ruby-opengl running, and in irb I'm trying to pass an RMagick image to GL.TexImage2D, but I get a type error. The roadmap page on the web site says, "Add image handling wrapper for easy image handling." Obviously that hasn't been implemented yet, but I am encouraged that I'm not the only one interested in functionality like that. irb> GL.TexImage2D( GL::TEXTURE_2D, 0, 3, 150, 150, 0, GL::RGB, GL::BYTE, @image) TypeError: type mismatch:# from (irb):27:in `TexImage2D' from (irb):27 Any hints on how to pass an instance of an RMagick image to GL? Has anybody done anything similar? Thanks! -Casey From gsslist+rgl at anthropohedron.net Sun Oct 14 19:07:40 2007 From: gsslist+rgl at anthropohedron.net (Gregory Seidman) Date: Sun, 14 Oct 2007 19:07:40 -0400 Subject: [ruby-opengl-devel] ruby-opengl and RMagick In-Reply-To: <47129D35.50400@xmodulation.com> References: <47129D35.50400@xmodulation.com> Message-ID: <20071014230738.GA8799@anthropohedron.net> On Sun, Oct 14, 2007 at 06:50:29PM -0400, Cassius Rosenthal wrote: > Hello all, > > I am interested in using opengl to resize images. I have ruby-opengl > running, and in irb I'm trying to pass an RMagick image to > GL.TexImage2D, but I get a type error. The roadmap page on the web site > says, "Add image handling wrapper for easy image handling." Obviously > that hasn't been implemented yet, but I am encouraged that I'm not the > only one interested in functionality like that. > > irb> GL.TexImage2D( GL::TEXTURE_2D, 0, 3, 150, 150, 0, GL::RGB, > GL::BYTE, @image) > TypeError: type mismatch:# > from (irb):27:in `TexImage2D' > from (irb):27 > > Any hints on how to pass an instance of an RMagick image to GL? Has > anybody done anything similar? Take a look at my solution to Ruby Quiz #129: http://rubyquiz.com/hosted_solutions/129/gregory/129.zip It has code that uses RMagick to generate an image that is then used as a texture map. > Thanks! > -Casey --Greg From jan.dvorak at kraxnet.cz Sun Oct 14 19:29:42 2007 From: jan.dvorak at kraxnet.cz (Jan Dvorak) Date: Mon, 15 Oct 2007 01:29:42 +0200 Subject: [ruby-opengl-devel] ruby-opengl and RMagick In-Reply-To: <47129D35.50400@xmodulation.com> References: <47129D35.50400@xmodulation.com> Message-ID: <200710150129.42369.jan.dvorak@kraxnet.cz> On Monday 15 October 2007 00:50, Cassius Rosenthal wrote: > Hello all, > > I am interested in using opengl to resize images. I have ruby-opengl > running, and in irb I'm trying to pass an RMagick image to > GL.TexImage2D, but I get a type error. The roadmap page on the web site > says, "Add image handling wrapper for easy image handling." Obviously > that hasn't been implemented yet, but I am encouraged that I'm not the > only one interested in functionality like that. In short, you can use @image.export_pixels_to_str function (with no parameters it exports in GL_RGB/GL_UNSIGNED_BYTE format) For passing data back from OpenGL to RMagick, similarly use import_pixels, as in: pixels = Gl.glGetTexImage(...) image = Magick::Image.new(...) image.import_pixels(0, 0, width, height, "RGB", pixels, ... ) Jan From jan.dvorak at kraxnet.cz Tue Oct 23 00:28:59 2007 From: jan.dvorak at kraxnet.cz (Jan Dvorak) Date: Tue, 23 Oct 2007 06:28:59 +0200 Subject: [ruby-opengl-devel] Release 0.50.0 of ruby-opengl Message-ID: <200710230628.59982.jan.dvorak@kraxnet.cz> Hello, we've just released version 0.50.0 of the bindings (thanks, Alain). Changes since last release: * GLU and GLUT cleanup, bugfixes, some missing functions added - version 3.7 of GLUT API is now requirement (previously 3.0) * We added support for number of OpenGL extensions (see webpage for details) * Some new examples and code cleanup * Support for OpenGL 2.1 (that includes pixelpack/unpack buffer) * Some code refactoring to remove duplicity * Website and documentation update (still no API doc though) * Lots of bugfixes. Any feedback is welcome. As a side note, i created ruby bindings for GLFW library, which is intended as lightweight replacement/complement of GLUT - among other things it fully supports multisampling, user-specified event processing (instead of GLUT's forced loop), full joystick handling etc. However it is not full replacement for GLUT, and it also adds dependency on the GLFW library, so i decided to put it as standalone package, instead of include it as part of ruby-opengl. You can read more about it at http://ruby-glfw.rubyforge.org/ Thanks, Jan