C++ Allegro Program works in KDE/Term but not console
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.
C++ Allegro Program works in KDE/Term but not console
I'm using Allegro 4.2 on Slackware 14.0_64. When I program a simple graphic program within KDE and run from a terminal, the program works. however due to KDE screen resolution issue, I have to compiler and run from the console prior to loading KDE. The issue is Allegro gives me an error.
Unable to initialize Allegro
Segment Fault.
However the same program works fine in Term without even recompiling.
Has anyone had this issue before and is there a work around. I need to be able to run the program from the prompt. If I run in KDE, the 640x480 resolution, will not show up on the screen correctly. T?he lower half of the screen isn't viewable. Its below the taskbar.
Pan64 - I have changed my resolution at the prompt (lilo.conf) to 800x600x32 from 80x25 text. I would think it would accept 640x480. It does on various old DosBox games.
This goal was a work around for another issue I am having. My programs/simple graphics will not run under KDE terminal. I'm going to go back and try to fix the original issue.
Not to hijack this thread but the original issue is when running any of my graphical programs in KDE TERM, the screen resolution changes to match the program but will not fit on screen. I'm currently running KDE at 1200x800 and when my program drops into 640x480, the bottom 1/4 of the screen can't been seen. It doesn't adjust the 640 width so the entire 480 can be seen.
However, when I ran my coded programs from the prompt, they ran fine. (excluding the one I started the thread about). Also when I ported to Windows using Allegro, they worked fine. It was only in KDE terminal that the programs wouldn't work. So given I haven't found a way to correct, I have been looking for a way to compile and run from the prompt console. And then I got this issue on top of it. So now I can't run from the prompt or see from Terminal.
As a side note. When I simply change resolution in KDE to 640 x 480 prior to running terminal, I get the same results. KDE will not fit the screen and I have to guess at the menu to change back. Lastly, I know my recent prompt issue has something to do with the change in resolution in lilo.conf (from 80x25 text to 800x600x32 graphical) I still don't see why it shouldn't work.
Along with this issue, I think I will tackle the KDE issue again. It will do me no good to have the prompt/Allegro fixed, if I still can't run them from the GUI.
I am going to continue to try to get my prompt situation figured out. Meanwhile I was able to get my programs to run in KDE so I can see the entire screen. I was able to change my program to use •GFX_AUTODETECT_WINDOWS instead of just GFX_AUTODETECT. This allows me to see the entire 640x480. (Allegro)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.