Jump to content

tinyBigGAMES

Members
  • Content Count

    43
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by tinyBigGAMES

  1. tinyBigGAMES

    CPas - C for Delphi

    Overview What if you were able to load and use C99 sources directly from Delphi? There is a vast quantity of C libraries out there and being able to take advantage of them, without being a pain would be nice. You could even compile a bunch of sources and save them as a library file, then load them back in from disk, a resource or even from a stream. You can get the symbols, map to a C routine, and execute from the Delphi side all from a simple API. Downloads Releases - These are the official release versions. Features Free for commercial use. Allow C integration with Delphi at run-time. Support Windows 64-bit platform. Support for C99. Fast run-time compilation. Can run C sources directly or compile to (.LIB, .EXE, .DLL). Library files can be loaded and used at run-time from a file, a resource or stream. Import symbols directly from a dynamic linked library (.DLL) or module-definition (.DEF) file. You can reference the symbols from Delphi and directly access their value (mapping to a routine and data). Your application can dynamically or statically link to CPas. Direct access to the vast quantity of C99 libraries inside Delphi. Minimum System Requirements Delphi 10 (Win64 target only) FreePascal 3.3.3 (Win64 target only) Microsoft Windows 10, 64-bits 20MB of free hard drive space How to use in Delphi Unzip the archive to a desired location. Add installdir\sources, folder to Delphi's library path so the CPas source files can be found for any project or for a specific project add to its search path. Add installdir\bin, folder to Windows path so that CPas.dll file can be found for any project or place beside project executable. See examples in installdir\examples for more information about usage. You must include CPas.dll in your project distribution when dynamically linked to CPas. See CPAS_STATIC define in the CPas unit file. See installdir\docs for documentation. A Tour of CPas CPas API You access the easy to use API in Delphi from the CPas unit. {.$DEFINE CPAS_STATIC} //<-- define for static distribution type { TCPas } TCPas = type Pointer; { TCPasOutput } TCPasOutput = (cpMemory, cpLib); { TCPasExe } TCPasExe = (cpConsole, cpGUI); { TCPasErrorMessageEvent } TCPasErrorEvent = procedure(aSender: Pointer; const aMsg: WideString); { Misc } function cpVersion: WideString; { State management } function cpNew: TCPas; procedure cpFree(var aCPas: TCPas); procedure cpReset(aCPas: TCPas); { Error handling } procedure cpSetErrorHandler(aCPas: TCPas; aSender: Pointer; aHandler: TCPasErrorEvent); procedure cpGetErrorHandler(aCPas: TCPas; var aSender: Pointer; var aHandler: TCPasErrorEvent); { Preprocessing } procedure cpDefineSymbol(aCPas: TCPas; const aName: WideString; const aValue: WideString); procedure cpUndefineSymbol(aCPas: TCPas; const aName: WideString); function cpAddIncludePath(aCPas: TCPas; const aPath: WideString): Boolean; function cpAddLibraryPath(aCPas: TCPas; const aPath: WideString): Boolean; { Compiling } procedure cpSetOuput(aCPas: TCPas; aOutput: TCPasOutput); function cpGetOutput(aCPas: TCPas): TCPasOutput; procedure cpSetExe(aCPas: TCPas; aExe: TCPasExe); function cpGetExe(aCPas: TCPas): TCPasExe; function cpAddLibrary(aCPas: TCPas; const aName: WideString): Boolean; function cpAddFile(aCPas: TCPas; const aFilename: WideString): Boolean; function cpCompileString(aCPas: TCPas; const aBuffer: string): Boolean; procedure cpAddSymbol(aCPas: TCPas; const aName: WideString; aValue: Pointer); function cpLoadLibFromFile(aCPas: TCPas; const aFilename: WideString): Boolean; function cpLoadLibFromResource(aCPas: TCPas; const aResName: WideString): Boolean; function cpLoadLibFromStream(aCPas: TCPas; aStream: TStream): Boolean; function cpSaveOutputFile(aCPas: TCPas; const aFilename: WideString): Boolean; function cpRelocate(aCPas: TCPas): Boolean; function cpRun(aCPas: TCPas): Boolean; function cpGetSymbol(aCPas: TCPas; const aName: WideString): Pointer; { Stats } procedure cpStartStats(aCPas: TCPas); function cpEndStats(aCPas: TCPas; aShow: Boolean): WideString; If you want CPas to be statically bound to your application, enable the {$CPAS_STATIC} define in the CPas unit. How to use A minimal implementation example: uses System.SysUtils, CPas; var c: TCPas; // CPas error handler procedure ErrorHandler(aSender: Pointer; const aMsg: WideString); begin WriteLn(aMsg); end; begin // create a CPas instance c := cpNew; try // setup the error handler cpSetErrorHandler(c, nil, ErrorHandler); // add source file cpAddFile(cp, 'test1.c'); // link and call main cpRun(cp); finally // destroy CPas instance cpFree(c); end; end. Compatibility These are some libraries that I've tested. If you have tried more, let me know and I can add them to the list. miniaudio (https://github.com/mackron/miniaudio) raylib (https://github.com/raysan5/raylib) sfml (https://github.com/SFML/CSFML) stb_image (https://github.com/nothings/stb) stb_image_write (https://github.com/nothings/stb) stb_truetype (https://github.com/nothings/stb) stb_vorbis (https://github.com/nothings/stb) Media โค Made in Delphi
  2. tinyBigGAMES

    CPas - C for Delphi

    Hi, for now yes. I may revisit it in the near future.
  3. tinyBigGAMES

    AskChatGPT

    Integrate with OpenAI's ChatGPT API seamlessly from Delphi. Features Easily access the GPT API from a single class Supports both GPT3 and GPT4 models API key can be read from ChatGPTApiKey environment variable if defined Automatically sanitizes input to minimize errors Ability to define proxy settings Adjust personality response with a precision range of 0-1, from precise to creative Stream responses just like in the ChatGPT web interface Usage Get your API Key: https://platform.openai.com/account/api-keys Define environment variable ChatGPTApiKey and assigned your API key. You may have to reboot your machine for it to take effect. // Basic example showing how to query ChatGPT uses AskChatGPT; var LChat: TAskChatGPT; begin LChat := TAskChatGPT.Create; try // set chat params LChat.Model := GPT3; // use the GPT3 model, or GPT4 for the GPT4 model LChat.Creative := 1; // 0-1, 0 being most percise and 1 being most creative // ask question LChat.Question := 'What is Delphi?' // print question PrintLn('Q: %s', [LChat.Question]); // process and print response if LChat.Process then PrintLn('A: %s', [LChat.Response]); finally LChat.Free; end; end; Media Download https://github.com/tinyBigGAMES/AskChatGPT
  4. 1. If you have not done so, make sure you have excluded all Delphi related folders + your project folders from real-time virus scanning 2. ASLR is enabled by default so there may be places in your code that are now suddenly invalid whereas it worked perfectly before. There may be places where you must use NativeInt/NativeUInt instead for example. So, check for ASLR related issues that may exist in your code base. After doing the above, the constant AVs and crashes diminished for me.
  5. Quick and dirty example using CreateFileMapping IPCTest.mp4 IPCTest.zip
  6. lol, I will assume that you never used CreateFileMapping? So, with just three calls with no other dependencies, you can setup IPC between EXEs. With just two calls you can allocate virtual memory into the address space of your EXE or those same calls with different parameters, you can map a large file into your EXE address space and access it as it was contiguous memory. The power of CreateFileMapping at your disposal. Why does it need to overlay complicated?
  7. CreateFileMapping, shared memory between processes. Creating Named Shared Memory - Win32 apps | Microsoft Learn
  8. tinyBigGAMES

    SDL3 for Pascal

    SDL3 for Pascal If you want to get your hands dirty and directly use the new SDL3, I got you covered. ๐Ÿ˜Ž Add SDL3 to your uses statement and it will be linked into your executable with direct access, no DLLs to maintain. You also get miniaudio (for audio), Nuklear (for GUI), pl_mpeg (for video) and stb (for images & fonts) and more. Added a contrib folder and accepting PRs, if you wish to add a contribution. To start the ball rolling, I added ziparc archive utility for making standard password protected zip archives, using zlib/minzip from SDL3pas only. Enjoy! https://github.com/tinyBigGAMES/SDL3
  9. tinyBigGAMES

    GamePascal Toolkit

    GamePascalโ„ข is a professional indie game toolkit that allows you to do 2D game development using the Object Pascal language. Officially supporting Embarcadero Delphiยฎ and FreePascal compilers on desktop PC's running Microsoft Windowsยฎ and uses Direct3Dยฎ for hardware accelerated rendering. It's robust, designed for easy use and suitable for making all types of 2D games and other graphic simulations. You access the features from a simple and intuitive API, to allow you to develop your projects rapidly and efficiently. There is support for textures, audio samples, streaming music, video playback, loading resources directly from a compressed and encrypted archive, a thin object-oriented actor/scene system, collision detection and much more. GamePascal, make 2D games in Pascal. Easy, fast & fun! https://gamepascal.org
  10. tinyBigGAMES

    GamePascal Toolkit

    Hi, thanks. Oh no worries, I welcome all feedback. I just committed a huge update to the repo today with all of that and more. There is a new unit GamePascal.Framework, there is a new class TGame that you can derive your games from with all of what you suggested built in. TGame, TActor, TActorList, TActorScene together allow you to have a dynamic and responsive OOP system to manage your game. All the examples have been updated to take advantage of this.
  11. tinyBigGAMES

    GamePascal Toolkit

    I'm working on this demo, which will be in the next update.
  12. tinyBigGAMES

    GamePascal Toolkit

    Also, you can always spin up a TCompiler instance (see GPCC if you want to play around with it now) and compile your source standalone via the built-in CaaS (compiler as a service). There will be more information/examples about CaaS in future releases. The allows for the move toward a standalone game engine/ide environment in the future.
  13. tinyBigGAMES

    GamePascal Toolkit

    GVExamples in the distro (unzip and run). This is just v0.1.0, more examples and features coming in subsequent releases. GV was folded into DGK when I switched to SDL2 and it optimized for more recent versions of Delphi. GPT uses SDL3, it is designed to work on more compiler/windows versions and will have more/advanced features that will eventually be included. Will not be hampered by limitation of a compiler version not having feature X which prevents you from using it. As long as your compiler version can target win64 and have Unicode, then it should be able to work.
  14. tinyBigGAMES

    Digitally Sign Applicaiton

    Put in a .bat file and then call the .bat file from the post build event.
  15. tinyBigGAMES

    Crowdstrike killing Delphi 11.2

    You MUST exclude all Delphi folders + YOU_PROJECT_FOLDER from your real-time virus scanning, else world of hurt ensues. I use Window Security and if I do not do this, it will chew on Delphi/generated exe and interfere with many aspects of the normal code and debug process.
  16. tinyBigGAMES

    Luna Game Toolkit

    New update. Now using SDL backend. Free and open source. Enjoy! https://github.com/tinyBigGAMES/Luna
  17. tinyBigGAMES

    Luna Game Toolkit

    Yea, I know, I know. So many eyeballs however and the response tends to be much higher. That being said, I see a new option show up on my twitter account, communities so experimenting with a group for twitter. Will be here: Luna Game Toolkit Community / Twitter
  18. tinyBigGAMES

    Luna Game Toolkit

    Hey! Created a Facebook group for Luna Game Toolkit, my free and open-source game development library for Delphi. You've been invited to the cookout. Drop by and say hi. Will be posting daily. Hope to see you there. ๐Ÿค™ https://www.facebook.com/groups/lunagametoolkit
  19. tinyBigGAMES

    GameVision Toolkit

    Ahh, finally at a point where I can start to update my GameVision framework to support modern PCs. This new generation will power upcoming game projects. I created a Facebook group for it, and I plan to post frequently about my progress. If you wish to follow, then you're invited to the cookout. Stop by and hang. Cold beer, burgers on the grill. LOL. https://www.facebook.com/groups/gamevisiontoolkit
  20. tinyBigGAMES

    GameVision Toolkit

    See my reply
  21. tinyBigGAMES

    GameVision Toolkit

    Thx, see my reply.
  22. tinyBigGAMES

    GameVision Toolkit

    You can report issues here: Issues ยท tinyBigGAMES/GameVision (github.com) Again, thanks for reporting. ๐Ÿ‘
  23. tinyBigGAMES

    GameVision Toolkit

    I found the issue and updated GVExample, it should work for you now. You can redownload from the release page. Sorry about that. The repo has been updated as well. Thanks for reporting. ๐Ÿ‘
  24. tinyBigGAMES

    GameVision Toolkit

    Just so you know, all my EXEs are code signed tinyBigGAMES LLC (for your confidence and peace of mind). I would never intentionally release malicious software. I do understand your concern however, I would have been thinking the same thing, LOL. I suspect most likely the virus scanner which is interfering with it. I use Window Defender too and I have exclude all Delphi related folders just to be able to use it comfortably, else I get random AVs and other issues all day long. If you have a folder that you have excluded or if you could possible exclude GVExamples folder and see it will run. Note, you can right click on the exe, view properties and you will find its signed. LOL, "questioning my life decisions", how many times have I been to that very place. I do appreciate you check it out though. This demo is in the repo, and you can directly compile it in Delphi.
ร—