Comments

Log in with itch.io to leave a comment.

Viewing most recent comments 1 to 22 of 78 · Next page · Last page

Hi Ray

I have a question about texture loading and unloading correctness:

#include "raylib.h"

int main(void) {

    const int screenWidth = 400;

    const int screenHeight = 300;

    SetTargetFPS(60);

    InitWindow(screenWidth, screenHeight, "DrawTexture Example");

    int fontsize = 20;

    char *getfont = "fonts/JuliaMono-Light.ttf";

    Font font = LoadFontEx(getfont, fontsize, 0, 250);

    char *ptr = "Texture";

    int x = 50, y = 30;

    Image image = GenImageColor(screenWidth, screenHeight, WHITE);

    ImageDrawTextEx(&image, font, ptr, (Vector2){ x, y }, fontsize, 0, BLUE);

    Texture2D texture = LoadTextureFromImage(image);

    while (!WindowShouldClose()) {

        if (IsKeyDown(KEY_ENTER)) {

            ImageDrawRectangle(&image, x, y, 300, 30, WHITE);   // erase or text will become ugly

            ImageDrawTextEx(&image, font, ptr, (Vector2){ x, y }, fontsize, 0, RED);

            UnloadTexture(texture);                             // 1 saving memory or is it wrong?

            texture = LoadTextureFromImage(image);

        }

        else if (IsKeyDown(KEY_SPACE)) {

            ImageDrawRectangle(&image, x, y, 300, 30, WHITE);   // erase or text will become ugly

            ImageDrawTextEx(&image, font, ptr, (Vector2){ x, y }, fontsize, 0, PURPLE);

            UnloadTexture(texture);                             // 2 saving memory or is it wrong?

            texture = LoadTextureFromImage(image);

        }

        BeginDrawing();

        ClearBackground(WHITE);

        DrawTexture(texture, 0, 0, WHITE);

        EndDrawing();

    }

    UnloadImage(image);

    UnloadTexture(texture);

    CloseWindow();

    return 0;

}

/*

The console reports an incremental higher TEXTURE: [ID num] each time I use Enter or space. Is it only an intern Raylib count or?

Thanks in advance.

*/

(1 edit)

Hi Ray

I'm printing (Linux CUBS printer) on paper and use this test code snip, that works fine. 

// Raylib 5

    int x = 0;

    int y = 100;

    int fontsize = 16;

    char *getfont =  "arial.ttf"; // tried different fonts without success.

    Font font;

    font = LoadFontEx(getfont, fontsize, 0, 250);

    const char *t = "mimMIN";

    ImageDrawTextEx(&image, font, t, (Vector2){ x, y }, fontsize, 1, BLACK);

    const char *filename = "output.png";

    ExportImage(image, filename);

But I have issues with the sharpness of the letters, they become a bit blurred or unclear. I had similar issue month ago, when I printed from Windows using Raylib 4.5, but not using the same font from Notepad. I never got that problem solved.

Do you have a suggestion for what I can improve, if the problem at all is related to Raylib?

Thanks in advance.
Hobby programmer

I'm afraid there is not much it can be done in that regards. raylib uses stb_truetype for font rasterization. Afaik, it does not support better font rasterization options like ClearType hinting.

I solved the issue by using an image of higher resolution and then print and it very fine.

Thanks for answer.

ha pasado un año mas o menos para poder usar raylib en Dlang ahora me funciona, gracias autor por esa libreria <3, podrias compartir tutoriales sobre desarrollo pero en Dlang

the exe simply doesn't run for me on windows 11

It requires OpenGL 3.3 support to run... but it can also be locked by an antivirus.

I have made small relational database in C, which uses the fantastic Raylib graphics for the interface. Raylib just works perfect for me.

I'm using Linux Mint and it works fine, but if I have to use the database on another Linux Mint computer, I ran into some issues. When I try to run the executable, it respond not associated to any known programs...

What do the other computer need to run the executable file?

Any help would be appreciated.

(-1)

Hi! Afaik, it should work ok on other computers with same OS and system libraries installed. 

If some external resources are required they should be provided along the executable.

It could also be a permissions issue.

Thanks Ray. 

I guess it might be, because I'm trying to use the executable on a Linux Mint LMDE(Debian) and I had made it on a Linux Mint(Ubuntu).

Right now, I'm trying to install Raylib on Linux Mint LMDE, but it's a struggle.

I have read that the installation can be as simple as this:

1. git clone https://github.com/raysan5/raylib.git

2. cd raylib

3. cmake .  gives lots of errors

4. make

I fairly new to Linux and uses CodeBlocks and C99.

After many issues, I think the above is okay. Now I got errors about rlgl.h line 1200  gives undefined reference to 'sqrtf' and many more raymath.h e.g.

That seems related to math library, are you linking with some math library? 

I don't think so, but now I got rid of that error and can compile without errors and warnings.

When I try to run the compiled file, the console shows: error while loading shared libraries: libraylib.so.500: cannot shared object file: No such file or directory

Thank you for this great library. I have been using it recently and enjoy it a lot. It’s such a great middleman between low-level graphics programming and something like Godot or a library that has scenes and things like that. Plus, I can use C. Very easy to use and highly intuitive.

If anyone is interested, I have created a little template project that uses a Makefile and a shell script to download and install for compiling for linux/web and for cross-compiling to win32. I haven’t really used CMake before so I wanted to try and keep it simple. https://git.sr.ht/~kmdodrill/raylib-template

(+1)

Thanks! Glad you like it! :D

And thanks for sharing the template!

Hi, I have a problem on win 11. When I click installers exe, win thinks for a moment, but then nothing happens. Please help! 

This library is super cool. Can i use this in a custom version of Lua?

Sure!

i started working on it

the name is lunar, i made decent progress, i think

(+1)

Is this compatable with C++ or C#?

there are bindings for both

Hey, this is cool library!
Maybe my games will be powered on it :) 

Thanks! Hope you enjoy it! :D

How do I change what directory it installs to?

(+1)

Installer does not allow to change the directory, it contains multiple compilation scripts preconfigured and choosing another path would require reconfiguring all those scripts. In any case, the installation is self-contained, experienced users can just move C:/raylib to any other directory if required compilation scripts are setup properly.

thank you so much for creating this. it saved a heck ton of time for me. i was using c-sfml before but this is a lot quicker and easier. again thanks for making it :)

(+1)

thanks! glad you like it! 🙂

(-14)

uhm, where does the exe of raylib even is?
is this a scam?

i cant find it

raylib is a C programming library to code games using a code editor. It does not include a visual tool like Godot, Unity or Unreal.

(-9)

oh, but i (may) can only code visually

there are bindings and ports for various other programming languages that are easier to learn than C, maybe some of them have visual programming tools, but i don't know

how can i setup it in VS Code? im a beginner so i want to know :D

(+1)

You can check raylib Wiki for details: https://github.com/raysan5/raylib/wiki/Using-raylib-in-VSCode but I also recommend joining raylib Discord and ask the community if you have any problem with the configuration.

Deleted 349 days ago

I think so but I haven't tested it.

(+1)

hi, does raylib support networking?

I’m afraid it does not. I recommend using nbnet library for that task.

(+1)

Hey Ray, I have been using Raylib for a small library for drawing pixels one at a time and slowly drawing lines to make cool animations.

Here is an example:

However, I want to create a flood fill algorithm which means getting the pixels on the screen and checking their color. Is there a function which can get the screen pixels or do I have to try something else entirely?

Hi! Nice application! You can use LoadImageFromScreen() to get screen data as an Image and LoadTextureFromImage() to get a Texture2D to draw on screen again but this can be very slow...

thanks that may actually work for my purposes since it’s not performance critical and just meant to do something good looking very slowly!

Nice! Feel free to share your creation on raylib Discord community, there is a #madewithraylib channel for that. Also, you can share your creations in raylib GitHub Discussion: https://github.com/raysan5/raylib/discussions/1326

will do if I manage to finish it!

(1 edit) (+1)

Any thoughts of providing written/video tutorials for total beginners?

(+1)

It’s been on my TODO list for long time but my resources are limited and creating that kind of content requires lot of time that I usually invest in solving bugs and improving the library.

(+3)

Honestly this is not just the best graphics / game library I've ever tried, It's all around one of the best written project I've ever seen. The code is extremely clean and easy to understand, while capable for almost anything that I could think of as for game programming at this level. Very good example of self documenting code: the simple and well organised cheat sheet with occasional look ups in the source code, and the very high quality examples on the project web page is perfectly enough for working with this Really happy to see projects like this! Thank you very much for your amazing work! 

(+2)

Thank you very much! Glad you like it! I put a lot of work and lot of care to this project! I love to see it is appreciated! Thanks! 🙂

(+2)

Been deep diving into the repos and all the custom tools.  The organization, polish, and simplicity is a thing of beauty. And all written in C, fully open source.  Exactly what I have been looking for, well worth a donation imo. I can't wait to get started on my project ideas.  Well done!!!

Thank you very much! Glad you like it! 😄

That looks interesting, i think i will try it out!

(+1)

Hope you enjoy it! :D

What version of MinGW do i need to have installed for raylib? I’m reinstalling stuff but don’t remember the version needed.

(+2)

Latest raylib installs w64devkit that includes an updated version of MinGW built with the latest tools. You can find it on GitHub.

Viewing most recent comments 1 to 22 of 78 · Next page · Last page