Re: [fpc-pascal] docs

2024-10-22 Thread Rafael Picanço via fpc-pascal
Also, I think that Michalis Kamburelis' introduction is a must-read for newcomers nowadays: https://castle-engine.io/modern_pascal Best regards, Rafael ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mail

Re: [fpc-pascal] Sub-millisecond time measuring

2024-07-02 Thread Rafael Picanço via fpc-pascal
Hi everyone. I am sharing some cross-platform timing I have done, it would be great to hear from you. For mac I translated this python implementation to free pascal: https://github.com/pupil-labs/pyuvc/blob/master/pyuvc-source/darwin_time.pxi ): ``` unit tim

Re: [fpc-pascal] Floating point question

2024-02-06 Thread Rafael Picanço via fpc-pascal
Bart wrote: > On Tue, Feb 6, 2024 at 6:13 PM Rafael Picanço via fpc-pascal > wrote: > > > > type > > {$IFDEF CPU86}{$IFDEF CPU32} > > TLargerFloat = Extended; > > {$ENDIF}{$ENDIF} > > > > {$IFDEF CPUX86_64} > > TLargerFloat = D

Re: [fpc-pascal] Floating point question

2024-02-06 Thread Rafael Picanço via fpc-pascal
> I’m afraid I don’t qualify for the bonus, because I don’t know what LargerFloat is. I am a little bit embarrassed here. The TLargerFloat is a type I wrote for a simple test some time ago and I forgot about it. I was following the TLargeInteger convention (from struct.inc in my current windows sy

Re: [fpc-pascal] Floating point question (Rafael Picanço)

2024-02-06 Thread Rafael Picanço via fpc-pascal
I have some questions about {$MINFPCONSTPREC 64} and the mentioned change introduced by FPC 2.2 (the "it" from here after). 1) Does it affects constants only? 2) Does it affects the LargerFloat type? 3) Should I use {$MINFPCONSTPREC 64} in {$mode objfpc} too to avoid it? 4) BONUS: Is the Larger

Re: [fpc-pascal] Division by zero when running SDL program on GPU (NVIDIA)

2024-01-30 Thread Rafael Picanço via fpc-pascal
gt; On Jan 30, 2024, at 6:45 PM, Rafael Picanço via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > Hi everyone, how are you doing? > > > > I am receiving an "FLT divide by zero" error when creating a renderer > with > >

[fpc-pascal] Division by zero when running SDL program on GPU (NVIDIA)

2024-01-30 Thread Rafael Picanço via fpc-pascal
Hi everyone, how are you doing? I am receiving an "FLT divide by zero" error when creating a renderer with // will default to Direct3d renderer DL_CreateRenderer(FSDLWindow, -1, // error // SDL_RENDERER_ACCELERATED or SDL_RENDERER_PRESENTVSYNC SDL_RENDERER_SOFTWARE ); So, my note

Re: [fpc-pascal] Error: compilation raised exception internally (Rafael Picanço)

2023-10-22 Thread Rafael Picanço via fpc-pascal
It is really not related to specific lines. But sometimes the error will repeat a lot on some lines. Please, can you confirm if a zip file containing the project it self is a minimal valid example? (I am afraid that changing the trying to simplify the project will "solve" the error). With some mo

[fpc-pascal] Error: compilation raised exception internally

2023-10-20 Thread Rafael Picanço via fpc-pascal
Hi everyone, I am getting a strange error when compiling a project. I am really not sure what is going on, because it occurs sometimes, consistently in some lines of the code with calls to this static variable: ... function NextID(ID : word) : word; ... NextID(ContainerClass.SomeTypeInstance.ID) .

[fpc-pascal] ideas for using a speech-to-text model with a fpc program

2023-09-24 Thread Rafael Picanço via fpc-pascal
Hi guys, I am looking for some advice on how to use a speech-to-text model with a fpc program designed to teach reading of invented words composed from 8 brazilian portuguese phonemes (four consonants and fours vowels). So, right now ( https://github.com/cpicanco/stimulus-control-sdl2/blob/hanna/

Re: [fpc-pascal] TStringHelper not found

2023-07-24 Thread Rafael Picanço via fpc-pascal
Thank you Michael, worked like a charm. On Mon, Jul 24, 2023 at 7:00 AM wrote: > Send fpc-pascal mailing list submissions to > fpc-pascal@lists.freepascal.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc

[fpc-pascal] TStringHelper not found

2023-07-23 Thread Rafael Picanço via fpc-pascal
I just updated to trunk (Lazarus 3.99 4ed7ff9b1c, FPC 3.3.1-13378-gceddc2aec3) and I am getting an "Identifier not found" error for TStringHelper: ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/lis

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-25 Thread Rafael Picanço via fpc-pascal
Hi James, I am not familiar with variants and Ole objects, sorry about that. I found some people using code with Ole objects and it that seems to work, can you chack if it applies to your case? https://stackoverflow.com/questions/17970573/using-word-ole-in-lazarus-freepascal Best, R On Sun, Jun

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-25 Thread Rafael Picanço via fpc-pascal
Hi James, Sorry, I missed the following reference: "Remark Dispatch interface support for variants is currently broken in the compiler." (https://www.freepascal.org/docs-html/ref/refsu20.html) Best, R > ___ fpc-pascal maillist - fpc-pascal@lists.fre

Re: [fpc-pascal] SDL2 Event Registration (and case statements)

2023-06-25 Thread Rafael Picanço via fpc-pascal
Thanks Guilhermo, Just to clarify, I do have a limited number of events. Lets say, 2 events. So, using the SDL_RegisterEvents function, is it possible to define these two new events as normal constants so they will be known at compile time and will make Free Pascal case statements happy? Best, R

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-25 Thread Rafael Picanço via fpc-pascal
Hi James, > SpVoice : Variant; > SpVoice := CreateOleObject('SAPI.SpVoice') The Free Pascal Variant type does not handle interfaces by default. Take a look: https://wiki.freepascal.org/Variant Best, R ___ fpc-pascal maillist - fpc-pascal@lists.freep

[fpc-pascal] EyeLink-for-Pascal

2023-06-21 Thread Rafael Picanço via fpc-pascal
Hi everyone! I am sharing my free pascal bindings for eyelink headers. https://github.com/cpicanco/EyeLink-for-Pascal If you find it useful, please let me know. Best, R ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepasc

[fpc-pascal] SDL2 Event Registration (and case statements)

2023-06-21 Thread Rafael Picanço via fpc-pascal
Hi, The SDL2 documentation recommends you to register constants with: Uint32 SDL_RegisterEvents(int numevents); numevents = the number of events to be allocated. Returns the beginning event number, or (Uint32)-1 if there are not enough user-defined events left. https://wiki.libsdl.org/SDL2/

Re: [fpc-pascal] fpc-pascal Digest, Vol 228, Issue 17

2023-06-15 Thread Rafael Picanço via fpc-pascal
Hi Tomas, On top of your suggestion, the only way to make FPC happy is to assign nil to the type constants and then assign the corresponding pointers to them somewhere: unit eyelink.constants interface const EXTERNAL_DEV_NONE : TGetExButtonStatesFunction = nil; EXTERNAL_DEV_CEDRUS : TGetExBut

Re: [fpc-pascal] Free Pascal bindings for EyeLink C code (with a god-cast)

2023-06-14 Thread Rafael Picanço via fpc-pascal
Hi Marco, I am trying to follow your advice and use units instead: const EXTERNAL_DEV_NONE : TGetExButtonStatesFunction = Pointer(0); However I am receiving an error: Error: Incompatible types: got "Pointer" expected "" Please, can you shed some light on this? Best, R On Wed, Jun 14, 2023

Re: [fpc-pascal] Free Pascal bindings for EyeLink C code (with a god-cast)

2023-06-13 Thread Rafael Picanço via fpc-pascal
Thank you Marco, I am elaborating on top of your suggestions. > The problem is that the logical solution, making it a macro, doesn't work, as macro definitions don't export through USES clauses. I think that pre-processor constants with $I would be a valid alternative for using the best solution.

[fpc-pascal] Free Pascal bindings for EyeLink C code (with a god-cast)

2023-06-12 Thread Rafael Picanço via fpc-pascal
Hi everyone, First of all, I am sorry if this is not the best place for this interoperability issue. The problem I want to solve is how to make a Free Pascal binding for to the following piece of C code: typedef struct _CCDBS { void *userdata; char buttons[256]; void *internal; }CCDBS; ty