views:

44

answers:

1

Hi, i have had this problem for 3-4 months. OpenGL codes do not run that good as they should in windows. I have a project that i need to run it in linux, with times, pipes, ... that use the Windows API. I need to migrate the code but it doesn't look good. For example they are flashing on the screen! is it from my graphics card on linux? or is it some other difficulties? Also i have ATI HD3470 on VAIO-FW13GU/H laptop running Debian5. Are there any good(i have seen some drivers but not so good :-S) drivers for ati hd series?

A: 

Try creating some simple demo program that uses the OpenGL features you're using in your code. Try isolating which features causes the problem. If all of them worked as you expected, there is a chance that the bug is in your code you may be assuming some platform specific behavior that get borked in linux.

I have had a bug when porting a Windows C++ code, where the 3D mesh parsing code doesn't correctly handle windows-style line ending and that caused the mesh to produce ugly colors since it passes a number string to a home-brewn string-to-int function (which I promptly replaced with atoi()), which gets silently borked when it meets the extra line end character.

Lie Ryan
Thanks for your answer dear Lie, i ran the program in Windows. It appears to be correct inside windows! Why is it that my code runs good in Windows but runs very bad on linux! not only bad (slow) but also buggy! some shapes even fade away for 2-3 secs!
Green Code
@Green Code: Common problems with porting Windows code to Linux are: primitive datatypes may have different default sizes, e.g. rand() always returns a number that fits into 16-bit, but not in Linux. Line ending, make sure to handle them properly if you used any files. Obviously, Windows API does not exist in Linux. In short, **you're relying on undefined behavior** or **platform-specific behavior** somewhere in your code. It is rare that OpenGL is the problem (unless if your code is relying on some OpenGL undefined behavior, which there aren't so many); as long as you setup OpenGL properly.
Lie Ryan
Thanks, I will see if my code has those issues, if i want to install a working driver for the graphics card what do you suggest?
Green Code
@Green Code: installing OpenGL driver is more of system administration issue, you can get better answers in SuperUser. Nevertheless, you'll need to do some diagnostics first, to see whether or not you already have graphic acceleration (a.k.a. DRI/Direct Rendering Infrastructure). For starters, check the output of `glxinfo | grep "direct rendering"`.
Lie Ryan