Code Monkey home page Code Monkey logo

bad_apple_virus's Introduction

Bad Apple but it's a Windows virus

A high-performance (I've never seen anything like this run in realtime before) rendition of Bad Apple, using Windows windows as the video surface.

It's not actually a virus, but it is reminiscent of the viruses of old that were more of a nuisance than anything.

Video demonstration:

Flandre Scarlet made out of windows

Why is it so performant?

  • DeferWindowPos - even the most naive of projects can go from 1fps to 15fps by using this wonderful batched API instead of SetWindowPos.
  • WS_EX_TOOLWINDOW to remove the taskbar entry
  • SWP_NOREDRAW when moving/resizing windows
  • Optimised code that only shows/hides/moves windows that need showing/hiding/moving
  • Rust is blazing fast, don't you know?

Could it be faster?

I suspect that choosing which windows to move/resize, such that each is resized as little as possible, can increase performance - currently, the windows are just used from largest to smallest, which can result in some location jitter as they fit into different indexes.

Future work

All of these I have done already in small tests, but they're both difficult to make performant (copy dialogs are particularly slow), and difficult to arrange into a pleasing display.

  • Spawning MessageBoxA windows and taking their handle (thus avoiding the need to replicate the layout of MessageBoxA for each version of Windows you run on)
  • Spawning Vista file copy dialogs using IProgressDialog
  • Arranging windows in rolling sine waves, circles, etc

All of these I have not tried yet, but would be great additions:

  • Water physics using hundreds of scroll bars
  • Basic hard-body physics between windows
  • Error noises synced with the audio (could just pre-render...)
  • Notification bubbles
  • Windows in the taskbar to show text (if the user has large taskbar buttons enabled)
  • A large variety of error messages to delight the user with

Building and such

Should be fine to just cargo build --release.

Look at bad apple.py for the pre-processing to take an input video and turn it into boxes.bin, a space-optimized representation of the window bounds for each frame. The script is jank, don't come complaining.

bad_apple_virus's People

Contributors

mon avatar

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.