Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major review of sdlstdinc.inc (from SDL_stdinc.h) necessary #62

Open
Free-Pascal-meets-SDL-Website opened this issue Jun 19, 2022 · 2 comments
Labels
to do Some update necessary, critical or not

Comments

@Free-Pascal-meets-SDL-Website
Copy link
Collaborator

The C header file SDL_stdinc.h contains a lot of functions, types and features which are not found in the corresponding sdlstdinc.inc.

A major review of this file is necessary:

  • find defines/types/functions which are potentially useful for Pascal programmers, add them
  • e. g. math functions
@Free-Pascal-meets-SDL-Website Free-Pascal-meets-SDL-Website added the to do Some update necessary, critical or not label Jun 19, 2022
@suve
Copy link
Collaborator

suve commented Nov 20, 2022

I've been updating some of the other .inc files and some of original .h files contain macros / inline functions that make use of stuff declared in SDL_stdinc.h. I'm wondering how to approach this.

  • A) Wherever possible, use FPC's built-in functions, instead. If not possible, declare the SDL functions in sdl2.pas in the implementation section, so they're not exposed to the user.

  • B) Declare the SDL functions as usual inside sdlstdinc.h and just live with the fact that there's only a select few of them declared.

  • C) Go all-in and try to translate as much of the "SDL libc" functions as possible.

@Free-Pascal-meets-SDL-Website
Copy link
Collaborator Author

A) - In certain cases A) may be suitable, if compatibility is not affected. A hinting FIXME-comment should note about the used functions.

B) - I think this is the best option, because we want our units to be as Delphi compatible as possible, which is not guaranteed for option A). Also, some compiler functions may need additional units which increase dependencies, which is undesirable.

C) - We do not necessarily need all the "SDL libc" functions, so we do not need to waste time in translating and maintaining them.

What do you think? @suve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to do Some update necessary, critical or not
Projects
None yet
Development

No branches or pull requests

2 participants