Giter Site home page Giter Site logo

Comments (5)

aviks avatar aviks commented on May 27, 2024 2

don't have access to push the new change to a new branch

@MrZarfir You don't need push access to collaborate on an open source repository. You typically create a fork, and make a pull request from there. See this github documentation

Hower, in this case, I have created this pull request here: #64

from gamezero.jl.

aviks avatar aviks commented on May 27, 2024 1

@MrZarfir good find. Can you try adding a TTF_CloseFont(font) call after the sf = TTF_Render_Text(...) call and test if your problem goes away?

from gamezero.jl.

DhruvaSambrani avatar DhruvaSambrani commented on May 27, 2024

Also, ALSA lib conf.c:4563:(snd_config_update_r) cannot access file /usr/share/alsa/alsa.conf pops up just before this error is thrown. Note that I have applied the fix as suggested in #42, and audio works well until this error.

from gamezero.jl.

levje avatar levje commented on May 27, 2024

Hi. I'm having the same problem with fonts. It seems like the following function loads a new instance of the same font file every time we create a new TextActor. The second line of the function creates a new TextActor and it never closes the TextActor.

function TextActor(text::String, font_name::String; font_size=24, color=Int[255,255,0,255], kv...)
    font = TTF_OpenFont(file_path(font_name, :fonts), font_size)
    sf = TTF_RenderText_Blended(font, text, SDL_Color(color...))
    w, h = size(sf)
    a = Actor(
        text, 
        sf, 
        Rect(0, 0, Int(w), Int(h)), 
        [1.,1.], 
        0,
        255,
        Dict{Symbol,Any}()
    )

    for (k, v) in kv
        setproperty!(a, k, v)
    end
    return a
end```

from gamezero.jl.

levje avatar levje commented on May 27, 2024

@MrZarfir good find. Can you try adding a TTF_CloseFont(font) call after the sf = TTF_Render_Text(...) call and test if your problem goes away?

Indeed, my problem goes away after adding a closing call. I don't have access to push the new change to a new branch, but it would be appreciated if you can add this small change (unless you can give me access so I can push it).

Thank you for your quick response.

from gamezero.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.