News:

Download Pelles C here: http://www.pellesc.se

Main Menu

Recent posts

#11
Graphics programming / raylib 5.5 + PellesC v13.00.9 ...
Last post by rweidner - March 04, 2026, 06:24:32 AM
raylib 5.5 + PellesC v13.00.9 Tutorial
Hello World using precompiled raylib binaries (Windows, 32-bit)

What we are using in this tutorial (important)
For this tutorial, we are using this exact raylib package:
- `raylib-5.5_win32_msvc16.zip`

Notes:
- `5.5` = raylib version
- `win32` = 32-bit build
- `msvc16` = compiled with Microsoft Visual Studio toolchain
At the time this tutorial was written, this is the version/package tested for these steps.

Step 1 - Go to the raylib release page
Open the official raylib release page in your browser:
https://github.com/raysan5/raylib/releases

Find the release that contains this asset:
- `raylib-5.5_win32_msvc16.zip`

(For this tutorial, we are using the 5.5 release page.)
https://github.com/raysan5/raylib/releases/tag/5.5

Step 2 - Download the exact zip file
Download this file:
- `raylib-5.5_win32_msvc16.zip`

The file is listed near the bottom of the release page assets.
Note:
- Other precompiled packages/versions may also work.
- This tutorial was only tested with the package listed above.

Step 3 - Create a clean third-party folder (recommended)
If you do not already have a place to keep third-party DLLs/libs/headers, this works well:
- `C:\dev\3rdparty\raylib\`

For this tutorial, I assume this is where you put the files.

Step 4 - Extract the zip into a versioned folder
Extract `raylib-5.5_win32_msvc16.zip` into a versioned folder, for example:
- `C:\dev\3rdparty\raylib\raylib-5.5\`

Tip:
- Avoid accidental double nesting like:
  - `C:\dev\3rdparty\raylib\raylib-5.5\raylib-5.5\...`

Step 5 - Create a project in PellesC IDE
For this example, create a Win32 Console Program named `raylib_pellesc_hello` in:
- `C:\dev\`

Create a `main.c` file with the following contents:

#include "raylib.h"
int main(void)
{
    InitWindow(800, 450, "raylib hello");
    SetTargetFPS(60);

    while (!WindowShouldClose())
    {
        BeginDrawing();
        ClearBackground(RAYWHITE);
        DrawText("Hello, raylib!", 190, 200, 40, BLACK);
        EndDrawing();
    }

    CloseWindow();
    return 0;
}

Step 6 - Configure the project
Go to:
`Project -> Project Options`

Compiler
Click on `Compiler`:
* Change C Standard to `C17`
* Enable `Microsoft Extensions`

Folders
Click `General -> Folders`
Notice the dropdown next to `Type` (it may default to `Libraries`).

With `Type = Libraries`, add:
`C:\dev\3rdparty\raylib\raylib-5.5\lib`

Change dropdown to `Includes`, then add:
`C:\dev\3rdparty\raylib\raylib-5.5\include`

Linker
Click on `Linker`
Under `Library and object files`, include:
`kernel32.lib advapi32.lib delayimp.lib raylibdll.lib opengl32.lib gdi32.lib winmm.lib user32.lib shell32.lib`

Important:
Repeat Step 6 for each build target you plan to use (`Debug` / `Release`).

Step 7 - Build and Run
Build and run using PellesC.
- Copy the raylib.dll found in C:\dev\3rdparty\raylib\raylib-5.5\lib to the root of the project. The exe built by the compiler should reside next to the copied dll.
- `ESC` will close the program.

If everything is configured correctly, you should see a raylib window with:

`Hello, raylib!`

Runtime note (important if build works but program will not start)
Because this tutorial links against `raylibdll.lib`, you will also need `raylib.dll` available at runtime.

Common fix:
Copy `raylib.dll` into the same folder as your compiled `.exe`
If the program builds but fails to start, this is one of the first things to check.

Final note
Let me know if I missed anything and I will update the steps.
If your extracted folder layout is different, post the folder names/files and we can adjust the tutorial.
#12
General discussion / Re: Compiling using pomake
Last post by rweidner - March 03, 2026, 11:50:36 PM
It's all good. No offense taken. Sometimes I use a couple of tiny .bat files for building. These are 2 of them.

build_debug.bat
===============
@echo off
call "%~dp0env_pelles32.bat"
cd /d "%~dp0"
"C:\Program Files\PellesC\Bin\pomake.exe" /F "RaylibWin32.ppj" POC_PROJECT_MODE=Debug

env_pelles32.bat
================
@echo off
REM Sets PellesC environment for x86 builds.
call "C:\Program Files\PellesC\Bin\povars32.bat"
#13
General discussion / Re: Compiling using pomake
Last post by John Z - March 03, 2026, 10:34:17 PM
I see.  No offense meant, can't be too careful these days.

Removing my prior post.

Regards,
John Z

I don't use pomake but I'm finishing up an IDE Add-In that when called creates one batch file that does the entire build process...just for fun - -

cheers,
 
#15
General discussion / Re: Compiling using pomake
Last post by rweidner - March 03, 2026, 10:10:16 PM
The reason I use the command line and pomake is because I also use a separate IDE from PellesC. I use PellesC IDE too. But sometimes I prefer something else.

No, I'm not a recruiter. In this context I'm just a dev that likes C and PellesC.

When I search my name, I see that none of my posts show up. What does show up are a few conversations about my posts. Other users seemed to get some value from at least a few of them. Maybe I'll make a few new ones to rebuild my street cred? My project today is PellesC + Raylib. I built a template for that type of project. I'll share that.
#16
General discussion / Re: Compiling using pomake
Last post by rweidner - March 03, 2026, 09:51:50 PM
This isn't my first post. There are still a few posts around.

I wrote a GTK+ PellesC post back in the day. 
I wrote a MySQL + PellesC post too. 
I was certain I wrote a SDL + PellesC post at some point in the past. But I can't seem to find that one now.

I don't mean to sound like a reporter. Just trying to start a conversation. (aka General Discussion)
#17
General discussion / Compiling using pomake
Last post by rweidner - March 03, 2026, 05:27:26 PM
I noticed a post recently where someone was trying to compile using pomake. I didn't attempt to compile his examples. Others looked and determined the issue was user error.  But the whole thread got me thinking. Why compile from the command line?

I can explain why I use that approach. It may seem unusual to some, but it works for me. I let PellesC manage my *.ppj files, while I sometimes use a different IDE for coding. Project management and debugging stay in PellesC, and pomake handles the builds.

So, my questions are:
  • What workflow issue are you personally trying to solve if you're compiling from the command line?
  • What challenges does your "outside the box (IDE)" create, if any?
  • Did you solve those challenges? If so, how?

#18
Feature requests / Equate to get the stack alloca...
Last post by Vortex - March 01, 2026, 12:38:35 PM
Hi Pelle,

Poasm adjusts the stack to store the local variables and the shadow space of the X64 calling convention. For example :

main PROC a1:QWORD,a2:QWORD,a3:QWORD,a4:QWORD,a5:QWORD PARMAREA=4*SIZEOF QWORD

    LOCAL  temp1:QWORD
    LOCAL  temp2:QWORD
    LOCAL  temp3:QWORD
.
.

Poasm translates this to :

        sub     rsp, 72
My attempt to get the value of the substracted amount :

https://forum.pellesc.de/index.php?msg=41979

The purpose of this operation is to save correctly the volatile registers rcx,rdx,r8 and r9 to the shadow space of the calling procedure. My method is to get the allocation from the statement add rsp,X before ret.

Kindly, could you implement an internal equate like @StackRes ( stack reservation ) simplifying the access to the shadow space? It would be the coder's responsiblity to preserve this equate and take in account the volatile registers pushed to the stack by main PROC uses rsi edi etc.

An example :

main PROC a1:QWORD,a2:QWORD,a3:QWORD,a4:QWORD,a5:QWORD PARMAREA=4*SIZEOF QWORD

    LOCAL  temp1:QWORD
    LOCAL  temp2:QWORD
    LOCAL  temp3:QWORD
.
.

Poasm emitting @StackRes:

    mov    rax,@StackRes
    mov    temp3,rax
    mov    QWORD PTR [rsp+rax+8],rcx
    mov    QWORD PTR [rsp+rax+16],rdx
.
.
#19
Assembly discussions / Re: Saving the volatile regist...
Last post by Vortex - March 01, 2026, 12:19:19 PM
Here is how to get the stack allocated by a Poasm procedure. The task is to get the allocation from the statement add rsp,X before ret :

include RegsToShadSpace.inc

.data

msg     db 'Hello!',0
msg2    db 'rcx,rdx,r8 and r9 are saved.',0
title   db 'MsgBox',0
title2  db 'Macro test',0

.data?

mainRsp dq ?

.code

start PROC PARMAREA=5*SIZEOF QWORD

    invoke  main,ADDR msg2,ADDR title2,10,20,30

    invoke  ExitProcess,0
    ret

start ENDP

main PROC a1:QWORD,a2:QWORD,a3:QWORD,a4:QWORD,a5:QWORD PARMAREA=4*SIZEOF QWORD

    LOCAL  temp1:QWORD
    LOCAL  temp2:QWORD
    LOCAL  temp3:QWORD

    mov    temp1,1
    mov    temp2,2

    mov     rax,-1

;   How     the stack release instructions are encoded?
;   Example :

;   add     rsp, 88   ; 48: 83. C4, 58
;   add     rsp, 136  ; 48: 81. C4, 00000088

    mov     r10,OFFSET StackReservation
    cmp     WORD PTR [r10],08348h
    jne     l1

    movzx   rax,BYTE PTR [r10+3]
    jmp     l3

l1:

    mov     eax,DWORD PTR [r10+3]

l3:
    lea     rax,[rsp+rax+8]
    mov     temp3,rax
    mov     QWORD PTR [rax],a1
    mov     QWORD PTR [rax+8],a2
    mov     QWORD PTR [rax+16],a3
    mov     QWORD PTR [rax+24],a4   

;   MessageBox destroying parameters a1,a2,a3 and a4

    invoke  MessageBox,0,ADDR msg,ADDR title,0

;   Retrieve the volatile registers from the shadow space

    mov     r10,temp3
    invoke  MessageBox,0,[r10],[r10+8],0

StackReservation:   

    ret

main ENDP

END start
#20
General discussion / Re: Pellesc site down?
Last post by Vortex - February 27, 2026, 10:49:09 AM
Official announcement by Pelle :

https://forum.pellesc.de/index.php?topic=11702.0