Giter Site home page Giter Site logo

Set the Window Icon about love HOT 6 CLOSED

love2d avatar love2d commented on May 17, 2024
Set the Window Icon

from love.

Comments (6)

slime73 avatar slime73 commented on May 17, 2024

Original comment by Robin Wellner (Bitbucket: gvx, GitHub: gvx).


Alternatively or additionally, perhaps a setting in conf.lua?

from love.

slime73 avatar slime73 commented on May 17, 2024

Original comment by Bart van Strien (Bitbucket: bartbes, GitHub: bartbes).


@robin: in any case additionally.

Yeah, seems like a nice feature, if it's SDL it can't be too hard (can it?)

from love.

slime73 avatar slime73 commented on May 17, 2024

Original comment by Bill Meltsner (Bitbucket: bmelts, GitHub: bmelts).


It's pretty simple: get the raw pixel data of an Image, create an SDL_Surface with it, and pass that to SDL_WM_SetIcon.

I'll take this one.

from love.

slime73 avatar slime73 commented on May 17, 2024

Original comment by Sean Donno (Bitbucket: [Sean Donnellan](https://bitbucket.org/Sean Donnellan), ).


I managed to get some time today to have a look at trying to do it myself.

I was however not able to get it fully working, ran into some problems with the typing.
Incorrect parameter type: expected userdata.

I am sure that Creating a surface, setting an icon and then freeing the surface again is fine as the SetIcon will copy the image data, meaning it is safe to free as it is not being used.
For X11, the SetIcon function will XCreatePixmap and so forth thus duplication image data and the data is copied acorss. Similarly Windows does a similar thing CreateIconFromResourceEx, so that data stored b in the surface is not accessed by the WM after the SetIcon function call.

Sorry, for not being able to produce a fully working patch, but at the least I hope this can help as a base.

from love.

slime73 avatar slime73 commented on May 17, 2024

Original comment by Bill Meltsner (Bitbucket: bmelts, GitHub: bmelts).


Implemented in <>.

from love.

slime73 avatar slime73 commented on May 17, 2024

Original comment by Robin Wellner (Bitbucket: gvx, GitHub: gvx).


Not a setting in conf.lua yet, is that on purpose?

from love.

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.