FreeBasic IDE-poseidonFB(Update 2020.07.20)

User projects written in or related to FreeBASIC.
VANYA
Posts: 1411
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FreeBasic IDE-poseidonFB(Update 2017.07.07)

Postby VANYA » Jul 07, 2017 4:27

Hi Kuan Hsu!

Please try rev.282~


Now DRAG AND DROP works good, Many thanks! Did you fix the 32-bit version of Linux as 64-bit?

Had linux version also "Access Violation" Random issue on your using?


While this was not, but if something happens, I will write to you

----------------------------

To Annotation->"View Annotation" hotkey works F1
There is a hotkey for Annotation->"Hide Annotation"?
Kuan Hsu
Posts: 470
Joined: Sep 16, 2007 15:12
Location: Taiwan

Re: FreeBasic IDE-poseidonFB(Update 2017.07.07)

Postby Kuan Hsu » Jul 07, 2017 6:00

VANYA wrote:Hi Kuan Hsu!

Please try rev.282~

Now DRAG AND DROP works good, Many thanks! Did you fix the 32-bit version of Linux as 64-bit?

Had linux version also "Access Violation" Random issue on your using?

While this was not, but if something happens, I will write to you

----------------------------

To Annotation->"View Annotation" hotkey works F1
There is a hotkey for Annotation->"Hide Annotation"?


(1)32-bits version of linux, because I need use live usb to compile, I'm too lazy.......
(2)"F1" is show the type of the variable / calltip of function, not annotation~
Kuan Hsu
Posts: 470
Joined: Sep 16, 2007 15:12
Location: Taiwan

Re: FreeBasic IDE-poseidonFB(Update 2017.07.07)

Postby Kuan Hsu » Jul 07, 2017 15:36

Hey~~~~guys!!!!!!!!

I thinks I've found the bug for windows version, please try rev0.283 and tell me the result!!!!
Thanks~~~~~~~~~
UEZ
Posts: 635
Joined: May 05, 2017 19:59
Location: Germany

Re: FreeBasic IDE-poseidonFB(Update 2017.07.07)

Postby UEZ » Jul 07, 2017 20:56

My wish list:
  1. when cursor is on a variable highlight all same variables in the code
  2. save tabs on exit -> when opening the IDE all previous tab should be loaded again


THANKS :)
deltarho[1859]
Posts: 2698
Joined: Jan 02, 2017 0:34
Location: UK

Re: FreeBasic IDE-poseidonFB(Update 2017.07.07)

Postby deltarho[1859] » Jul 07, 2017 21:20

I am OK with 1. provided it comes as a Check/Uncheck feature so that I can make sure that it was unchecked. It immediately made may think of "this report may contain some flash photography".

I will second 2.
Kuan Hsu
Posts: 470
Joined: Sep 16, 2007 15:12
Location: Taiwan

Re: FreeBasic IDE-poseidonFB(Update 2017.07.07)

Postby Kuan Hsu » Jul 08, 2017 1:21

UEZ wrote:My wish list:
  1. when cursor is on a variable highlight all same variables in the code
  2. save tabs on exit -> when opening the IDE all previous tab should be loaded again


THANKS :)

(1)Enable "Document Multi Select", middle-click on some word......
(2)Try rev.284
deltarho[1859]
Posts: 2698
Joined: Jan 02, 2017 0:34
Location: UK

Re: FreeBasic IDE-poseidonFB(Update 2017.07.08)

Postby deltarho[1859] » Jul 08, 2017 10:14

(2)Try rev.284

Great!
UEZ
Posts: 635
Joined: May 05, 2017 19:59
Location: Germany

Re: FreeBasic IDE-poseidonFB(Update 2017.07.08)

Postby UEZ » Jul 08, 2017 13:58

Thanks @Kuan Hsu.

Unfortunately I have no "middle-click" possibilty yet because of touchpad only. Anyhow, it would be great that the editor highlights it automatically.

Btw, I found a bug. When I change the font for "Default" then the font does not change immediately but the color of the output window at the bottom.
dodicat
Posts: 6726
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: FreeBasic IDE-poseidonFB(Update 2017.07.08)

Postby dodicat » Jul 08, 2017 14:00

If My options are say
preference
-gen gcc -Wc -O3 -exx
on the 32 bit compiler say.

I tab on the -exx (as above) to quickly double check for errors.
(No debugger path chosen)
I get a compile failure if I only have a couple of warnings.
E.G.
C:/Users/User/Desktop/base32/1499522351.c:574:8: warning: 'STEPSIZE$1' may be used uninitialized in this function [-Wmaybe-uninitialized]
float STEPSIZE$1;
^

Compile Error!

And it is difficult to pinpoint in the code since they are only warnings.

I could of course, omit the -Wc -O3

But it shouldn't result in a compile failure even with -Wc -O3
St_W
Posts: 1508
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: FreeBasic IDE-poseidonFB(Update 2017.07.08)

Postby St_W » Jul 08, 2017 17:46

dodicat wrote:E.G.
C:/Users/User/Desktop/base32/1499522351.c:574:8: warning: 'STEPSIZE$1' may be used uninitialized in this function [-Wmaybe-uninitialized]
float STEPSIZE$1;
^
This could also be considered as compiler bug. Normally the generated Assembly or (as in this case) C code shouldn't trigger any warnings, IMHO. If there's a reason for a warning fbc should warn and not gcc (or gas). Maybe you could give an example code that triggers such a warning?; but probably in new thread as that wouldn't be related to the IDE.
dodicat
Posts: 6726
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: FreeBasic IDE-poseidonFB(Update 2017.07.08)

Postby dodicat » Jul 08, 2017 18:33

It was an old doddle.
I'll pop it here because I have another issue with poseidon.
I am left with a pile of temporary .exe files from the quick run mode in my working folder.
e.g.
1499520021.exe
I have to manually delete them.
Here is the old code:

Code: Select all

Type V3
    As Single x,y,z
End Type

Type screendata
    As Integer w,h,depth,bpp,pitch
    As Any Pointer row
    As Uinteger Pointer pixel32
    As Ubyte Pointer pixel8
    As Ushort Pointer pixel16
End Type

type Creeper
    h as V3
    t as V3
    segs(1 to 12) as V3
    declare constructor
    declare constructor(as V3,as V3)
end type

#macro map(a,b,_x_,c,d)
((d)-(c))*((_x_)-(a))/((b)-(a))+(c)
#endmacro

#define vct Type<V3>
#define Intrange(f,l) int(Rnd*((l+1)-(f))+(f))
#define Floatrange(f,l) Rnd*((l)-(f))+(f)

'Operators on the x,y,z of Type V3
Operator + (v1 As V3,v2 As V3) As V3
Return vct(v1.x+v2.x,v1.y+v2.y,v1.z+v2.z)
End Operator
Operator -(v1 As V3,v2 As V3) As V3
Return vct(v1.x-v2.x,v1.y-v2.y,v1.z-v2.z)
End Operator
Operator * (f As Single,v1 As V3) As V3 'scalar*V3
Return vct(f*v1.x,f*v1.y,f*v1.z)
End Operator
Operator * (v1 As V3,f As Single) As V3 'V3*scalar
Return f*v1
End Operator
Function length(v As V3) As Single
    Return Sqr(v.x*v.x+v.y*v.y+v.z*v.z)
End Function
Function normalize(v As V3) As V3
    Dim n As Single=length(v)
    If n=0 Then n=1e-20
    Return vct(v.x/n,v.y/n,v.z/n)
End Function

constructor Creeper:end constructor
constructor Creeper(hd as V3,tl as V3)
this.segs(1)=hd
this.segs(12)=tl
for n as integer=2 to 11
    this.segs(n)=this.segs(1)+(n-1)*(1/11)*(tl-hd)
next n
end constructor

'Spline functions
Function catmull(p() As V3,t As Single) As V3
    Return 0.5 *(     (2 * P(2)) +_
    (-1*P(1) + P(3)) * t +_
    (2*P(1) - 5*P(2) + 4*P(3) - P(4)) * t*t +_
    (-1*P(1) + 3*P(2)- 3*P(3) + P(4)) * t*t*t)
End Function

Sub FetchCatmull(v() As V3,outarray() As V3,arraysize As Integer=1000)
    Dim As V3 p(1 To 4)
    Redim outarray(0)
    Dim As Single stepsize=(Ubound(v)-1)/(arraysize)
    If stepsize>1 Then stepsize=1
    For n As Integer=2 To Ubound(v)-2
        p(1)=v(n-1):p(2)=v(n):p(3)=v(n+1):p(4)=v(n+2)
        For t As Single=0 To 1 Step stepsize
            Var temp=catmull(p(),t)
            Redim Preserve outarray(1 To Ubound(outarray)+1)
            outarray(Ubound(outarray))=temp
        Next t
    Next n
End Sub
'Bressenham 3D line
Sub bline(sd As screendata,x1 As Integer,y1 As Integer,x2 As Integer,y2 As Integer,col As Uinteger)
    #macro ppset32(_x,_y,colour)
    sd.pixel32=sd.row+sd.pitch*(_y)+(_x) Shl 2
    *sd.pixel32=(colour)
    #endmacro
    #macro ppset8(_x,_y,colour)
    sd.pixel8=sd.row+sd.pitch*(_y)+(_x)
    *sd.pixel8=(colour)
    #endmacro
    #macro ppset16(_x,_y,colour)
    sd.pixel16=sd.row+sd.pitch*(_y)+(_x)*2
    *sd.pixel16=(colour)
    #endmacro
    #define onscreen ((x1+x)>=0) And ((x1+x)<(sd.w-1)) And ((y1+y)>=0) And ((y1+y)<(sd.h-1))
    Var dx=Abs(x2-x1),dy=Abs(y2-y1),sx=Sgn(x2-x1),sy=Sgn(y2-y1),num=(sd.bpp)\2
   dim as long e
    If dx<dy Then  e=dx\2 Else e=dy\2
    Do
        For x As Integer=0 To 1
            For y As Integer=0 To 1
                If onscreen Then
                    If sd.depth=8  Then: ppset8((x1+x),(y1+y),col):End If
                    If sd.depth=16 Then: ppset16((x1+x),(y1+y),col):End If
                    If sd.depth=32 Then: ppset32((x1+x),(y1+y),col):End If
                End If
            Next y
        Next x
        If x1 = x2 Then If y1 = y2 Then Exit Do
        If dx > dy Then
            x1 += sx : e -= dy : If e < 0 Then e += dx : y1 += sy
        Else
            y1 += sy : e -= dx : If e < 0 Then e += dy : x1 += sx
        End If
    Loop
End Sub
'Bressenham line thickened
Sub thickline(sd As screendata,_
    x1 As Double,_
    y1 As Double,_
    x2 As Double,_
    y2 As Double,_
    thickness As Double,_
    colour As Uinteger)
    Var h=Sqr((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1))
    Var s=(y1-y2)/h
    Var c=(x2-x1)/h
    For yp As Double=-thickness/2 To thickness/2
        bline(sd,x1+(s*yp),y1+(c*yp),x2+(s*yp),y2+(c*yp),colour)
    Next yp
End Sub
'Interpolating points joined by lines
Sub drawpoints(s As screendata,a() As V3,col As Uinteger,th As Single)
    For z As Integer=Lbound(a)+1 To Ubound(a)
        thickline(s,a(z-1).x,a(z-1).y,a(z).x,a(z).y,th,col)
    Next z
End Sub
'extrapolate line beyond end point
Function _line(p1 As v3,p2 As v3,l As Single) As V3
    Return vct(p1.x+l*(p2.x-p1.x),p1.y+l*(p2.y-p1.y),p1.z+l*(p2.z-p1.z))
End Function

Sub bendyline(s As screendata,p1 As V3,p2 As V3,b As v3,col As Uinteger,th As Single)
    Var lngth=length(b-p1)+length(b-p2)
    Dim As v3 a(1 To 5)
    Var t=_line(b,p1,1.25):a(1)=vct(t.x,t.y,t.z)
    a(2)=p1:a(3)=b: a(4)=p2
    t=_line(b,p2,1.25):a(5)=vct(t.x,t.y,t.z)
    Redim As v3 C()
    FetchCatmull(a(),c(),2*lngth) '2*lngth=number of interpolating points
    Drawpoints(s,c(),col,th)      'Join by Bressenham thick line
End Sub
'===================  EXAMPLE  ==================================


Function framecounter() As Integer
    Var t1=Timer,t2=t1
    Static As Double t3,frames,answer
    frames=frames+1
    If (t2-t3)>=1 Then
        t3=t2
        answer=frames
        frames=0
    End If
    Return answer
End Function

Function regulate(MyFps As Integer,Byref fps As Integer) As Integer
    fps=framecounter
    Static As Double timervalue
    Static As Double delta,lastsleeptime,sleeptime
    Var k=1/myfps
    If Abs(fps-myfps)>1 Then
        If fps<Myfps Then delta=delta-k Else delta=delta+k
    End If
    sleeptime=lastsleeptime+((1/myfps)-(Timer-timervalue))*(1000)+delta
    If sleeptime<1 Then sleeptime=1
    lastsleeptime=sleeptime
    timervalue=Timer
    Return sleeptime
End Function

sub drawCreepers(s as screendata,w as Creeper,col as uinteger, th as single)
    dim as v3 norm=w.segs(1)-w.segs(12)
    swap norm.x,norm.y
    norm.x=-norm.x
    norm=normalize(norm)
    dim as integer k=1
    dim as single t
    dim as single Ln=length(w.segs(1)-w.segs(12))
    ln=ln/50
    norm=Ln*norm
    for n as integer=1 to 11
        if n<6 then
            t=map(1,5,n,1,th)
        else
            t=map(6,11,n,th,1)
            end if
        k=-k
var  OffsetPoint=.5*(w.segs(n)+w.segs(n+1))+k*norm
   bendyline(s,w.segs(n),w.segs(n+1),OffsetPoint,col,t)
next n
end sub

Screen 20,32
Color , Rgb(255,255,255)

Dim As screendata ThisScreen
With ThisScreen
    Screeninfo .w,.h,.depth,.bpp,.pitch
    .row=Screenptr
End With
Dim As Uinteger colour

Dim As Integer fps,sleeper


'set up worms
dim as integer z
dim as integer n=200
dim as V3 drn(1 to n)
dim as V3 head(1 to n),tail(1 to n)
dim as Creeper w(1 to n)
dim as integer max(1 to n),min(1 to n)
dim as uinteger c(1 to n)
'SETUP
for z=1 to n
drn(z)=vct(Intrange(-200,200),IntRange(-200,200),0)
if drn(z).y=0 then drn(z).y=1
drn(z)=normalize(drn(z))
var xpos=ThisScreen.w/2+IntRange(-400,400)
var ypos=ThisScreen.h/2+IntRange(-300,300)
tail(z)=vct(xpos,ypos)
head(z)=tail(z)+IntRange(2,5)*drn(z)
max(z)=20*length(head(z)-tail(z))
min(z)=.5*max(z)
w(z)=type<Creeper>(head(z),tail(z))
c(z)=rgb(rnd*255,rnd*255,rnd*255)
next z


dim as integer hflag(1 to n),tflag(1 to n)
dim as integer size(1 to n)
for z as integer=1 to n
    hflag(z)=1
next z

Do
    for z=1 to n
       
    if hflag(z)=1 then
    head(z)=head(z)+drn(z)
    end if

    if tflag(z)=1 then
        var v=(head(z)-tail(z))
        tail(z)=tail(z)+drn(z)+5*normalize(v)
    end if

    size(z)=length(w(z).segs(1)-w(z).segs(12))
   
    if size(z)>max(z) then hflag(z)=0:tflag(z)=1
    if size(z)<min(z) then hflag(z)=1:tflag(z)=0
     var t=FloatRange(0,1)
    if hflag(z) then
    if head(z).x>ThisScreen.w-10 then drn(z)=normalize(vct(-t,Floatrange(-.9,.9)))
    if head(z).x<10 then drn(z)=normalize(vct(t,Floatrange(-.9,.9)))
    if head(z).y>ThisScreen.h-10 then drn(z)=normalize(vct(Floatrange(-.9,.9),-t))
    if head(z).y<10 then drn(z)=normalize(vct(Floatrange(-.9,.9),t))
    end if
   
    w(z)=type<Creeper>(head(z),tail(z))
   
    next z
    sleeper=regulate(60,fps)
    Screenlock
    Cls
    draw string(20,20),"FPS= "& fps,rgb(0,0,0)
    for z=1 to n
    drawCreepers(ThisScreen,w(z),c(z),5)
    next z
    Screenunlock
    Sleep sleeper,1
Loop Until inkey=chr(27)
Sleep

run with -lang fb -gen gcc -Wc -O3 -exx
Kuan Hsu
Posts: 470
Joined: Sep 16, 2007 15:12
Location: Taiwan

Re: FreeBasic IDE-poseidonFB(Update 2017.07.08)

Postby Kuan Hsu » Jul 09, 2017 2:23

dodicat wrote:It was an old doddle.
I'll pop it here because I have another issue with poseidon.
I am left with a pile of temporary .exe files from the quick run mode in my working folder.

Yes, it's a issue with poseidonFB, because poseidonFB catch stderr pipe message( the message from gcc/linker.....), but without a messsgae analyzer( to see if there are "Error:" or "warning:" word simply )

Thanks for your example code, I'll fixed at next reversion...^^
Kuan Hsu
Posts: 470
Joined: Sep 16, 2007 15:12
Location: Taiwan

Re: FreeBasic IDE-poseidonFB(Update 2017.07.07)

Postby Kuan Hsu » Jul 09, 2017 3:16

MrSwiss wrote:
Kuan Hsu wrote:Both Dr. Memory or valgrind are not support D 1.0.......>"<
Doesn't D have any Debugger support, then?

Yes(windbg), but I don't how to use so never use......
Kuan Hsu
Posts: 470
Joined: Sep 16, 2007 15:12
Location: Taiwan

Re: FreeBasic IDE-poseidonFB(Update 2017.07.08)

Postby Kuan Hsu » Jul 09, 2017 5:06

UEZ wrote:Thanks @Kuan Hsu.

Unfortunately I have no "middle-click" possibilty yet because of touchpad only. Anyhow, it would be great that the editor highlights it automatically.

Btw, I found a bug. When I change the font for "Default" then the font does not change immediately but the color of the output window at the bottom.

(1)poseidonFB use multi-selection of scintilla, it alow edit multi-line(selection) at same time, so I will not let it turn to auto.
(2)I will fix at next reversion
Kuan Hsu
Posts: 470
Joined: Sep 16, 2007 15:12
Location: Taiwan

Re: FreeBasic IDE-poseidonFB(Update 2017.07.08)

Postby Kuan Hsu » Jul 09, 2017 5:10

deltarho[1859] wrote:
(2)Try rev.284

Great!

off-topic:
My surname is: Hsu (許)
name is: Yung-Kuan (永寬)

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 5 guests