Skip to content

Instantly share code, notes, and snippets.

:octocat:
NULL

Ahmad Rosid ar-android

:octocat:
NULL
Block or report user

Report or block ar-android

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View rounded-corner.glsl
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() {
@ar-android
ar-android / ribbon.html
Created Jul 30, 2019
Simple css ribbon
View ribbon.html
<html>
<head>
<meta charset="UTF-8">
<title>CSS Ribbon</title>
<style>
.container {
margin: 0 auto;
width: 800px;
}
@ar-android
ar-android / randomString.js
Created Jul 29, 2019
Create random string in javascript.
View randomString.js
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;
}
@ar-android
ar-android / build.gradle
Created Jun 25, 2019
Minimal gradle dependency for LWJGL 3
View build.gradle
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"
View Instal SFML Mac.md

Install SFML

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
View snippet-lwjgl.sh
-Djava.library.path=libs/native/macosx
View ShaderProgram.java
package engine.graphic;
import static org.lwjgl.opengl.GL20.*;
public class ShaderProgram {
private int programId;
private int vertexId;
private int fragmentId;
View GameEngine.java
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;
You can’t perform that action at this time.