Search found 4844 matches

by dodicat
Jun 15, 2018 16:38
Forum: Beginners
Topic: Byval myType PTR vs. myType as function parameter?
Replies: 14
Views: 337

Re: Byval myType PTR vs. myType as function parameter?

It wasn't so much to fix anything, but to show the compile errors. I don't use -gen gcc much, so I am surprised to see the (non freebasic) compile log/errors. (Fbide) In essence, you would have to get the c code, read the errors in the compiler log, and try and figure out where these errors are in t...
by dodicat
Jun 15, 2018 13:32
Forum: Beginners
Topic: Byval myType PTR vs. myType as function parameter?
Replies: 14
Views: 337

Re: Byval myType PTR vs. myType as function parameter?

Here is a byref udt pointer. It doesn't work with -gen gcc. But unfortunately the error given is not at all clear. Type points Public: Declare Function set(As Ulong=0,As Byte=0,byref as points ptr=new points) Byref As points Ptr 'setter/getter Declare Function box(As long,As long,As long, As long) A...
by dodicat
Jun 14, 2018 19:30
Forum: General
Topic: Type mismatch, at parameter 1 of BLOAD() in 'Bload *p1, cint(*p2), cint(*p3)'
Replies: 11
Views: 163

Re: Type mismatch, at parameter 1 of BLOAD() in 'Bload *p1, cint(*p2), cint(*p3)'

Are you setting a graphics screen before bload?
screen 20,32 or something similar
by dodicat
Jun 13, 2018 9:33
Forum: Documentation
Topic: Wiki improvements
Replies: 155
Views: 4855

Re: Wiki improvements

OK fxm.
Thanks.
by dodicat
Jun 12, 2018 21:40
Forum: Documentation
Topic: Wiki improvements
Replies: 155
Views: 4855

Re: Wiki improvements

A quick quirk with private constructors.

Code: Select all


Type UDT
  Dim As Integer I=23
  private:
  Declare Constructor ()
End Type

constructor UDT ()
print "Hi"
end constructor


redim as udt temp(0)

dim as udt u=temp(0)

print u.i

'Dim As UDT u2   ''' NO

sleep

 
by dodicat
Jun 12, 2018 21:22
Forum: Game Dev
Topic: What is good cross platform gameloop?
Replies: 36
Views: 1357

Re: What is good cross platform gameloop?

Here is my simple idea. 1) fix a frame rate via a regulator, and keep it at that value throughout. or 2) Enable various frame rates, but keep the screen motion constant. The events here are driven from an increment of a float at each frame (arbitary) My example shows two identical pendulums (subs), ...
by dodicat
Jun 11, 2018 17:20
Forum: Game Dev
Topic: What is good cross platform gameloop?
Replies: 36
Views: 1357

Re: What is good cross platform gameloop?

I had to set up manually lines 1258 ish dim as integer opt_width = 1024 dim as integer opt_height =768' dim as integer opt_depth = 32 Otherwise I got "invalid screen mode " from line 1322 print "invalid screen mode " & opt_width & "x" & opt_height & &quo...
by dodicat
Jun 11, 2018 9:27
Forum: General
Topic: new complete FB version ?
Replies: 34
Views: 1025

Re: new complete FB version ?

@Dodicat: Why would GCC be necessary? Its an option and FB 32 is gen gas by default. The 32 bit -gen gas (default) is my own favourite. Perhaps androids and other systems need the gcc version, I don't know, I only have a desktop with Windows Intel. But to run forum code I usually try gas and gcc an...
by dodicat
Jun 10, 2018 22:46
Forum: General
Topic: new complete FB version ?
Replies: 34
Views: 1025

Re: new complete FB version ?

Yes, that distinctive thud of willow on leather, in a green English field, on a warm Summer evening, with a glass of beer in hand, could be very catching.
My freebasic is the default 32 bit -gen gas version 1.05.0 with fbide.
I keep gcc 32 bit and 64 bit for testing.
But not version 1.06.
by dodicat
Jun 10, 2018 16:26
Forum: General
Topic: new complete FB version ?
Replies: 34
Views: 1025

Re: new complete FB version ?

It is not in the zip download.
I dare not run the .exe version here on win 10 to find out.
by dodicat
Jun 10, 2018 15:32
Forum: General
Topic: new complete FB version ?
Replies: 34
Views: 1025

Re: new complete FB version ?

The 32 bit download is a -gen gas backend only The 64 bit download is a -gen gcc backend only. For a complete 32 bit (gcc and gas choice) you should also get gcc.exe. There is no easy way I know of to get this. Myself, I have gcc.exe in version 1.05 which I copied and pasted from my old version 1.04...
by dodicat
Jun 08, 2018 22:38
Forum: General
Topic: Weird issue with graphics put [solved]
Replies: 4
Views: 84

Re: Weird issue with graphics put

From the help. Your put is put (300, 200), pImage,xor xor is the default. xor uses the destination buffer, the final colour will be ( 0 xor &h00ff9944) then (&h00ff9944 xor &h00ff9944) (which is 0) then ( 0 xor &h00ff9944) which is &h00ff9944 then (&h00ff9944 xor &h00ff99...
by dodicat
Jun 08, 2018 14:33
Forum: Documentation
Topic: How and Why to make Abstraction by Object Encapsulation, with FB Syntax in UDTs (basics)
Replies: 18
Views: 367

Re: How and Why to make Abstraction by Object Encapsulation, with FB Syntax in UDTs (basics)

OK, I have added 8 bytes all round in my above snippet.
Should now cover the full image area plus the header.
Thank you for pointing out the error.
by dodicat
Jun 08, 2018 13:38
Forum: Documentation
Topic: How and Why to make Abstraction by Object Encapsulation, with FB Syntax in UDTs (basics)
Replies: 18
Views: 367

Re: How and Why to make Abstraction by Object Encapsulation, with FB Syntax in UDTs (basics)

Thanks Mr Swiss, size of ulong should have been used. The pointer indices stretch from 0 to w*h-1, each one occupying 4 bytes. The first eight indices are reserved as a header, so, readable by fb native keywords (imageinfo, put ...) Adding the 8 bytes, (32 bits) Is this necessary? The first 8 indice...
by dodicat
Jun 07, 2018 22:25
Forum: Documentation
Topic: How and Why to make Abstraction by Object Encapsulation, with FB Syntax in UDTs (basics)
Replies: 18
Views: 367

Re: How and Why to make Abstraction by Object Encapsulation, with FB Syntax in UDTs (basics)

belive -- (believe) Aside: Between Abstraction layers, Mr Swiss and fxm pending, here, encapsulate raw pixels via pointer with custom image texturing. Also the two levels of images encapsulate the screen and image ratios Type image private: As Any Ptr i 'image Dim As integer xx,yy 'graphics screen p...

Go to advanced search