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
float square(float val) { | |
return val * val; | |
} | |
float distanceSquared(vec2 p1, vec2 p2) { | |
vec2 vector = p2 - p1; | |
return vector.x * vector.x + vector.y * vector.y; | |
} | |
float calcRoundedCorners() { |
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
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>CSS Ribbon</title> | |
<style> | |
.container { | |
margin: 0 auto; | |
width: 800px; | |
} |
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
function randomString(length) { | |
var result = ''; | |
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; | |
var charactersLength = characters.length; | |
for ( var i = 0; i < length; i++ ) { | |
result += characters.charAt(Math.floor(Math.random() * charactersLength)); | |
} | |
return result; | |
} |
A Pen by Brandon Himpfen on CodePen.
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
project.ext.lwjglVersion = "3.2.2" | |
project.ext.jomlVersion = "1.9.15" | |
project.ext.lwjglNatives = "natives-macos" | |
dependencies { | |
testCompile group: 'junit', name: 'junit', version: '4.12' | |
implementation "org.lwjgl:lwjgl:$lwjglVersion" | |
implementation "org.lwjgl:lwjgl-assimp:$lwjglVersion" | |
implementation "org.lwjgl:lwjgl-glfw:$lwjglVersion" |
wget https://www.sfml-dev.org/files/SFML-2.5.1-macOS-clang.tar.gz
gunzip -c SFML-2.5.1-macOS-clang.tar.gz| tar xopf -
sudo cp -R SFML-2.5.1-macos-clang/Frameworks /Library
sudo cp -R SFML-2.5.1-macos-clang/lib /usr/local/
sudo cp -R SFML-2.5.1-macos-clang/include /usr/local/
sudo cp -R SFML-2.5.1-macos-clang/extlibs /Library/Frameworks
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
-Djava.library.path=libs/native/macosx |
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
package engine.graphic; | |
import static org.lwjgl.opengl.GL20.*; | |
public class ShaderProgram { | |
private int programId; | |
private int vertexId; | |
private int fragmentId; |
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
package engine; | |
public class GameEngine implements Runnable{ | |
public static final int TARGET_FPS = 75; | |
public static final int TARGET_UPS = 30; | |
private final Window window; | |
private final Thread gameLoopThread; | |
private final Timer timer; |
NewerOlder