Tuesday, 28 June 2011

Running GLUT program in Fedora under VirtualBox

I've been developing OpenGL programs with GLUT in order to achieve cross-platform compatibility. However, while testing my programs under Fedora 15 using VirtualBox 4.0.10, I get stucked with some error message:

OpenGL Warning: XGetVisualInfo returned 0 visuals for 0x180fb10
OpenGL Warning: Retry with 0x8002 returned 0 visuals
Segmentation fault (core dumped)

I was pretty sure my program was correct and the error occurs every time when glutCreateWindow is called. After searching on the Internet, I found this problem has something to do with the OpenGL acceleration in VMs. The simplest fix I found is to add LIBGL_ALWAYS_INDIRECT=1 environment variable before running my GLUT programs. I am no expert in Linux environment variable settings nor do I know much about GLUT itself, however, it does fixes my issue. I guess there might be some trade-off in changing the default settings, yet it is to be found in my future test, so far it is a perfect solution to my programs.

Sunday, 5 June 2011

Eclipse SVN commit to USB disk issue.

I have created my local project repository on a USB stick so that I can work anywhere without a SVN server. But when I work on my Macbook, Eclipse's built-in svn function cannot commit changes properly to the USB disk. (get java.nio.channels.OverlappingFileLockException). I found no solutions to the problem on Google. Maybe just because too few people actually using USB stick to store there SVN repos since there are many known disadvantages to do so. But I would like to try it anyway.

After playing around eclipse and my USB stick, I found the problem happens when using Eclipse Mac OS; and in addition the USB has Fat format. I've heard ppl using Windows do not suffer this problem. And if I format my disk with Mac OS Extended format, the problem has gone, too.

There is a work around to the problem that is to use svn+ssh://... URL instead of file://... I do not understand why this solves the problem, and it all looks silly that using ssh protocol to connect to localhost in order to access my local files. I guess in this way, Eclipse's SVN module doesn't perform the write/save operation, and hence avoided the exception.

I do not like this work around because I need to enable SSH access on my Mac OS, even though it is very easy to do so. Hope there can get it fixed somehow.

Monday, 21 June 2010

I love cooking.

Especially cooking chinese.