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
| from OpenGL.GL import * | |
| def initFBO(offscreenWidth, offscreenHeight): | |
| # Create a texture object and set its size and parameters | |
| shadowMapTexture = glGenTextures(1) | |
| glBindTexture(GL_TEXTURE_2D, shadowMapTexture) | |
| glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR) | |
| glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR) | |
| glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, offscreenWidth, offscreenHeight, |
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
| // $ em++ -lwebsocket.js -o index.html main.cpp | |
| #include <emscripten/emscripten.h> | |
| #include <emscripten/websocket.h> | |
| #include <stdio.h> | |
| EM_BOOL onopen(int eventType, const EmscriptenWebSocketOpenEvent *websocketEvent, void *userData) { | |
| puts("onopen"); | |
| EMSCRIPTEN_RESULT result; |
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
| #include <QtGui/QOpenGLExtraFunctions> | |
| #include <QtGui/QSurfaceFormat> | |
| #include <QtGui/QVector3D> | |
| #include <QtOpenGL/QOpenGLFramebufferObject> | |
| #include <QtWidgets/QApplication> | |
| #include <QtWidgets/QLabel> | |
| #include <QtWidgets/QWidget> | |
| #include <QtWidgets/QVBoxLayout> | |
| #include <QtOpenGLWidgets/QOpenGLWidget> |
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
| #include <QtGui/QOpenGLExtraFunctions> | |
| #include <QtGui/QSurfaceFormat> | |
| #include <QtGui/QVector3D> | |
| #include <QtOpenGL/QOpenGLFramebufferObject> | |
| #include <QtWidgets/QApplication> | |
| #include <QtWidgets/QLabel> | |
| #include <QtWidgets/QWidget> | |
| #include <QtWidgets/QVBoxLayout> | |
| #include <QtOpenGLWidgets/QOpenGLWidget> |
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
| const jsBeautify = require('js-beautify')['js_beautify']; | |
| const fs = require('fs'); | |
| const glob = require('glob'); | |
| const options = { | |
| indent_size: 4, | |
| indent_char: ' ', | |
| indent_with_tabs: false, | |
| eol: '\n', | |
| end_with_newline: true, |
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
| // https://coliru.stacked-crooked.com/a/7765d15fe603a3d9 | |
| // https://gamedev.stackexchange.com/a/196955/115807 | |
| #include <iostream> | |
| #include <string> | |
| #include <vector> | |
| #include <memory> | |
| #include <map> | |
| struct b2Fixture; |
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
| QT += core gui widgets | |
| SOURCES += main.cpp | |
| TARGET = app |
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
| # Build: | |
| # | |
| # as -o hello.obj | |
| # ld -o hello.exe hello.obj -L C:\\tools\\mingw64\\x86_64-w64-mingw32\\lib -lkernel32 | |
| # | |
| # Requires MinGW | |
| .extern GetStdHandle | |
| .extern WriteFile | |
| .extern ExitProcess |
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 { mat4, quat, vec3 } from "gl-matrix"; | |
| import { gl } from "./webgl-context.js"; | |
| import { getEuler } from "./math-helpers.js" | |
| // This class implements debug drawing callbacks that | |
| // are invoked inside b2World::Step | |
| export default class DebugDrawer { | |
| constructor(program, pixelsPerMeter) { | |
| this.program = 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
| #!/usr/bin/python | |
| # coding=utf-8 | |
| import os, pygame, time, random, uuid, sys | |
| class myRect(pygame.Rect): | |
| """ Add type property """ | |
| def __init__(self, left, top, width, height, type): | |
| pygame.Rect.__init__(self, left, top, width, height) | |
| self.type = type |