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
| cmake_minimum_required(VERSION 3.5) | |
| project(HelloRaylib VERSION 1.0.0 LANGUAGES C CXX) | |
| # Disable Raylib examples and tests so it builds faster | |
| set(FETCHCONTENT_QUIET FALSE) | |
| set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) | |
| set(BUILD_TESTS OFF CACHE BOOL "" FORCE) | |
| # Include CMake's FetchContent module | |
| include(FetchContent) |
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
| import { Button, VerticalBox, SpinBox, HorizontalBox, LineEdit} from "std-widgets.slint"; | |
| component CharacterStat inherits Rectangle { | |
| in property<string> statname: "???"; | |
| in property<int> value: 12; | |
| HorizontalLayout { | |
| alignment: stretch; | |
| Text { text: "\{statname}"; } | |
| LineEdit { | |
| text: "\{value}"; |
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
| size_t EmitterNode::_numPartsForRate(float rate, float dt) {// number of parts to emit | |
| size_t numParts = 0; | |
| float numPartsReal = rate * dt; | |
| // Treat fractional particles as a probability -- e.g. .3 particles | |
| // means 30% chance to emit | |
| float numPartsF = floor(numPartsReal); | |
| float partProb = numPartsReal - numPartsF; | |
| numParts = (size_t)numPartsF; |
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
| Thu Nov 19 07:31:12 UTC 2020 |
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
| // c++ -std=c++11 thread.cpp -o thread && ./thread | |
| #include <iostream> | |
| #include <algorithm> | |
| #include <vector> | |
| #include <thread> | |
| class TraceTile | |
| { | |
| public: | |
| int tileNum = 0; |
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
| #!/usr/bin/env python | |
| # CGInclude Watcher | |
| # Joel Davis (joeld42@gmail.com, @joeld42 on Twitter) | |
| # | |
| # Usage: Run this from a directory where you have shaders. | |
| # | |
| # Use at your own risk (and use an editor that properly handles | |
| # open files being modified by another program). | |
| # |
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
| bool g_isMouseDown; | |
| float g_mouseButtonPrevPressTime; | |
| float g_mouseButtonLastPressTime; | |
| Vector2 g_mouseDownPos; | |
| Vector2 g_mousePos; | |
| bool g_isDragging = false; | |
| // Frame mouse events | |
| bool _isDragStarted = false; |
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
| # Slow, bad K-Means image quantization. | |
| # This code is in the public domain. | |
| import os, sys | |
| import random | |
| from PIL import Image, ImageDraw | |
| # Doesn't seem to get much better after this, YMMV... |
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
| /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/Headers/FSEvents.h | |
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
| #ifndef NDEBUG | |
| AllocConsole(); | |
| SetConsoleTitle( L"console window title" ); | |
| freopen("CONOUT$", "w", stdout ); | |
| #endif |
NewerOlder