Having trouble debugging a program. Uses gtk, cairo, and allegro.
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Having trouble debugging a program. Uses gtk, cairo, and allegro.
Hello. I'm having a really tough time debugging this program. It works just fine in Linux. However, on Windows, cairo only displays the first line, and then repeats it, rather than displaying the image.
The latest cairo binary for Windows is 1.4.0. The one I'm using on my linux box is 1.4.10. However, I've installed cairo 1.4.0 on my linux box, and it still works fine. Also, the original code was written on a linux box long before 1.4.0 came out.
The GTK+ library that I'm using on my Windows box is the one from gimp-win.sourceforge.net/stable. I just downloaded it a few days ago.
I know that the convert_icons function looks like a hack. It's actually less so than it looks like. Both marker_image->line[][] (allegro) and gdk_icon_data (cairo) buffers are documented, and unlikely to change. The preferred solution would be to not use allegro, and use the gdk and cairo builtin functions instead to do the drawings. But it was like this when I found it, and I don't want to rewrite a bunch of code. The original program, is, of course, much bigger than this simplified version.
It turns out that the last argument is the number of bytes between the start of each row, NOT the number of bytes in between the rows. Each row, it jumped this number of bytes when displaying the image. Because the number was 0, it displayed the first row over and over. I do not understand why this worked in Linux. Perhaps there is some sort of sane default when the number is 0 in Linux, but not in Windows.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.