Commit Graph

97 Commits

Author SHA1 Message Date
Alexis Maiquez
7079d12e2a Switched video backgrounds to mpv (should fix all the videos that weren't playing sound or had random issues)
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-02-05 06:11:04 +01:00
Alexis Maiquez
a24b1923f6 Cleanup of code:
- use of auto in some places (more of this to come)
 - use for loops instead of iterators for most of the loops
 - extracted glfw/glew code into it's own class
 - make usage of std::filesystem instead of checking things with old C libraries

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-02-03 18:41:51 +01:00
Alexis Maiquez
d370e028ff Renamed CContext to CRenderContext to allow for the introduction of CAudioContext in following iterations
Improved logging and error reporting to be a bit more flexible

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-02-03 00:00:17 +01:00
Alexis Maiquez
4dc3a4bc01 Added g_PointerPositionLast
Improved delay calculation for parallax (should prevent backgrounds from flickering with big delays)
Fixed g_TexelSize having the wrong value and g_TexelSizeHalf not being defined

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-02-01 18:40:38 +01:00
Alexis Maiquez
176470dad9 Image color and alpha can now be user-settings
Removed old Color structures not useful anymore

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-02-01 02:08:05 +01:00
Alexis Maiquez
cec1baef30 Added explanations on the properties part of the backgrounds
Any --set-property will now output something when a value is being applied to ease debugging

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-01-31 22:44:27 +01:00
Alexis Maiquez
9cddb56f60 Added support for setting values to properties from command-line to modify how backgrounds look
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-01-31 22:07:59 +01:00
Alexis Maiquez
cf37fe388c Added support for usersettings in the bloom
Added casting for integer to double in json loading
Added support for dumping all available properties

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-01-31 21:37:38 +01:00
Alexis Maiquez
e16d54bba3 Added an extra path for background loading
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-12-05 10:36:42 +01:00
Alexis Maiquez
087a0976ae Added support for taking a screenshot after wallpaper's up (useful for pywal and other ricing rools)
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-11-05 11:00:51 +01:00
Alexis Maiquez
fa67fa5b00 Fixed bloom effect not being properly applied
Added support for userparameter on the clearcolor of the scene
Scenes should draw into the full framebuffer

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-11-05 10:50:55 +01:00
Alexis Maiquez
672ea47d23 Bumped up to OpenGL 3.3
Added base VAO
Fixed scene image align issues and things being flipped vertically under specific situations

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-11-04 18:41:23 +01:00
Alexis Maiquez
08586dcab6 Added some extra debugging for when glewInit fails, should make it easy to debug #128
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-11-04 00:37:31 +01:00
Alexis Maiquez
b5b7824233 Better approach on rendering the bloom effect, uses one less draw call
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-11-03 23:32:49 +01:00
Alexis Maiquez
cdaebbe893 Added support for camera bloom
Added support for virtual files

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-11-03 23:07:13 +01:00
Alexis Maiquez
c13d743022 Container access should happen through CContext
Textures now have a cache system that prevents loading them more than once

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-11-03 14:27:05 +01:00
Alexis Maiquez
261bc696df Added some object labels in opengl so they're reflected on RenderDoc while on debug
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-11-02 09:28:42 +01:00
Alexis Maiquez
597e3035ad Added missing include in main.cpp
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-10-28 07:41:50 +02:00
Alexis Maiquez
70d815c183 Properly detect texture sizes so effects using smaller mask textures are properly applied
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-10-28 05:06:21 +02:00
Alexis Maiquez
d6561268d6 Added support for gifscene.pkg files (essentially the same as normal scene.pkg) fixes startup of #118
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-07-14 22:29:11 +02:00
Alexis Maiquez
ec6164c4cf ~ fix audio thread not stopping when a signal for stopping is received
should fix #107

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-06-10 14:19:46 +02:00
Alexis Maiquez Murcia
46ea8e8f03 + Added support for using background's ID so it's directly loaded from a steam installation directly (implements #101)
~ Updated readme with the new possibilities

Signed-off-by: Alexis Maiquez Murcia <almamu@almamu.com>
2022-06-01 23:04:59 +02:00
Alexis Maiquez
6808f31cd6 Handle XIO errors to keep the background running as much as possible, should fix #91
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-05-08 14:14:36 +02:00
Alexis Maiquez
eb14099c4c Removed SDL_mixer in favour of ffmpeg for audio decoding
Added extra option for general audio volume

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-05-08 03:37:32 +02:00
Alexis Maiquez Murcia
3ed1459568 If SDL initialization fails, the background will still start but show an error to let the user know why the sound doesn't work
Signed-off-by: Alexis Maiquez Murcia <almamu@almamu.com>
2022-04-04 21:04:26 +02:00
Alexis Maiquez Murcia
aa3db15ec6 Added some automatic detection for the assets folder from the Steam installation:
~/.steam/steam/steamapps/cocmmon/wallpaper_engine/assets
~/.local/share/Steam/steamapps/common/wallpaper_engine/assets
<Current's binary location>/assets

Should improve/fix #82

Signed-off-by: Alexis Maiquez Murcia <almamu@almamu.com>
2022-04-04 20:27:42 +02:00
Alexis Maiquez
34635ba6ac ~ fixed video background playback being broken
~ CTexture should properly pick up the right width and height for animated backgrounds too

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-03-01 00:29:26 +01:00
Alexis Maiquez
f4955f1531 - removed dependency on std::filesystem
~ moved some things into CContext so main is a bit cleaner
~ moved wallpaper object creation into CWallpaper so main is a bit cleaner

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-02-28 14:54:45 +01:00
Alexis Maiquez
009321572e - removed custom glfw3 from the project as it's not needed anymore
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-02-28 02:31:51 +01:00
Alexis Maiquez
5bc0525493 ~ reorganized context initialization so opengl is ready
~ moved pixmap, gc and image creation to the initialization
  TODO: SUPPORT SCREEN SIZE CHANGES (THIS MIGHT NEED REINITIALIZATION OF THINGS)
~ moved fbo creation to initialization as it won't change anymore
~ reverted render code to the original loop as now the framebuffer is exactly as big as the whole display
~ moved glReadPixels off the wallpaper as that's code is exclusively used for screen rendering and not general rendering
~ XChangeProperty forces the update of the background, otherwise the compositor stops refreshing the screen and the background gets stuck
~ updated viewport variables to be integers instead of floats
~ reverted frame rendering code to be simpler and added the option to specify a framebuffer as target instead of screen

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-02-28 02:03:47 +01:00
Hynak
e56f128592 Added signal handling if the user terminates the program 2022-02-25 14:38:03 -05:00
Hynak
b2d4dd128d Hide GLFW for X Render 2022-02-25 14:27:56 -05:00
Alexis Maiquez
d5745b1cfa ~ Make use of the resolved path after startup and ensure it ends with a trailing slash.
Should fix @C0nvert 's issues on #59

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-02-18 19:02:55 +01:00
Alexis Maiquez
d5586b168b + Added checks for directories and ensuring specified wallpaper folder exists before initialization, fixes #70
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-02-11 15:50:54 +01:00
Alexis Maiquez
20c4ad3652 + Added better logging for asset loading errors and some extra information, should help get better information on #59
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-01-31 19:40:22 +01:00
Alexis Maiquez
a66bc26f1d ~ Fix issue #66, command-line parameters were not parsed properly
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-01-31 17:49:48 +01:00
Alexis Maiquez
f5ed023725 Fixed frame limiter to work properly with GLFW
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-01-25 00:17:14 +01:00
Alexis Maiquez
18ab051d47 ~ Fix background setup not working properly after the implementation of mouse support
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-12-04 23:44:17 +01:00
Alexis Maiquez
b55f2e8bf4 + Added PKGV0015 support
+ Added basic support for mouse position on shaders (still needs to be adjusted for backgrounds that are too big for the screen)
  (this makes XRAY effects work)

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-12-03 02:02:46 +01:00
Alexis Maiquez
9d2e9b43ee ~ Fixed an infinite loop in the shader compiler
+ Added more valid variable types to the shader compiler so compilation doesn't fail

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-11-29 13:36:15 +01:00
Alexis Maiquez
adad3bd18c ~ Changed parser to give sane defaults to some values (like origin, scale and size for each object)
~ Improved path detection on command line arguments
- Removed references to old, deprecated options

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-11-29 12:57:15 +01:00
Alexis Maiquez
d041e6455e ~ Better error handling to show relevant messages when a package load doesn't work
+ Added support for loading PKGV0014

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-11-29 12:33:15 +01:00
Alexis Maiquez
f86eba347c ~ changed priority of assets loading, so background's assets should be loaded before looking into the assets folder
~ hopefully fixed effects that use shader targets so they now display properly

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-09-29 01:21:35 +02:00
Alexis Maiquez
5828b2ee80 + added some extra documentation on rendering based on observations and trial and error
~ deprecated --dir --pkg options, the software will automatically detect the background we're loading
+ first draft of FBO support, there's still some extra work to do
~ texture header is now hidden behind getters so the textures can be any kind of source
~ proper setting of resolution and translation variables for textures
~ simplified call flow for any pass rendering, removing render functions on effect and material
~ framebuffer setup has to happen before object setup in the scene

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-09-27 01:39:23 +02:00
Alexis Maiquez
48da16f7e5 ~ listen for screen size changes and setup proper viewport so everything is rendered from the center of the screen
~ fixed a typo on one of the vertex positions for the CWallpaper::render function

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-09-08 19:42:27 +02:00
Alexis Maiquez
0225cac917 ~ changed glfw to use a custom library version until upstream adds proper support for this
~ brought back proper background rendering and position detection

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-09-08 19:09:43 +02:00
Alexis Maiquez
0dc5228cf0 ~ fixed build issue with the tests on glfw3 native functions
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-09-08 16:16:45 +02:00
Alexis Maiquez
03c4660f5c ~ brought back path fixing functionality so all paths given in the command line now end with a /
+ added support for texture format definition (TEX0FORMAT) although it might need some more investigation (specially for multi-pass shaders)
+ added implicit conversion from vec3 to vec2 in shaders

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-09-05 21:53:37 +02:00
Alexis Maiquez
154fe905bc ~ brought back video support
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-09-05 21:52:16 +02:00
Alexis Maiquez
2ffb5f1b24 + added an extra render pass to render the scene upside down (so it looks fine)
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-09-03 03:24:55 +02:00