diff --git a/.gitignore b/.gitignore index 0f84cc9..e86f7e9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /target -/.vscode \ No newline at end of file +/.vscode +/report/*.pdf +/report/*.html diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..dd5d3b8 --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +.PHONY: help +help: + @echo -e "List of make targets:\n" + @grep "^\.PHONY: " Makefile | cut -d" " -f2- | sed -e "s/ /\n/g" + +.PHONY: run +run: + cargo run + +.PHONY: report +report: + make -C report diff --git a/README.md b/README.md index 55b65ea..f6955cd 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,7 @@ # Gloom-rs +To get started, make sure you have `git`, `cargo` and, `rustc` installed and available. + +You're free to write your report any way you'd like, as long as it is delivered as a PDF file. +To spread the word of *the one true way*, I have included a `pandoc` report skeleton in the `report` folder. +To use it make sure you have `pandoc` with a supported latex engine installed, making sure it works before using it to write your report. diff --git a/create_code_archive_for_blackboard_LINUX.sh b/create_code_archive_for_blackboard_LINUX.sh new file mode 100644 index 0000000..6dee7b6 --- /dev/null +++ b/create_code_archive_for_blackboard_LINUX.sh @@ -0,0 +1 @@ +zip -r source.zip gloom/src gloom/shaders diff --git a/create_code_archive_for_blackboard_WINDOWS.bat b/create_code_archive_for_blackboard_WINDOWS.bat new file mode 100644 index 0000000..8c77071 --- /dev/null +++ b/create_code_archive_for_blackboard_WINDOWS.bat @@ -0,0 +1,2 @@ +gloom/vendor/7z/7za.exe a source.zip gloom/src gloom/shaders +pause diff --git a/report/Makefile b/report/Makefile new file mode 100644 index 0000000..e229686 --- /dev/null +++ b/report/Makefile @@ -0,0 +1,21 @@ +PDVARS += --verbose +PDVARS += --highlight-style=pygments # the default theme + +# Optional filters, must be installed to use: +#PDVARS += --filter pandoc-include +#PDVARS += --filter pandoc-codeblock-include +#PDVARS += --filter pandoc-imagine +#PDVARS += --filter pandoc-crossref + +.PHONY: help +help: + @echo "try running 'make template.pdf' ;)" + +%.pdf: %.md Makefile + pandoc -i $< ${PDVARS} -o $@ #--pdf-engine=pdflatex + +%.tex: %.md Makefile + pandoc -i $< ${PDVARS} -o $@ --standalone + +%.html: %.md Makefile + pandoc -i $< ${PDVARS} -o $@ --katex --standalone --self-contained diff --git a/report/README.md b/report/README.md new file mode 100644 index 0000000..64d71e9 --- /dev/null +++ b/report/README.md @@ -0,0 +1,10 @@ +To use this skeleton, install [pandoc](](https://pandoc.org/installing.html). + +To compile `myfile.md` to PDF on linux, run: + + make myfile.pdf + +For example to compile `template.md`, run: + + make template.pdf + diff --git a/report/images/logo.png b/report/images/logo.png new file mode 100644 index 0000000..f4533dc Binary files /dev/null and b/report/images/logo.png differ diff --git a/report/template.md b/report/template.md new file mode 100644 index 0000000..aabbcbe --- /dev/null +++ b/report/template.md @@ -0,0 +1,110 @@ +--- +# These are meta-variables defined with YAML syntax, change them as you wish. +# see https://pandoc.org/MANUAL.html#variables +title: TDT4195 Assignment X +author: +- Gyrd Bannamule Gyrdsson +- Gjavleik Britonis Podebusk +date: \today # This is a latex command, ignored for HTML output +lang: en-US +papersize: a4 +geometry: margin=4cm +toc: false +toc-title: "List of Contents" +toc-depth: 2 +numbersections: true +colorlinks: true +links-as-notes: true +# The document is following the break written using Markdown syntax +--- + + + +# Heading + +## Subheading + +### Subsubheading + +This is a paragraph. +This is the same paragraph. + +This is a new paragraph, with *italic*, **bold**, and `inline code` formatting. +It is possible to use special classes to format text: [this is a test]{.smallcaps}. + +```rust +//this is a code block with rust syntax highlighting +println!("Hello, {}", 42); +``` + +[This](https://www.ntnu.no) is a link. +[This][] is also a link. +This[^this_is_a_unique_footnote_label] is a footnote. + +[This]: https://www.uio.no +[^this_is_a_unique_footnote_label]: In footnotes you can write anything tangentially related. + +* This +* is +* a +* bullet +* list + +1. This +1. is +1. a +1. numbered +1. list + a. with + a. sub + a. list + + with multiple paragraphs + +This is still on the first page + +\clearpage + + + +This is on the second page + +i) Yo +i) Yo +i) Yo + +This +: is a definition + +> this is a +block quote + +This is a paragraph with inline \LaTeX\ math: $\frac{1}{2}$. +Below is a math block: + +$$ + \int_{a}^{b} f(x)dx +$$ + +| This | is | a | table | +| ---- | --- | --- | ----- | +| 1 | 2 | 3 | 4 | +| 5 | 6 | 7 | 8 | + +: This is a table caption + +This is an inline image with set height: +![](images/logo.png){height=5em} + +Below is a figure (i.e. an image with a caption). +It floats and may as a result move to a different page depending on the layout. +Use the `pandoc-crossref` filter to reference figures, tables and equations. + +![ + Image with caption +](images/logo.png) diff --git a/src/main.rs b/src/main.rs index 6f4f906..59c940a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -54,7 +54,7 @@ fn main() { // Uncomment these if you want to use the mouse for controls, but want it to be confined to the screen and/or invisible. // windowed_context.window().set_cursor_grab(true).expect("failed to grab cursor"); // windowed_context.window().set_cursor_visible(false); - + // Set up a shared vector for keeping track of currently pressed keys let arc_pressed_keys = Arc::new(Mutex::new(Vec::::with_capacity(10))); // Make a reference of this vector to send to the render thread @@ -142,7 +142,7 @@ fn main() { } unsafe { - gl::ClearColor(0.163, 0.163, 0.163, 1.0); + gl::ClearColor(0.76862745, 0.71372549, 0.94901961, 1.0); // moon raker, full opacity gl::Clear(gl::COLOR_BUFFER_BIT | gl::DEPTH_BUFFER_BIT); // Issue the necessary commands to draw your scene here @@ -151,7 +151,6 @@ fn main() { - } context.swap_buffers().unwrap(); @@ -210,6 +209,9 @@ fn main() { Escape => { *control_flow = ControlFlow::Exit; }, + Q => { + *control_flow = ControlFlow::Exit; + } _ => { } } },