An elaboration on Minimal D3D11 pt2, adding shadowmapping and incorporating various improvements and alternative approaches to the rendering setup, such as manual vertex fetching, samplerless texture lookup, null shader depth map rendering and procedurally generated texture and [instance data](https://gist.github.com/d7samurai/abab8a580d0298cb2f34a44eec41d39d#file-shader
Minimal D3D11 reference implementation: An uncluttered Direct3D 11 setup + basic rendering primer and API familiarizer. Complete, runnable Windows application contained in a single function and laid out in a linear, step-by-step fashion that should be easy to follow from the code alone. ~200 LOC. No modern C++, OOP or (other) obscuring cruft. View on YouTube
| // | |
| // Author: Jonathan Blow | |
| // Version: 1 | |
| // Date: 31 August, 2018 | |
| // | |
| // This code is released under the MIT license, which you can find at | |
| // | |
| // https://opensource.org/licenses/MIT | |
| // | |
| // |
Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.
There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.
1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]
struct foo {
struct bar {
int x;| // | |
| // TinyCRT, revamp and TinyWin support by Don Williamson, 2011 | |
| // Based on http://www.codeproject.com/KB/library/tlibc.aspx and LIBCTINY by Matt Pietrek | |
| // | |
| #pragma once | |
| #ifdef USE_DEFAULT_CRT |
| #include <stdio.h> | |
| // #define CLANG_EXTENSION | |
| // Clang compile with -O3 | |
| #define VS_EXTENSION | |
| // https://godbolt.org/z/sVWrF4 | |
| // Clang compile with -O3 -fms-compatibility | |
| // VS2017 compile with /O3 |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <opml version="1.0"> | |
| <head> | |
| <title>Graphics, Games, Programming, and Physics Blogs</title> | |
| </head> | |
| <body> | |
| <outline text="Tech News" title="Tech News"> | |
| <outline type="rss" text="Ars Technica" title="Ars Technica" xmlUrl="http://feeds.arstechnica.com/arstechnica/index/" htmlUrl="https://arstechnica.com"/> | |
| <outline type="rss" text="Polygon - Full" title="Polygon - Full" xmlUrl="http://www.polygon.com/rss/index.xml" htmlUrl="https://www.polygon.com/"/> | |
| <outline type="rss" text="Road to VR" title="Road to VR" xmlUrl="http://www.roadtovr.com/feed" htmlUrl="https://www.roadtovr.com"/> |
| ### | |
| ### | |
| ### UPDATE: For Win 11, I recommend using this tool in place of this script: | |
| ### https://christitus.com/windows-tool/ | |
| ### https://github.com/ChrisTitusTech/winutil | |
| ### https://www.youtube.com/watch?v=6UQZ5oQg8XA | |
| ### iwr -useb https://christitus.com/win | iex | |
| ### | |
| ### OR take a look at | |
| ### https://github.com/HotCakeX/Harden-Windows-Security |
| #define out OutCatcher() << | |
| template <typename TYPE> struct Out | |
| { | |
| explicit Out(TYPE& ref) : ref(ref) { } | |
| TYPE& ref; | |
| }; | |
| struct OutCatcher | |
| { |
| /** | |
| * This software is in the public domain. Where that dedication is not recognized, | |
| * you are granted a perpetual, irrevokable license to copy and modify this file | |
| * as you see fit. | |
| * | |
| * Requires SDL 2.0.4. | |
| * Devices that do not support Metal are not handled currently. | |
| **/ | |
| #import <UIKit/UIKit.h> |

