|
When using 'line()' , the allegro app is bugging. |
evert edel
Member #8,217
January 2007
|
Hello all , I'm evert , and new to allegro. But i'm using allegro for my school project that needs to be finished in a few weeks. I've followed some allegro tutorials and I feld ready to start on my game. So i started with selection stuff : drawing a selection box to select the units. But here comes the problem ; I'm drawing that box with 4 lines(). My code is allright and i'm having the same problems on code that some people from the irc channel have written for me. The 'game' is just lagging like hell when i draw my selection box , also there is a big latency on the time my mouse moves , and the selection box is drawn on the screen. When i try it on a ubuntu live cd , it all works great. So my code is just all-right . I'm using gentoo linux , but I really don't know a solution or fix for this. Is there a list of required packages ? So i can check i'm not missing a stupid package ? Already thanks , evert |
GullRaDriel
Member #3,861
September 2003
|
Install your grafic card driver. You have an Nvidia, Ati ? "Code is like shit - it only smells if it is not yours" |
gnolam
Member #2,030
March 2002
|
Quote: I'm drawing that box with 4 lines() Why not a rect()? -- |
GullRaDriel
Member #3,861
September 2003
|
And do not draw directly to screen. Draw to a buffer and blit the buffer onto the screen ! "Code is like shit - it only smells if it is not yours" |
evert edel
Member #8,217
January 2007
|
Wow , a lot of answers in a short period of time . Thanks already. I'm having installed nvidia drivers , and it's working on the live cd wich even doesn't has got nvidia drivers. Quote:
evert@localhost ~/C++/GIP $ glxinfo |grep direct So that's ok. I'm ofcourse using a buffer , so not directly drawing to the screen. And without a buffer it also wouldn't have worked on that live cd. Why not using a rect() ? The same problem is going on with a rect (only a bit less lagging) , and i'm going to implement in the future still some elements why i need that line in place of rect(). |
Evert
Member #794
November 2000
|
Quote: I'm evert Prove it! Anyway, do you have some example code that shows the problem (the smallest code sample you can write that compiles)? It's hard to say what's wrong without actually seeing the code in question. Aside, what version of Allegro are you using? |
GullRaDriel
Member #3,861
September 2003
|
Evert+1 ! Yeah. Now we do need some code to see what is going wrong. _ "Code is like shit - it only smells if it is not yours" |
evert edel
Member #8,217
January 2007
|
Ok , here some code what normally needs to work. Like i said , the problem isn't the code ... Because it is working on other systems / live cd's. edit : Hmm i see i'm not using 'line()' in this code (it isn't even my code , i got it from mimix on irc for testing) but this code has got the same lagging problem. |
Evert
Member #794
November 2000
|
Can't reproduce the problem on my system (KDE/gentoo with an oldish kernel). |
evert edel
Member #8,217
January 2007
|
I know it's a problem with my gentoo install, because with a live cd and by other people it is working.... There is no other proces using my cpu power , direct rendering is enabled , ... So i really can't see what's the problem |
James Stanley
Member #7,275
May 2006
|
It worked fine for me, so I don't know what your problem is, but try: 1.) Compile with -O3 |
Marco Radaelli
Member #3,028
December 2002
|
I hope you haven't re-emerged your GUI library like I told you on IRC, because I understood you were talking about selection boxes in GTK / Qt. In case, I'm sorry for my misunderstanding
|
evert edel
Member #8,217
January 2007
|
I'm compiling it with the following command : Hehe no problem about the miscomprehension , i've got recompiled my whole KDE , but that was not only and just for allegro. I needed it to do for some new use-flags etc. |
James Stanley
Member #7,275
May 2006
|
Why are you static linking? I'm not saying it's bad, just asking why. I usually only static link when I distribute a binary. |
evert edel
Member #8,217
January 2007
|
To be honest , i did it at the very first , when i got the 'compile command' from the allegro IRC channel. I was new to allegro and i didn't knew how to compile stuff with it. After that i kept using the static , because it's easy to test that executable somewhere else. It's not doing some bad stuff as far as I know ? |
Neil Walker
Member #210
April 2000
|
so is it the mouse causing the delay or the drawing? I suggest you remove stuff and retry to narrow it down, e.g. is it the timer, the rect, the drawing buffer, the mouse, etc. Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
evert edel
Member #8,217
January 2007
|
But the same problem is happening with real basic test code they gave me at the Allegro IRC channel , so the problem isn't the code , neither my system. (I guess something in my gentoo). |
|