|
Post by Tomaaz on Feb 14, 2022 3:39:23 GMT -6
Aurel, so suddenly this topic is about exiting the program. Right. If you find it so fascinating then feel free to modify my code. You can spend entire day on adding several options to end the program. I'm sure it will be fun, but I will stick to closing the console window that opens together with the graphics one. Rosy, Aurel started this topic simply to say that his interpreter was, in this case, faster than FreeBasic. The only thing is that it wasn't. That's why Aurel didn't post the original code so we couldn't see what approach and solution were used in it. When I translated his code to FreeBasic using exactly the same structure and approach it was clear that FreeBasic was much faster, so Aurel started telling us that he, of course, knew it, the whole thing is not about speed and he focused on exiting the program, indtead. Nice try, but no.
|
|
|
Post by aurel on Feb 14, 2022 4:40:26 GMT -6
tomek ...you really need to shoot yourself in the foot ..then when you feel pain you should look into above posted code by UEZ....so that is the code i was talking about what you posted is a awkward aproach with screenlock and without sleep you cannot sync drawing on window ...this mode is old QB mode and you cannot use proper double buffering hdc/hdcmem fliping... anyone should be clear even you what is what and stop patronize about speed.. i was clear why is fb code in UEZ way slower than should be ..and that is why microA code perform better...to be perfectly clear microA is interpreter produced in Oxygenbasic and in some string testing o2 is faster than FB ...but not in all.. and of course is faster than microA... by the way you can made in C slower program than in QBasic . ps ; but I will stick to closing the console window that opens together with the graphics one. well in my case compiling your example , console window is not created.
|
|
|
Post by aurel on Feb 14, 2022 5:09:44 GMT -6
|
|
|
Post by Tomaaz on Feb 14, 2022 5:50:19 GMT -6
1. SCREENLOCK/SCREENUNLOCK is double buffering. It's your problem that you don't understand what happens when you try to do the drawing to fast for a monitor's refresh rate.
2. FreeBasic documentation says that SCREENLOCK/SCREENUNLOCK are not available in the old QB mode and are new to FreeBasic. Please, stop pretending that you're know what you're talking about (someone said sometning about patronizing?).
3. I run it on Windows 10 and it shows the console window. Since I'm not interested in distributing this program, I don't care how it works on other peoples' computer.
4. You're last post explains everything. You just wanted to post some spam about your interpreter. Why I'm not surprised?
|
|
|
Post by aurel on Feb 14, 2022 8:57:10 GMT -6
1. SCREENLOCK/SCREENUNLOCK is double buffering. It's your problem that you don't understand what happens when
you try to do the drawing to fast for a monitor's refresh rate.
-screenlock is pandan of BeginPaint call under WM_PAINT message
and disable any other messages processing then is finished with EndPaint call..so is not double buffering.
But what i know when you are expert?
2. FreeBasic documentation says that SCREENLOCK/SCREENUNLOCK are not available in the old QB mode and are new to FreeBasic.
Please, stop pretending that you're know what you're talking about (someone said sometning about patronizing?).
- SCREENLOCK/SCREENUNLOCK is presented first time in fbc 0.14.0
3. I run it on Windows 10 and it shows the console window. Since I'm not interested in distributing this program, I don't care how it works on other peoples' computer.
-so why you then jump into thread ?? yeah to show off your expertize...
4. You're last post explains everything. You just wanted to post some spam about your interpreter. Why I'm not surprised?
-no and no and no
|
|
|
Post by aurel on Feb 14, 2022 11:19:16 GMT -6
back to RCBasic example : lines and circles are drawed but without new color i try to set new color with SetColor(RGB(r,g,b)) but not work did i miss something?
xmax = 640 ymax = 480 title$ = "Rotate Line by Aurel" center_x = windowpos_centered center_y = windowpos_centered WindowOpen(1,title$,center_x,center_y,xmax,ymax,WindowMode(1,0,0,0,0),1) SetWindowAutoClose(1, 0) CanvasOpen(1,xmax,ymax,0,0,xmax,ymax,0) ClearCanvas w = 640 : h = 480 : w2 = w / 2 : h2 = h / 2 fPi = -Cos(1) : fRad = fPi / 180 t = 0 r=200 r2 = 50 setcolor(rgb(0,100,200 )) '---------------------------------- do clearcanvas x = w2 + r * Cos(t) y = h2 + r * Sin(t) x1 = w2 + r * Cos(t + fRad * 90) y1 = h2 + r * Sin(t + fRad * 90) line(x, y, x1, y1) : circle(x, y, 10)
x2 = w2 + r2 * Cos(t + fRad * 90) y2 = h2 + r2 * Sin(t + fRad * 90) 'why next object are not colored ? setcolor(rgb(200,180,0)) line(x1,y1,x2,y2) : circle(x1,y1,10) : circle(x2,y2,10)
t = t + 0.01666 if Not WindowExists(1) Or WindowEvent_Close(1) Then end end if update() loop until key(27) = 1
|
|
|
Post by aurel on Feb 14, 2022 11:28:40 GMT -6
Ok i get it ,it seems that SetColor() must be in local scope of the Loop and now work same as in micro(A), because RCB is bytecode interpreter and micro(A) is just a simple token interpreter value of variable t should be corrected .
xmax = 640 ymax = 480 title$ = "Rotate Line by Aurel" center_x = windowpos_centered center_y = windowpos_centered WindowOpen(1,title$,center_x,center_y,xmax,ymax,WindowMode(1,0,0,0,0),1) SetWindowAutoClose(1, 0) CanvasOpen(1,xmax,ymax,0,0,xmax,ymax,0) ClearCanvas w = 640 : h = 480 : w2 = w / 2 : h2 = h / 2 fPi = -Cos(1) : fRad = fPi / 180 t = 0 r=200 r2 = 50 '---------------------------------- do clearcanvas x = w2 + r * Cos(t) y = h2 + r * Sin(t) x1 = w2 + r * Cos(t + fRad * 90) y1 = h2 + r * Sin(t + fRad * 90) setcolor(rgb(0,100,200 )) line(x, y, x1, y1) : circle(x, y, 10)
x2 = w2 + r2 * Cos(t + fRad * 90) y2 = h2 + r2 * Sin(t + fRad * 90) 'why next object are not colored ? setcolor(rgb(200,180,0)) line(x1,y1,x2,y2) : circle(x1,y1,10) : circle(x2,y2,10)
t = t + 0.01666 if Not WindowExists(1) Or WindowEvent_Close(1) Then end end if update() loop until key(27) = 1
|
|