From a989bb35b5ffd461d1d41309a6a6846f31007011 Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 15 Mar 2020 01:09:08 -0700 Subject: [PATCH] Update documentation --- README.md | 13 +++++++------ main.cpp | 12 ------------ 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 9d1fc6d..efebc95 100644 --- a/README.md +++ b/README.md @@ -32,16 +32,15 @@ Also, it's GPU accelerated (via SDL's Accelerated Rendering features). There are This project depends on: * [SDL2](https://www.libsdl.org/download-2.0.php) * [SDL_image](https://www.libsdl.org/projects/SDL_image/) +* C++17 for std::filesystem That's it. So far. - -This of course is being written for Windows. It should work with little additional work on Linux but Linux already has many excellent (and complete) image viewers that I would recommend over this. ## Building: This is where it gets tricky. I'm using Code::Blocks to write this, which abstracts away the build system. It should work with little extra effort by just plugging the CPP files into GCC and linking in SDL2 and SDL_image. -I will work on migrating to a makefile-type build to simplify this at some point. Pre-built copies are available too. +I will work on migrating to a makefile-type build to simplify this at some point. ## Usage: First, ensure that the executable has all the `.dll` files next to it. There are two groups you need: @@ -53,8 +52,9 @@ Then call the program by either dragging an image onto Viewer.exe or by running ### Controls: * Zoom is handled by hitting keypad +/- or scrolling. * Panning is handled by left-clicking and dragging the image. -* Zoom and position can be reset by hitting keypad 0 (keypad zero). +* Zoom and position can be reset by hitting keypad 0 (keypad zero) or center-clicking the mouse. * Quit by closing the window or hitting Escape. +* Navigave to previous/next image in folder with the left and right arrow keys or back/forward buttons on your mouse (if equipped). ### Supported formats: As listed [here](https://www.libsdl.org/projects/SDL_image/docs/SDL_image.pdf#page=8&zoom=auto,-205,547). @@ -62,19 +62,20 @@ As listed [here](https://www.libsdl.org/projects/SDL_image/docs/SDL_image.pdf#pa #### Notes: * Some file types can contain multiple resolutions/variations of an image (ICO, CUR, ...). SDL_image [documentation][1] states that "for files with multiple images, the first one found with the highest color count is chosen." * Window size and position are stored in `settings.cfg` in the program folder. If this becomes broken somehow (window appears off-screen, etc.) it is safe to delete this file to restore defaults. +* Setting up a version of GCC new enough to support C++17 is a really bad time on Windows and unless you really need to build from source, I highly recommend you use one of the builds. Otherwise, I'll direct you to [MSYS2](https://www.msys2.org/)'s homepage. ### TODO: This list is maintained in `main.cpp` as I think of things - check there for an up to date copy. * Add key to set zoom to 1:1 pixel ratio -* Filename in title * Possible: partial image metadata? PNG image data support from ProjectPNG? -* Navigate forward/backwards in current directory * Animated GIFs * Zoom on mouse instead of window center * Stop image from being moved off-screen * Possible: Image deletion? * Possible: Image rotation? * Cursor icon state updates? +* Don't exit if passed no parameters... show pop-up? +* Handle capitalization in file extensions ### Known Problems: * ICO: Files stored as "NEW PNG" type do not load with SDL_image diff --git a/main.cpp b/main.cpp index 1d6ec94..68df409 100644 --- a/main.cpp +++ b/main.cpp @@ -546,9 +546,7 @@ int main(int argc, char* argv[]) { /* TODO: * Add key to set zoom to 1:1 pixel ratio -* Filename in title * Possible: partial image metadata? PNG image data support from ProjectPNG? -* Navigate forward/backwards in current directory * Animated GIFs -> https://stackoverflow.com/questions/36267833/c-sdl2-how-do-i-play-a-gif-in-sdl2/36410301#36410301 * Zoom on mouse instead of window center * Stop image from being moved off-screen @@ -564,13 +562,3 @@ int main(int argc, char* argv[]) { * ICO: Files with partial transparent pixels do not render correctly * GIF: Animated sequences only load the first frame */ - -/* NOTES: -* - Working directory implementation will only work when program -* is run using it's full path (drag and drop, as default program), -* NOT directly from folder using terminal. -* This is not considered a high-priority fix due to complexity -* of doing it 'the right way' and minimal downside. -* It should happen infrequently and when it does, the program -* will just use the default settings. -*/