I can't start your application here for some reason, looking through your code though I think you are over complicating it.
You should be able to draw the whole twister in one loop.
I will explain the technique which is very simple. I should know, I've made loads of them

Let's suppose that you have 4 sides on your twister and that your screen is 480 pixels tall, you could use any resolution you want.
This will be done in pseudo code as C++ is not my own language of choice.
FOR Y = 0 TO 479
First calculate 4 points;
X1 = 100 + 50 * SIN ( ANGLE + Y )
X2 = 100 + 50 * SIN ( (ANGLE+90) + Y )
X3 = 100 + 50 * SIN ( (ANGLE+180) + Y )
X4 = 100 + 50 * SIN ( (ANGLE+270) + Y )
Then we do a simple test to see if the line is visible and then draw it if it is;
IS X2>X1? IF YEST DRAW LINE FROM X1 TO X2
IS X3>X2? IF YEST DRAW LINE FROM X2 TO X3
IS X4>X3? IF YEST DRAW LINE FROM X3 TO X4
IS X1>X4? IF YEST DRAW LINE FROM X4 TO X1
NEXT Y
A few points of interest, you should add something to the variable ANGLE each frame so that the twister rotates.
You'll notice also that ANGLE+90 etc, as the points of a square are at 90 degree intervals, that's why we do this.
You can make the calculation to generate the points a little bit more interesting if you want to make a more pleasing twister.
I am working on one at the moment, the source is in Freebasic though if you'd like to look at it it is not a problem.