Skip to content

Instantly share code, notes, and snippets.

View dx12test.nim
import windows
import dxgi
import d3d12
import d3dcompiler
const winClass = "directNimrod"
#rendering constants
const width = 800
const height = 600
View templatetest.nim
proc newSeqAlias[T](): seq[T] =
result = newSeq[T]
template test(t: typedesc) =
var mmmm = newSeqAlias[t]()
when isMainModule:
View templatetest.nim
proc newSeqAlias[T](): seq[T] =
result = newSeq[T]()
template test(t: typedesc) =
var mmmm = newSeqAlias[t]()
when isMainModule:
View gist:8ce838a131b7e3e7c74c
type TKind = enum
type TTest = object
case kind: TKind
of TDef: value: int
of TOther: array[1..3, TTeset]
View gist:cc4a023b8f03a2ac9243
00ae2510 55 push ebp
00ae2511 8bec mov ebp,esp
00ae2513 83ec28 sub esp,28h
00ae2516 c745dc40e9b100 mov dword ptr [ebp-24h],offset fizzbuzz!nimNaN+0x7b00 (00b1e940)
00ae251d c745e44ce9b100 mov dword ptr [ebp-1Ch],offset fizzbuzz!nimNaN+0x7b0c (00b1e94c)
00ae2524 c745e000000000 mov dword ptr [ebp-20h],0
00ae252b 33c0 xor eax,eax
00ae252d 668945e8 mov word ptr [ebp-18h],ax
barcharcraz / gist:5ed117b13426b150c8fe
Created August 19, 2014 22:19
non-working version
View gist:5ed117b13426b150c8fe
00992510 55 push ebp
00992511 8bec mov ebp,esp
00992513 83ec28 sub esp,28h
00992516 c745dc40e99c00 mov dword ptr [ebp-24h],offset fizzbuzz!nimNaN+0x7b1c (009ce940)
0099251d c745e44ce99c00 mov dword ptr [ebp-1Ch],offset fizzbuzz!nimNaN+0x7b28 (009ce94c)
00992524 c745e000000000 mov dword ptr [ebp-20h],0
0099252b 33c0 xor eax,eax
0099252d 668945e8 mov word ptr [ebp-18h],ax
View FunctorWrap
class functor {
functor(SomeType* ths) {
pthis = ths;
void operator()(int p1) {
View gist:5654642
Instance folder is:
Instance started with command:
"C:\Program Files\Java\jre7\bin\java.exe" -Xms8192m -Xmx8192m -jar MultiMCLauncher.jar "Demos" "f9c36c25a9548dc82ec1e81dbeb3a14c7f660088" "MultiMC: main" "854x480" "Mojang"
Loading jars...
Loading URL: file:/E:/Personal/Documents/minecraft/instances/main/minecraft/bin/minecraft.jar
Loading URL: file:/E:/Personal/Documents/minecraft/instances/main/minecraft/bin/lwjgl.jar
Loading URL: file:/E:/Personal/Documents/minecraft/instances/main/minecraft/bin/lwjgl_util.jar
View gist:5694754
main_hall_init() was passed a blank mainhall name, loading first available mainhall.
ntdll.dll! ZwWaitForSingleObject + 12 bytes
KERNELBASE.dll! WaitForSingleObject + 18 bytes
fs2_open_3_6_17_DEBUG_SSE2_BP.exe! SCP_DumpStack + 354 bytes
fs2_open_3_6_17_DEBUG_SSE2_BP.exe! Warning + 495 bytes
fs2_open_3_6_17_DEBUG_SSE2_BP.exe! main_hall_init + 217 bytes
fs2_open_3_6_17_DEBUG_SSE2_BP.exe! game_enter_state + 403 bytes
fs2_open_3_6_17_DEBUG_SSE2_BP.exe! gameseq_set_state + 310 bytes
fs2_open_3_6_17_DEBUG_SSE2_BP.exe! game_process_event + 134 bytes
fs2_open_3_6_17_DEBUG_SSE2_BP.exe! gameseq_process_events + 152 bytes
View gist:5694757
DEBUG SPEW: No debug_filter.cfg found, so only general, error, and warning
categories can be shown and no debug_filter.cfg info will be saved.
FreeSpace 2 Open version:
Passed cmdline options:
-mod blueplanet,mediavps_3612
Building file index...
Found root pack 'C:\GOG Games\Freespace 2\blueplanet\adv-bp.vp' with a checksum of 0x6e9d550d
Found root pack 'C:\GOG Games\Freespace 2\blueplanet\bp-audio1.vp' with a checksum of 0x53c3080c