Search found 7936 matches

by dodicat
May 02, 2024 19:09
Forum: Community Discussion
Topic: free Basic - just curious?
Replies: 17
Views: 1308

Re: free Basic - just curious?

Hi Lost Zergling. (Notes/Domino technologies) I used to enjoy a game of dominoes, but the village pub has been closed for a few years now. Here is my set: Sub setdice(i() As Any Ptr,size As Long) 'create images Type v As Long x,y End Type Dim As v p(1 To 7) Redim i(0 To 6) Dim As Long sz=size,dt=sz/...
by dodicat
May 02, 2024 17:51
Forum: Sources, Examples, Tips and Tricks
Topic: Fireworks Demo
Replies: 2
Views: 194

Re: Fireworks Demo

Thanks David, nice use of some Cairo instructions, I have put your code in my Cairo folder in Windows 11.
by dodicat
Apr 30, 2024 22:48
Forum: Sources, Examples, Tips and Tricks
Topic: One Line Challenge!
Replies: 19
Views: 1519

Re: One Line Challenge!

Nothing dimensioned here. Start:if screenptr=0 then screen 20:end if:Locate int(rnd*(Hiword(width)-1))+1,int(rnd*(Loword(width)-1))+1:err=1+int(rnd*255):sleep(iif(err<2,1,0)):Color 256-err,err:if (err=7 or err=10 or err=9) then goto Start else ? chr(err)::if inkey="" then goto Start
by dodicat
Apr 29, 2024 20:17
Forum: Sources, Examples, Tips and Tricks
Topic: anti-aliased line comparison (cairo vs mine)
Replies: 4
Views: 590

Re: anti-aliased line comparison (cairo vs mine)

Thanks Dafhi, nice work. The Cairo built-in anti-alias versus Cairo non anti-alias: (The constants have to be created, they don't seem to be in the .bi file) '#cmdline "-gen gcc -arch native -Wc -Ofast,-mfpmath=sse,-funroll-loops" #include once "cairo/cairo.bi" #define _rd_ Cast(...
by dodicat
Apr 10, 2024 1:19
Forum: Sources, Examples, Tips and Tricks
Topic: Custom typeface (font)
Replies: 8
Views: 634

Re: Custom typeface (font)

Nice fonts Badidea. Many years ago I painfully made up the keyboard characters ,British, including chr(163) the £ sign. I don't know how £ will show over there!. Namespace show Sub rotate(Byval pivot_x As Double,_ 'turns about this point Byval pivot_y As Double,_ Byval first_x As Double,_ 'centre fo...
by dodicat
Apr 05, 2024 20:14
Forum: Sources, Examples, Tips and Tricks
Topic: Waterfall effect
Replies: 18
Views: 1433

Re: Waterfall effect

Waterfall effect slower. #cmdline "-gen gcc -O 2" Dim Shared As Long Xres,Yres Screenres 1024,850,32,,64 Screeninfo (Xres),(Yres) Type pt As Long x,y As Ulong col As Long jmp End Type 'get a point (Length pixels) along a line between fp and p Function shortline(fp As pt,p As pt,length As I...
by dodicat
Mar 30, 2024 12:18
Forum: Sources, Examples, Tips and Tricks
Topic: Waterfall effect
Replies: 18
Views: 1433

Re: Waterfall effect

Nice neil. Good to see these little graphicals in fb again. Pure rain Sub Rain(z As Any Ptr,xres As Long,yres As Long) Const max=1000 Static As Single xx(max),yy(max) For i As Long = 0 To max xx(i) = Rnd*xres yy(i) = Rnd*yres Put(xx(i),yy(i)),z,Alpha,Rnd*200 Next End Sub Screen 20,32 Color ,Rgb(200,...
by dodicat
Mar 30, 2024 11:37
Forum: Windows
Topic: Cairo under Windows
Replies: 14
Views: 1517

Re: Cairo under Windows

You can say similar about fb any ptr, as in say win32 api where any ptr hwnd= CreateWindowEx(. . ....) It can hold (point to) a lot of information. Simple example type cairo_font_options_t as _cairo_font_options type Cairo_structure as string * 10 s="hi" as double d=5.5 as long l=1024 end ...
by dodicat
Mar 29, 2024 22:43
Forum: Windows
Topic: Cairo under Windows
Replies: 14
Views: 1517

Re: Cairo under Windows

Thanks Roland, I Ican add it in. #include "cairo/cairo.bi" #define _rd_ Cast(Ubyte Ptr,@colour)[2]/255 #define _gr_ Cast(Ubyte Ptr,@colour)[1]/255 #define _bl_ Cast(Ubyte Ptr,@colour)[0]/255 #define _al_ Cast(Ubyte Ptr,@colour)[3]/255 Namespace chrs Dim As cairo_font_extents_t _fonts Dim A...
by dodicat
Mar 29, 2024 20:16
Forum: Beginners
Topic: array initialization
Replies: 8
Views: 427

Re: array initialization

A little macro to fill an array without too much typing: #macro fill(a,r,datatype,d...) Redim a(r) Scope Dim As datatype x(r)=d For n As Long=0 To Ubound(a) a(n)=x(n) Next End Scope #endmacro Dim Shared As String f() fill(f,2,String,{"apple", "orange", "banana"}) Dim Sh...
by dodicat
Mar 29, 2024 19:24
Forum: Windows
Topic: Cairo under Windows
Replies: 14
Views: 1517

Re: Cairo under Windows

Here is how I do fonts in Cairo, I have found no problems with the method. (Tested 64 bits) Win 11. #cmdline "-s gui" #include "fbgfx.bi" #include once "cairo/cairo.bi" #define _rd_ Cast(Ubyte Ptr,@colour)[2]/255 #define _gr_ Cast(Ubyte Ptr,@colour)[1]/255 #define _bl_ ...
by dodicat
Mar 27, 2024 10:53
Forum: Windows
Topic: Cairo under Windows
Replies: 14
Views: 1517

Re: Cairo under Windows

Hi UEZ/Roland. I'm hardly ever on the pascal forum these days, but I have the 3.2.2 compiler here. A strange thing happened here on win 11. I was messing about with UEZ's code , trying to get an opengl screen ensconced in a win32 api using a winproc function. At some stage during my tribulations I h...
by dodicat
Mar 26, 2024 13:13
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 270
Views: 25679

Re: Freebasic 1.20.0 Development

Thanks for the link fxm.
by dodicat
Mar 26, 2024 10:59
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 270
Views: 25679

Re: Freebasic 1.20.0 Development

I tried to force a const chr(0). Results: '#include "crt.bi" const C=!"\0" #print typeof(C) Sub memcopy(dest As Any Ptr,src As Any Ptr,count As Long) Dim As Ubyte Ptr newdst=dest Dim As Ubyte Ptr newsrc=src While count count-=1 *newdst=*newsrc newdst+=1 newsrc+=1 Wend End Sub pri...
by dodicat
Mar 26, 2024 9:23
Forum: Archive
Topic: quitting smoking app
Replies: 3
Views: 3403

Re: quitting smoking app

The best time to stop smoking is April fool's day, 1 April. I stopped 1 April 10 years ago because as you get older stopping is a life requirement. I know others who have stopped on that day. You very rarely see old people still smoking, a few yes, but these are exceptionally tough people. You will ...