From 54f9483f1b7b3e8c9f57e0292f987327e69813b1 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Thu, 24 Jun 2021 13:32:09 +0200 Subject: [PATCH] add pandoc skeleton --- .gitignore | 4 +- Makefile | 12 ++ README.md | 5 + create_code_archive_for_blackboard_LINUX.sh | 1 + ...te_code_archive_for_blackboard_WINDOWS.bat | 2 + report/Makefile | 21 ++++ report/README.md | 10 ++ report/images/logo.png | Bin 0 -> 4643 bytes report/template.md | 110 ++++++++++++++++++ src/main.rs | 8 +- 10 files changed, 169 insertions(+), 4 deletions(-) create mode 100644 Makefile create mode 100644 create_code_archive_for_blackboard_LINUX.sh create mode 100644 create_code_archive_for_blackboard_WINDOWS.bat create mode 100644 report/Makefile create mode 100644 report/README.md create mode 100644 report/images/logo.png create mode 100644 report/template.md 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 0000000000000000000000000000000000000000..f4533dc77a857fcf6e293e680a988702508580b2 GIT binary patch literal 4643 zcmeAS@N?(olHy`uVBq!ia0y~yU~XYxVEn?t%)r19q$~W8fq@|*z$e62Ib-#;YuCPg z|B*ZU__JrvPMtcnfB$|>P0f9mo-JFpY{rZkX=!OCB_$3H4iOO%4Gj$^ZoU!`5xM&4 z{pQV^L%a4(-FCgZyW75In~#srio^HbfB5w9^_PYf=NSU#F)%Rv|NoyMd*==Y2EjT{ z7srr_xHp##85tOOm=>5u{-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UHd48*v>5X18 zml5Z@Gc{*_d#?B}+o#s1%D2Lb)o0|$AgHh)VLiF#{FB~rtZIgz4Wros^Z8$%WJKcF*2|;DR?+~te8;nFSf3gQH#S^%xw1CgPbov z+bCo|;hXQzp~m7vWgNvI+{DQ^fcRib1LweD2gWk(^UEhKo8ia6z`)??>gTe~DWM4f DmDG#j literal 0 HcmV?d00001 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; + } _ => { } } },