No More Wrappers: The cppmode Feature in JetPascal 0.2.0+ #8
jarroddavis68
started this conversation in
DevLog
Replies: 2 comments 1 reply
-
|
Very interesting |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Congrats. Now OOP features.
Bien cordialement,
*Toky Olivier RAZANAKOTONARIVO*
*Soinala Studio*
Ridet: 1 622 257.001
SIREN: 934255878 - NIC: 0019
Villa n°3 Ferme Aquacole de Gatope
Voh 98 833, Nouvelle-Calédonie
Tél: (+687) 81.17.24
www.soinala-studio.nc
…On Sat, Nov 8, 2025, 11:08 Jarrod Davis ***@***.***> wrote:
Thanks! I’ve been working hard on this. The project was born out of my
frustration with not being able to fully tap into the C/C++ ecosystem from
Pascal. And, as devs do, I decided to tackle the problem head-on. Four
months later, deep, deep down the compiler-development rabbit hole, here we
are.
—
Reply to this email directly, view it on GitHub
<#8 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJ4KMTFZ6PS2URWZ6IHFFOD33UX63AVCNFSM6AAAAACLPFHXOCVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTIOJQG44DONY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This example demonstrates how to create a basic window using raylib with JetPascal™. It showcases the C++ interop features including
cppmode,header, andlinkdirectives, as well as thewhileloop statement.Example Code
Features Demonstrated
1. C++ Interop Mode
Enables C++ passthrough mode, allowing direct use of C++ libraries and functions without wrapper declarations.
2. Header Inclusion
header '"raylib.h"';Includes the raylib C++ header file. Note the double quotes inside single quotes - this passes the quotes through to C++.
3. Library Linking
Links the necessary libraries. JetPascal automatically handles the linking through the Zig build system.
4. While Loop
Standard Pascal
while...dosyntax. The loop continues until the window close button is pressed.5. Direct C++ Function Calls
All raylib functions are called directly:
InitWindow()- Creates the windowSetTargetFPS()- Sets the target frames per secondWindowShouldClose()- Checks if user wants to closeBeginDrawing()/EndDrawing()- Frame drawing boundariesClearBackground()- Clears the screen with a colorDrawText()- Renders text to screenCloseWindow()- Cleanup and close windowExpected Output
A 800x450 pixel window will open displaying the text "Congrats! You created your first window!" The window runs at 60 FPS and can be closed by clicking the close button or pressing ESC.
Technical Notes
Generated C++ Code
JetPascal transpiles this to clean C++ code:
Performance
Since JetPascal compiles to native C++ (via Zig/Clang), performance is identical to hand-written C++ code. There is zero runtime overhead.
Cross-Platform
This code works on Windows, Linux, and macOS when raylib is properly installed for the target platform.
Requirements
res\libs\raylib\)Beta Was this translation helpful? Give feedback.
All reactions