This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| inline static overload void glsetarg(u32 id, int n, gldt type, const void *ptr, bool normalized) { | |
| glVertexAttribPointer(id, n, type, normalized, 0, ptr); | |
| }; | |
| inline static void gltex(texture tex) { | |
| glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); | |
| glTexImage2D(gl_tex2D, 0, gl_rgba, tex.w, tex.h, 0, gl_rgba, gl_u8, &tex.img[0]); | |
| }; | |
| mesh m = obj.mesh; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Diagnostics; | |
| using System.Linq; | |
| using System.Reflection; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| using Microsoft.CodeAnalysis; | |
| using Microsoft.CodeAnalysis.CSharp; | |
| using Microsoft.CodeAnalysis.CSharp.Syntax; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### Chainable Eval | |
| class Calc | |
| %w(zero one two three four five six seven eight nine divided_by times plus minus).zip((0..9).to_a + %w(/ * + -)) do |d| | |
| define_method(d.first.to_sym) { (@exp ||= []) << d.last; self } | |
| end | |
| define_method(:==) { |expected| eval(@exp.join) == expected } | |
| end |