Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
General / Re: Parameter passing oddities
« Last post by ASerge on Today at 09:42:03 pm »
And constref is essentially the same as const in this context.
Code: Pascal  [Select][+][-]
  1. procedure Add(constref a, b: Integer; out c: Integer);
  2. begin
  3.   if ((@a = @c) or (@b = @c)) then
  4.     begin
  5.       WriteLn('Output can not be input.');
  6.       Exit;
  7.     end;
  8.   c := a + b;
  9. end;
As I understand it, he wants a compilation error, not runtime.
2
General / Re: Parameter passing oddities
« Last post by KodeZwerg on Today at 09:39:22 pm »
And constref is essentially the same as const in this context.
Code: Pascal  [Select][+][-]
  1. procedure Add(constref a, b: Integer; out c: Integer);
  2. begin
  3.   if ((@a = @c) or (@b = @c)) then
  4.     begin
  5.       WriteLn('Output can not be input.');
  6.       Exit;
  7.     end;
  8.   c := a + b;
  9. end;
3
Databases / Re: fkInternalCalc
« Last post by zraja on Today at 09:31:07 pm »
I have the same problem
4
Unix / Re: A fairly simple sound solution? [SOLVED]
« Last post by KodeZwerg on Today at 09:23:37 pm »
And it laughs at Windows only solutions.
Strange logic you whispering there.
In belonging to multimedia creative solutions, raytracing, CAD, audio and video editing etc, I would switch to the apple products.
5
General / Re: Parameter passing oddities
« Last post by Nitorami on Today at 09:14:49 pm »
Sorry if I did not bring my point across properly.
This
Code: Pascal  [Select][+][-]
  1. procedure add (const a,b: complex; out c: complex);
is the only version which is both fast (no copies required), and works with variables as well as function results, e.g. as in add (foo(),C1,C3);

Ok and works, BUT the "const" tells the compiler that a and b will not be changed, while when calling add (C1,C2,C1), "a" WILL be changed.

That is all, and this is what I meant with a calling method which works like "const" or "constref" BUT does not imply the "constness" of variables. The other options are "var" (but does not work with function results which have no address), and passing by value (out of the question because it is abysmally slow). And constref is essentially the same as const in this context.
6
Unix / Re: A fairly simple sound solution? [SOLVED]
« Last post by marcov on Today at 09:07:11 pm »
Blender, Da Vinci and Lightworks are cross platform and miles ahead.

But being crossplatform is not the same as being used for the bulk of videoediting. More conclusive evidence please!
7
Graphics / Demo Scene Picture sinwave
« Last post by Gigatron on Today at 09:00:25 pm »
Hi,
Let's continue with the Bitmap.PutImagePart from BGRA component, usefull now to make
flag wave or ... under 70 lines of code running for me at 60 fps, so play with....

Picture from   by TorinoGT;

Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls,
  9.   BGRAVirtualScreen,BGRABitmap, BGRABitmapTypes;
  10.  
  11. type
  12.  
  13.   { TForm1 }
  14.  
  15.   TForm1 = class(TForm)
  16.     BGRAVirtualScreen1: TBGRAVirtualScreen;
  17.     Timer1: TTimer;
  18.     procedure BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
  19.     procedure FormCreate(Sender: TObject);
  20.     procedure Timer1Timer(Sender: TObject);
  21.   private
  22.  
  23.   public
  24.  
  25.   end;
  26.  
  27. var
  28.   Form1: TForm1;
  29.   Plasma: TBGRABitmap;
  30.   acc : integer;
  31.  
  32. implementation
  33.  
  34. {$R *.lfm}
  35.  
  36. { TForm1 }
  37.  
  38. procedure TForm1.FormCreate(Sender: TObject);
  39. begin
  40.     Plasma := TBGRABitmap.Create('warrior1.png');
  41.     acc := 0;
  42.  
  43. end;
  44. // wobble or sinwave !!
  45. procedure TForm1.BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
  46. var
  47.   i : integer;
  48.   w : integer;
  49. begin
  50.      i:=0;
  51.      w:=0;
  52.  
  53.      Bitmap.Fill(BGRAPixelTransparent);
  54.      acc := acc +1;
  55.  
  56.      for i:=0 to 120 do
  57.      begin
  58.      w := round(50 + (10 * sin((i+acc) * 8 * PI / 180)));
  59.      Bitmap.PutImagePart(0, i*5-4 , Plasma,  Rect(w,  i*5-4,  600*w ,i*10+4), dmDrawWithTransparency);
  60.      end;
  61. end;
  62.  
  63. procedure TForm1.Timer1Timer(Sender: TObject);
  64. begin
  65.  
  66.        BGRAVirtualScreen1.RedrawBitmap;
  67. end;
  68.  
  69. end.
  70.  
8
Suggestions / Re: add new targets to make
« Last post by marcov on Today at 08:38:42 pm »
Glad to see you are making progress!
9
Unix / Re: A fairly simple sound solution? [SOLVED]
« Last post by Thaddy on Today at 08:37:08 pm »
Blender, Da Vinci and Lightworks are cross platform and miles ahead.
Blender is even open source. And it laughs at Windows only solutions.
(and yes you can edit video with blender, before you squick)
10
General / Re: how to tweek fpmake to compile RTL?
« Last post by marcov on Today at 08:29:16 pm »
Expanding fpmake to the RTL has been held off for practical reasons (RTL makefiles are more diverse) and fundamental reasons (fpmake, like any FPC program depends on RTL).

Pages: [1] 2 3 ... 10

TinyPortal © 2005-2018