Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fuelsoft committed Mar 15, 2020
1 parent 59635c6 commit a989bb3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -53,28 +52,30 @@ 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).

#### 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
Expand Down
12 changes: 0 additions & 12 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
*/

0 comments on commit a989bb3

Please sign in to comment.