02 - Linux Programming - Xlib Window - Non Accelerated Alpha blending - Sprite Animation - Github
A basic example of how to load a PNG file using LodePNG and alpha blending the image onto a window using basic (in RAM / non accelerated) pixel alpha blending.
0:00 Edit .nanorc for better tab indentation
0:04 Clone git repository to work it locally
0:07 Get LodePNG files from the web using wget -c URL
0:11 Start X11 session with a custom xterm console
0:13 Create file main.cpp
0:15 Create file display.h
0:19 Create file window.h
2:01 Create file color.h
2:20 Alphablend two pixels
2:35 Create file image.h
3:43 Create file bitmap.h
4:23 Load PNG file with LodePNG
5:30 Donwload PNG images for testing with wget
6:15 Write routine to get "ticks" in milliseconds
7:39 It works!
7:40 Add files to git repository and commit to GitHub
8:22 Resulting application
# Repository and files
#:~$ git clone https://github.com/DamianReloaded/LinuxProgramming.git
#:~$ wget -c https://raw.githubusercontent.com/lvandeve/lodepng/master/lodepng.h
#:~$ wget -c https://raw.githubusercontent.com/lvandeve/lodepng/master/lodepng.cpp
#:~$ wget -c https://sites.google.com/site/owlrepository/home/yingyang2.png
#:~$ wget -c https://sites.google.com/site/owlrepository/home/mrain.png
#:~$ wget -c https://sites.google.com/site/owlrepository/home/mushy.png
#Edit ~/.nanorc file (or create it) and add:
#set tabsize 4
#set tabstospaces
# X session with custom xterm
#:~$ xinit /usr/bin/xterm -geometry 120x42+510+128 -bg black -fg white -fa 'Monospace' -fs 11 -- vt1
Song: Movin - MK2
Other Videos By Damian Reloaded
2018-02-13 | Subnautica - Messing around |
2018-02-13 | Subnautica - Saving the Sunbeam - Not ^_^ |
2018-01-02 | Solar industry hires more people than Oil, Gas and Coal Combined |
2017-12-04 | System Shock 2 Bullets/Hypos Grinding Trick |
2017-10-12 | Speech Recognition Convolutional Neural Network |
2017-09-17 | Timelapse: Tetris From Scratch in C++ on Linux for DOS! |
2017-07-08 | Path Of Exile Gameplay 02 |
2017-07-07 | 04 - Coding Linux X11 Matrix Rain Animated Desktop in C++ |
2017-07-06 | Path Of Exile Gameplay 01 |
2017-06-15 | 03 - Linux Programming - Xlib Plugin Based Desktop Environment From Scratch |
2017-06-04 | 02 - Linux Programming - Xlib Window - Non Accelerated Alpha blending - Sprite Animation - Github |
2017-05-28 | 01 - Installing X11, Development Libs And Running SuperTux Without Window Manager |
2017-02-19 | CRS-10 | Falcon 9 SciFi Themed |
2015-09-08 | Text To Speech (Naive Approach) |
2014-05-17 | Speech Recognition Neural Network |