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
grid = [ | |
[" ", " ", " "], | |
[" ", " ", " "], | |
[" ", " ", " "]] | |
def is_winner(player): | |
return ( | |
# Rows | |
grid[0][0] == player and grid[0][1] == player and grid[0][2] == player or | |
grid[1][0] == player and grid[1][1] == player and grid[1][2] == player or |
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 PySide2 import QtCore | |
class Console(QtCore.QObject): | |
def __init__(self, msg): | |
super(Console, self).__init__() | |
self.msg = msg | |
self.timer = QtCore.QBasicTimer() | |
self.timer.start(500, self) |
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 OpenToolkit.Graphics.OpenGL; | |
using OpenToolkit.Windowing.Desktop; | |
using OpenToolkit.Mathematics; | |
using System.IO; | |
using System; | |
namespace ColoredTriangleVaoOpenTK4OpenGL31 | |
{ | |
class 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
using SFML.Window; | |
using SFML.Graphics; | |
using SFML.System; | |
using OpenToolkit.Graphics.OpenGL; | |
using OpenToolkit.Windowing.Desktop; | |
using System.IO; | |
using System; | |
namespace SfmlNetAndOpenTK4DotNetCore | |
{ |
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
let verts = new Float32Array( [ 0, 2, 0, -1, 0.2, 0, 1, 0.2, 0 ] ); | |
let v = base64_test( verts ); | |
function base64_test( fary ){ | |
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
// ENCODING TEST | |
console.log("Origin Data", fary ); | |
let uint = new Uint8Array( fary.buffer ); | |
console.log( "Convert F32 to Uint8 : Byte Length Test", fary.length * 4, uint.length ); |
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
CC = g++ | |
INC = -I"E:\Libs\SDL2-2.0.12-mingw-32bit\include" -I"E:\Libs\box2d-2.4.0-mingw-32bit\include" | |
LIB = -L"E:\Libs\SDL2-2.0.12-mingw-32bit\lib" -L"E:\Libs\box2d-2.4.0-mingw-32bit\lib" | |
FLAGS = -c | |
all: main.o | |
$(CC) main.o $(LIB) -lSDL2.dll -lbox2d -o app | |
main.o: main.cpp | |
$(CC) $(FLAGS) $(INC) main.cpp |
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
# | |
# Skeleton for SDL2/OpenGL application in Python | |
# with fixed logic time step, rendering is going still at full speed. | |
# | |
# To turn debug logging messages on, run with -v parameter: | |
# python <script_name.py> -v | |
# | |
import argparse | |
import logging |
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
// To run on laptops: | |
#ifdef _WIN32 | |
#include <windows.h> | |
extern "C" __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; | |
extern "C" __declspec(dllexport) DWORD AmdPowerXpressRequestHighPerformance = 0x00000001; | |
#endif | |
#include <QtGui/QOpenGLFunctions> | |
#include <QtGui/QSurfaceFormat> | |
#include <QtOpenGL/QOpenGLBuffer> |
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 Ammo from 'ammojs-typed'; | |
export class AmmoProvider { | |
private static api: typeof Ammo; | |
public static async getApi() { | |
if (!AmmoProvider.api) { | |
AmmoProvider.api = await Ammo();; | |
} |
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
#define FREEGLUT_STATIC | |
#include <GL/freeglut.h> | |
#include <GL/glu.h> | |
#include <iostream> | |
#include <btBulletDynamicsCommon.h> | |
GLfloat floorMaterialDiffuse[] = { 0.55f, 0.64f, 0.36f, 1.f }; | |
GLfloat sphereMaterialDiffuse[] = { 0.06f, 0.29f, 0.65f, 1.f }; | |
GLfloat platformMaterialDiffuse[] = { 0.74f, 0.53f, 0.19f, 1.f }; | |
GLfloat light0Diffuse[] = { 1.f, 1.f, 1.0f }; |