This file contains 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 flask import Flask | |
from flask_restful import reqparse, abort, Api, Resource | |
import uuid | |
app = Flask(__name__) | |
api = Api(app) | |
todoParser = reqparse.RequestParser() | |
todoParser.add_argument('description', type=str, help='Description of todo item.') |
This file contains 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.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.InputSystem; | |
public class InputController : MonoBehaviour | |
{ | |
public List<GameObject> players; | |
public Dictionary<int, GameObject> inputPlayerMap = new Dictionary<int, GameObject>(); |
This file contains 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
public void UpdateDirectionToGamePadRightStick(InputAction.CallbackContext context) | |
{ | |
angle = Mathf.Atan2(context.ReadValue<Vector2>().y, context.ReadValue<Vector2>().x) * Mathf.Rad2Deg; | |
} | |
public void UpdateDirectionToMousePosition(InputAction.CallbackContext context) | |
{ | |
Vector3 position = new Vector3(); | |
position.x = context.ReadValue<Vector2>().x; | |
position.y = context.ReadValue<Vector2>().y; | |
position.z = 0.0f; |
This file contains 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 UnityEngine.InputSystem; | |
public class WeaponController : MonoBehaviour | |
{ | |
private Vector3 direction; | |
private float angle; | |
public void Rotate(InputAction.CallbackContext context) | |
{ | |
Vector3 position = new Vector3(); |
This file contains 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
/* | |
// shader1_vertex.glsl | |
#version 330 core | |
layout (location = 0) in vec3 aPos; // Attribute 0. | |
layout (location = 1) in vec3 aColor; // Attribute 1. | |
out vec3 color; | |
uniform float myColor; | |
void main() |
This file contains 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 <GL/glew.h> | |
#include <GLFW/glfw3.h> | |
#include <stdio.h> | |
#include <iostream> | |
const char *vertexShaderSource = "#version 330 core\n" | |
"layout (location = 0) in vec3 aPos;\n" | |
"void main()\n" | |
"{\n" | |
" gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0);\n" |
This file contains 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 <GLFW/glfw3.h> | |
#include <stdio.h> | |
/** | |
Compile with MinGW on Windows: | |
mingw32-g++ main.cpp -I C:\libs\prebuilt\glfw-3.3.2.bin.WIN32\include -LC:\libs\prebuilt\glfw-3.3.2.bin.WIN32\lib-mingw -lglfw3 -lGdi32 -lOpengl32 -o main | |
**/ | |
int main() | |
{ |
This file contains 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 <stdio.h> | |
#include <stdlib.h> | |
#include <SDL2/SDL.h> | |
#define WINDOW_WIDTH 640 | |
#define WINDOW_HEIGHT 480 | |
typedef struct | |
{ | |
int x; |
This file contains 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
OBJS = main.c | |
OUTPUT = main | |
all : $(OBJS) | |
gcc $(OBJS) -IC:\libs\SDL2-2.0.12\i686-w64-mingw32\include -LC:\libs\SDL2-2.0.12\i686-w64-mingw32\lib -Wall -lmingw32 -lSDL2main -lSDL2 -o $(OUTPUT) |