Skip to content

Commit

Permalink
update some docs for the wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
knzai committed Jul 17, 2024
1 parent 34947d4 commit 6953293
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 17 deletions.
8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ required-features = ["wasm"]

[features]
default = ["terminal", "png"]
terminal = ["dep:clap"]
png = ["dep:image"]
#terminal related features
terminal = ["dep:clap"]
#Preview window popup for the terminal
gui = ["dep:sdl2"]
#Web usage, may want to build with no-default-features to skip irrelevant terminal stuff
wasm = ["png", "dep:base64", "dep:gloo", "dep:js-sys", "dep:web-sys", "dep:yew"]
#sdl2 = ["dep:sdl2"]


[dev-dependencies]
rusty-hook = "^0.11.2"
Expand Down
31 changes: 18 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# cega

## CGA/EGA (the graphics formats from 80s games) parsing with png/gif/etc output and colored terminal preview
## CGA/EGA (graphics formats from 80s games) parsing with png/etc output, colored terminal preview, pre-alpha of wasm front-end

[![github](https://img.shields.io/badge/github-knzai/cega-8da0cb?logo=github)](https://github.com/knzai/cega)
[![crates.io](https://img.shields.io/crates/v/cega?logo=crates.io)](https://crates.io/crates/cega)
Expand All @@ -11,29 +11,34 @@

## Warning

This is currently very much in an alpha state: apis and CLI arguments may still change heavily and the apis aren't documented. This file has decent usage examples below.
This is currently very much in an alpha state/early beta state: apis and CLI arguments may still change heavily and the apis aren't documented. This file has decent usage examples below.

## Installation dependencies
## Installation

If you use feature `sdl2` you must install the sdl2 libraries first

### MacOS
`brew install sdl2 sdl2_gfx sdl2_image`

### Linux
`[sudo] apt-get install libsdl2-dev libsdl2-gfx-dev libsdl2-image-dev`
Standard crate/cargo install

### Features/conditional compilation and related dependencies
```toml
[features]
default = ["terminal", "png"]
terminal = ["dep:clap"]
png = ["dep:image"]
wasm = ["dep:yew"]
#sdl2 = ["dep:sdl2"]
#terminal related features
terminal = ["dep:clap"]
#Preview window popup for the terminal
gui = ["dep:sdl2"]
#web usage may want to build with no-default-features to skip irrelevant terminal stuff
wasm = ["png", "dep:base64", "dep:gloo", "dep:js-sys", "dep:web-sys", "dep:yew"]
```
Including terminal or wasm produces the corresponding binary

If you use feature `gui` you must install the sdl2 libraries:

### MacOS
`brew install sdl2 sdl2_gfx sdl2_image`

### Linux
`[sudo] apt-get install libsdl2-dev libsdl2-gfx-dev libsdl2-image-dev`

## Roadmap/Upcoming

### Priority
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pub mod color;
pub mod image;
pub mod parser;

#[cfg(feature = "sdl2")]
#[cfg(feature = "gui")]
pub mod sdl;

#[cfg(feature = "terminal")]
Expand Down
2 changes: 1 addition & 1 deletion src/terminal/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use cega::image::{self, Image};
use cega::parser::ParserType;
#[cfg(feature = "png")]
use cega::png;
#[cfg(feature = "sdl2")]
#[cfg(feature = "gui")]
use cega::sdl::render_sdl;
use cega::terminal::{self, args, *};
use cega::ImageType;
Expand Down

0 comments on commit 6953293

Please sign in to comment.