Giter VIP home page Giter VIP logo

starbackground's Introduction

starBackground

This project is a very basic implementation of a wallpaper engine and is currently in development. The only current functionality is to make a star looking animation which can be seen below or to load your own video files (see more details below).

Alt text Alt text

This youtube video will go through how it works and what the next steps are (currently a bit outdated).

The project was made in C++ using SDL2 and FFMPEG.

People who want to contribute can now also make edits to the ideas file if they have any ideas for updates or open an issue

Usage

Assuming all required DLLs are available the program now has updated functionality. You can run the program with default settings or by additional command lines (UI and monitor "detection" is still in progress).

-w, --width: specifies the width of the window. default is 1920
-h, --height: specifies the height of the window. default is 1080
--stars: specifies the number of stars. default is 300
--video: specfies file path to a video file. (NOTE: if video is used this overrides the "star" setting).

Examples:
./starBG.exe -w 1920 -h 1080 --video ./video.mp4
./starBG.exe -w 1920 -h 1080 --stars 1000
./starBG.exe

Compilation

To simplify development on windows, MSYS2 has been used in order to compile this project. The following are required:

  • MSYS2
  • MinGW64 pacman -S mingw-w64-x86_64-toolchain
  • SDL2 pacman -S mingw-w64-x86_64-SDL2 (pacman -S mingw-w64-x86_64-SDL2_image)
  • FFMPEG pacman -S mingw-w64-x86_64-ffmpeg
  • make pacman -S make

When all dependencies have been installed, run make in the root folder. The executable should then be in the debug folder.

Required DLLs

As per #10 I realized I should mention the required DLLs for running the executable on windows. To run the application you need:

  • SDL2.dll
  • avcodec-60.dll
  • avdevice-60.dll
  • avfilter-9.dll
  • avformat-60.dll
  • avutil-58.dll
  • libgcc_s_seh-1.dll
  • libstdc++-6.dll
  • libwinpthread-1.dll
  • postproc-57.dll
  • swresample-4.dll
  • swscale-7.dll

starbackground's People

Contributors

darclander avatar slnxc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

starbackground's Issues

Update readme

It has come to my understanding that the readme is incomplete since not everyone can follow it and properly setup the project. (Which to me might be hard to see since I know what I need to do). Therefore we should update the readme to facilitate the setup for new contributors / developers.

  • Find key concepts which should exist in the readme.
  • Update readme accordingly.
  • Add more informative steps to make it easier to keep up with the steps.

Return to original wallpaper

Once the program is stopped the background will remain as a still of the current background. (Instead of moving stars it will just be white dots standing still). An upgrade would be to save the current background(s) and reset the wallpaper to them on program exit.

  • Save current wallpapers in a buffer.
  • Set the previous wallpapers once the program halts.

Window management

Currently the window management is handled with input to the application via argc in C++. The default value for 0 arguments is to set the window width: 1920 and height: 1080. A better solution would be to find the window dimensions and set the width / height accordingly.

  • Find a solution to retrieve window dimensions.
  • Use above solution to remove the default argument and use the retrieved dimensions.
  • Find multiple windows (monitors) and create a "big" window to display the background on.

Error retrieving HWND

For some versions of windows (incorrectly installed or non-purchased versions) it seems like the function get_wallpaper_window()
does not return a correct HWND to the windows wallpaper but instead returns 0.

https://github.com/darclander/starBackground/blob/main/src/ui.cpp

HWND get_wallpaper_window() {
        // Fetch the Progman window
        HWND progman = FindWindow("ProgMan", NULL);
        // Send 0x052C to Progman. This message directs Progman to spawn a 
        // WorkerW behind the desktop icons. If it is already there, nothing 
        // happens.
        SendMessageTimeout(progman, 0x052C, 0, 0, SMTO_NORMAL, 1000, nullptr);
        // We enumerate all Windows, until we find one, that has the SHELLDLL_DefView 
        // as a child. 
        // If we found that window, we take its next sibling and assign it to workerw.
        HWND wallpaper_hwnd = nullptr;
        EnumWindows(EnumWindowsProc, (LPARAM)&wallpaper_hwnd);
        // Return the handle you're looking for.
        return wallpaper_hwnd;
}

Any solutions for this would be greatly appreciated.

  • Find the issue.
  • Fix it.

Add image handler

Currently there is no solution for using .gif / .mp4 files as a moving background. Instead of only having the star-like moving background a further advancement would be to allow users to import different file-types which would be used instead as the moving background.

  • Create a class image handler which will handle different filetypes.
  • Allow the imported files to be transformed into a "moving background".
  • Add support for .gif files
  • Add support for .mp4 files

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.